Skip to content

Instantly share code, notes, and snippets.

View tiagoefmoraes's full-sized avatar

Tiago Moraes tiagoefmoraes

View GitHub Profile
@tiagoefmoraes
tiagoefmoraes / esnextbin.md
Last active October 31, 2016 18:34
esnextbin sketch
@tiagoefmoraes
tiagoefmoraes / esnextbin.md
Last active October 19, 2016 18:05
esnextbin sketch
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
<title>Stripe Getting Started Form</title>
<!-- The required Stripe lib -->
<script type="text/javascript" src="https://js.stripe.com/v2/"></script>
<!-- jQuery is used only for this example; it isn't required to use Stripe -->
@tiagoefmoraes
tiagoefmoraes / big_decimal_inspect.rb
Created March 5, 2015 15:39 — forked from henrik/big_decimal_inspect.rb
Better BigDecimal inspect for tests and diffs
class BigDecimal
def inspect
format("#<BigDecimal: %s>", to_s('F'))
end
end
@tiagoefmoraes
tiagoefmoraes / step_by_step.rb
Created February 13, 2015 18:20
Define steps to process arrays in batches
def self.join(first, last)
if first.is_a?(Range) && last.is_a?(Range)
first.first..last.last
elsif first.is_a?(Range)
first.first..last
elsif first == last
first
else
first..last
end
@tiagoefmoraes
tiagoefmoraes / consolidate_migrates.sh
Created November 21, 2014 13:45
Consolidate migrates
#!/bin/bash
set -e
schema_migrate="db/migrate/20141107164010_schema.rb"
echo Running current migrations...
rm db/migrate/*
git checkout db/migrate/
rm -f $schema_migrate
dropdb -U postgres bedel_test
@tiagoefmoraes
tiagoefmoraes / mac-setup.md
Last active August 29, 2015 14:10
Mac os setup
  1. Go to App Store and install Xcode.
  2. Open and accept the terms
  3. Then go to the terminal and install "Command Line Tools":
xcode-select --install
@tiagoefmoraes
tiagoefmoraes / keybase.md
Created September 22, 2014 20:08
keybase.md

Keybase proof

I hereby claim:

  • I am tiagoefmoraes on github.
  • I am tiagoefmoraes (https://keybase.io/tiagoefmoraes) on keybase.
  • I have a public key whose fingerprint is 61A3 00D4 8FB5 E0AF EE05 3D7F 597B 4699 75CF 0E23

To claim this, I am signing this object:

@tiagoefmoraes
tiagoefmoraes / install.sh
Last active December 23, 2015 10:09
FreePascal silent install (and uninstall) on Ubuntu
wget http://downloads.sourceforge.net/project/freepascal/Linux/2.6.2/fpc-2.6.2.x86_64-linux.tar
tar -xvf fpc-2.6.2.x86_64-linux.tar
pushd fpc-2.6.2.x86_64-linux
echo 'echo /home/action/fpc' > answers.sh
echo 'echo Y' >> answers.sh
echo 'echo Y' >> answers.sh
echo 'echo Y' >> answers.sh
echo 'echo Y' >> answers.sh