Skip to content

Instantly share code, notes, and snippets.

View pedro's full-sized avatar

Pedro Belo pedro

  • San Francisco, CA
  • X @ped
View GitHub Profile
@pedro
pedro / *scratch*
Created December 18, 2008 21:04 — forked from bmizerany/*scratch*
remote = Rush::Box.new('root@ec2-75-101-233-253.compute-1.amazonaws.com')
remote.bash("ls")
require 'sinatra'
require 'builder'
def home
content_type 'text/xml', :charset => 'utf-8'
builder do |xml|
xml.instruct!
xml.Response do
xml.Gather("numDigits" => "1", "action" => "press", "method" => "POST") do
xml.Say "For a good time, press 1"
@pedro
pedro / retry_upto.rb
Created October 7, 2011 08:42 — forked from glenngillen/retry_upto.rb
retry_upto.rb
# Ruby's `retry` with steroids:
#
# - retry up to 5 times without waiting between them and retrying after any exception
#
# retry_upto(5) do ... end
#
# - retry up to 5 times, waiting 2 seconds between retries and retrying after any exception
#
# retry_upto(5, :wait => 2) do ... end
#