Skip to content

Instantly share code, notes, and snippets.

View guiocavalcanti's full-sized avatar

Guilherme Cavalcanti guiocavalcanti

View GitHub Profile

Benchmark Bundler

Because loading gems can take longer than you think

$ curl -fsSL https://gist.github.com/raw/5022636/benchmark.rb | ruby
............................................................[DONE]

Gem                            Time(sec)     Pct %
--------------------------------------------------
#!/usr/bin/env ruby
require 'benchmark'
REGEXPS = [
/^no such file to load -- (.+)$/i,
/^Missing \w+ (?:file\s*)?([^\s]+.rb)$/i,
/^Missing API definition file in (.+)$/i,
/^cannot load such file -- (.+)$/i,
]
@guiocavalcanti
guiocavalcanti / api.rb
Created October 8, 2012 18:18 — forked from fltiago/api.rb
require "debugger"
class Wally < Grape::API
format :json
helpers do
def permit
@permit ||= Permit::Mechanism.new
end
end
@guiocavalcanti
guiocavalcanti / gist:1621846
Created January 16, 2012 17:13 — forked from julianalucena/gist:1604350
Kind of dojo about Git

Kind of dojo about Git

  • Create a repository and push it to Github
  • Change some files and commit it
  • Create two files and edit an existent file, add all to the index and make a commit only with one of the new files
  • Create another branch (cool) and change files
  • (Stash here we go!)
  • Go to master branch and push the modifications
  • Go back to cool branch, unstash, commit and push
  • Put the commits on cool branch on master branch doing a merge
@guiocavalcanti
guiocavalcanti / gist:1600711
Created January 12, 2012 14:10
Configurando ambiente ruby

O que são essas coisas?

  • RVM: gerenciador de versões de ruby. Porém o mais legal dele é facilitar a compilação.
  • RubyGems: gerenciador de dependências entre Gems (biblioticas ruby). É o apt-get do Ruby.
  • Rails 3: um gem (biblioteca) da linguagem Ruby
  • MySQL: Sistema de gerenciamento de banco de dados usado no Redu
  • SQLite: Sistema de gerenciamento de banco de dados portátil.

Instalação do Ruby 1.8/Rails 3 usando o RVM no Ubuntu

juliana:~ julianalucena$ brew doctor
Your OS X is ripe for brewing.
Any troubles you may be experiencing are likely purely edit.