This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Resque | |
module Mailer | |
class MessageDecoy | |
def deliver | |
record = @args.first | |
resque.enqueue @mailer_class, @method_name, record.class.name, record.id | |
end | |
end | |
end | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
gem 'resque', :require => 'resque/server' | |
gem 'resque-loner', :git => 'git://github.com/jayniz/resque-loner' | |
gem 'resque-scheduler' | |
gem 'resque_mailer' | |
gem 'resque-jobs-per-fork', :git => 'git://github.com/collectiveidea/resque-jobs-per-fork' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
rvm get latest | |
rvm reload | |
rvm install 1.9.3 | |
rvm 1.9.3 --default | |
gem install bundler --pre # --pre is optional & gets you a faster pre-release | |
bundle | |
# remove rake from your Gemfile, as it's part of ruby | |
# or update it in your bundle: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# build a hash of specified attribute values | |
# | |
# attrs_for(User.first, :name) | |
# => {"name"=>"Snoop Dogg"} | |
# | |
# in a test: | |
# post :create, :monkey => attrs_for(monkey, :name, :age) | |
# | |
def attrs_for(object, *attrs) | |
hash = {} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# if re-install: | |
# rm -rf ~/.rvm/gems/ruby-1.9.2-p290 | |
curl https://raw.github.com/gist/999435/fc2718ac3f488ab2341b65dc2ae5c123f8859bff/fast-require-ruby-19.2-p180 > /tmp/ruby192-require.patch | |
curl https://raw.github.com/gist/856296/patch-1.9.2-gc.patch > /tmp/ruby192-gc.patch | |
rvm get head && rvm reload | |
rvm uninstall 1.9.2 | |
rvm install 1.9.2 --patch /tmp/ruby192-require.patch --patch /tmp/ruby192-gc.patch | |
rvm 1.9.2 --default |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
bundle install | |
bundle exec rake |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
gem 'rake', '~> 0.9.3.beta.1' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
git checkout -b ruby193 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
rvm get head | |
rvm reload | |
rvm install 1.9.3-preview1 | |
rvm use 1.9.3 | |
bundle install | |
bundle exec rake |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
server = "google.com" | |
cmd = "ping -c 1 #{server}" | |
while true do | |
`#{cmd}` | |
if ($?.exitstatus != 0) | |
puts "Down: " + Time.now.to_s | |
while ($?.exitstatus != 0) do | |
`#{cmd}` | |
end | |
puts "Up: " + Time.now.to_s |