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
| call.complete! |
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
| res.say "Damn! This is so easy. I'm overwhelmed! I need a moment!" | |
| res.pause :length => 5 | |
| res.say "I'm ok now!" |
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
| class FooController < ApplicationController | |
| responds_to :html, :voice | |
| def index | |
| ... | |
| 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
| Twilio::Config.setup do | |
| account_sid 'AC0000000000000000' | |
| auth_token '000000000000000000' | |
| 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
| call = Twilio::Call.create :to => '+14155551212', | |
| :from => '+14155550000', | |
| :url => 'http://demo.twilio.com/welcome' |
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
| # 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'; |
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
| require 'open-uri' | |
| def r b; b*38 if URI('http://roulette.engineyard.com/').read[/13/] 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
| while self[:slug].nil? && Referral.exists? :slug => self[:slug] | |
| self[:slug] = ActiveSupport::SecureRandom.hex 6 | |
| 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
| 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 |
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
| run lambda { |env| [302, {'Content-Type'=>'text/plain', 'location' => 'http://blog.shrewple.com'}, Array.new] } |