Skip to content

Instantly share code, notes, and snippets.

@ore-public
ore-public / fizzbuzz.rb
Created June 13, 2013 06:15
metaprogramming fizzbuzz
class Fixnum
def fizzbuzz
return :fizzbuzz if self % 15 == 0
return :buzz if self % 5 == 0
return :fizz if self % 3 == 0
self
end
end
@ore-public
ore-public / deploy.rb
Created September 27, 2012 07:01
capistranoのunicorn再起動のところ
namespace :deploy do
task :start, :roles => :app, :except => { :no_release => true } do
run "cd #{current_path} && bundle exec unicorn -c #{current_path}/config/unicorn.rb -E production -D"
end
task :stop, :roles => :app, :except => { :no_release => true } do
run "kill -KILL -s QUIT `cat #{shared_path}/pids/unicorn.pid`"
end
task :restart, :roles => :app, :except => { :no_release => true } do