Skip to content

Instantly share code, notes, and snippets.

View tganzarolli's full-sized avatar

Thiago Ganzarolli tganzarolli

View GitHub Profile
@mrrooijen
mrrooijen / deploy.rb
Created May 16, 2011 18:12
Unicorn + Bluepill + Capistrano with RVM
$:.unshift(File.expand_path('./lib', ENV['rvm_path']))
require "rvm/capistrano"
set :application, "my_app"
set :repository, "[email protected]:myuser/myapp.git"
set :branch, "production"
set :rvm_ruby_string, "1.9.2"
set :deploy_to, "/var/applications/"
set :user, "username"
@dnagir
dnagir / rspec-syntax-cheat-sheet.rb
Created November 5, 2010 09:29
RSpec 2 syntax cheat sheet by example
# RSpec 2.0 syntax Cheet Sheet by http://ApproachE.com
# defining spec within a module will automatically pick Player::MovieList as a 'subject' (see below)
module Player
describe MovieList, "with optional description" do
it "is pending example, so that you can write ones quickly"
it "is already working example that we want to suspend from failing temporarily" do
pending("working on another feature that temporarily breaks this one")
@tomas-stefano
tomas-stefano / before_changes.rb
Created October 21, 2010 19:18
before_changes
module BeforeChanges
def before_changes
before_change_object = self.clone
changes.each do |changed_field, change|
before_change_object.send("#{changed_field}=", change[0])
end
before_change_object
end
end
module OAuth::RequestProxy::Net
module HTTP
class HTTPRequest < OAuth::RequestProxy::Base
def query_string
params = [ query_params, auth_header_params ]
params << post_params if
['POST', 'PUT'].include?(method.to_s.upcase) && form_url_encoded?
params.compact.join('&')
end
end