Skip to content

Instantly share code, notes, and snippets.

View stevegraham's full-sized avatar
🛠️
Building @tellerhq

Stevie Graham stevegraham

🛠️
Building @tellerhq
View GitHub Profile
call.complete!
res.say "Damn! This is so easy. I'm overwhelmed! I need a moment!"
res.pause :length => 5
res.say "I'm ok now!"
class FooController < ApplicationController
responds_to :html, :voice
def index
...
end
end
Twilio::Config.setup do
account_sid 'AC0000000000000000'
auth_token '000000000000000000'
end
call = Twilio::Call.create :to => '+14155551212',
:from => '+14155550000',
:url => 'http://demo.twilio.com/welcome'
# Twilio REST API version
API_VERSION = '2010-04-01'
# Twilio AccountSid and AuthToken
ACCOUNT_SID = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
ACCOUNT_TOKEN = 'YYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYY'
# Outgoing Caller ID previously validated with Twilio
CALLER_ID = 'NNNNNNNNNN';
require 'open-uri'
def r b; b*38 if URI('http://roulette.engineyard.com/').read[/13/] end
while self[:slug].nil? && Referral.exists? :slug => self[:slug]
self[:slug] = ActiveSupport::SecureRandom.hex 6
end
def method_missing(meth, *args, &blk)
if value.include? meth
class << self; self; end.instance_eval { define_method(meth) { value[meth] } }
send meth
else
super
end
end
run lambda { |env| [302, {'Content-Type'=>'text/plain', 'location' => 'http://blog.shrewple.com'}, Array.new] }