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
| 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::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
| 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
| 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
| 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
| call.url = 'http://example.com/im_in_ur_appz_redirectin_ur_callz' |
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
| Gchart.instance_eval { def url; 'https://chart.googleapis.com/chart?' 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
| class IVRMenuController | |
| respond_to :voice | |
| def index | |
| case params['Digits'] | |
| when '1' then render :template => 'directions' | |
| when '2' then render :template => 'opening_hours' | |
| when '3' then render :template => 'special_offers' | |
| else render :template => 'welcome' | |
| 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
| Array.prototype.map = function(func) { | |
| var output = [] | |
| for(i=0; i < this.length; i++) { | |
| output[i] = func(this[i]) | |
| } | |
| return output | |
| } | |
| // Example usage: | |
| // [1,2,3].map(function(i) { return i * i }) |