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
capability = Twilio::Util::Capability.new TWILIO_SID, TWILIO_AUTH_TOKEN | |
capability.allow_client_outgoing(APP_SID) | |
token = capability.generate | |
render :json => { :token => token } |
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.Device.setup(CAPABILITY_TOKEN) |
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
{ | |
AccountSid: OMITTED | |
ApplicationSid: OMITTED | |
Caller: client:Anonymous | |
CallStatus: ringing | |
Called: '' | |
To: '' | |
CallSid: CAfa7bff3856207f387a11f9fc7ce281e8 | |
From: client:Anonymous | |
Direction: inbound |
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
{ | |
AccountSid: AC6c8c88b048a04a173cc629cae521d701 | |
ApplicationSid: AP6b9619422181dc4e78e2051f4ad126c6 | |
Caller: client:Anonymous | |
CallStatus: ringing | |
Called: '' | |
To: '' | |
foo: bar | |
CallSid: CA7fd72394a784f268e0a9bdc251b73204 | |
From: client:Anonymous |
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 agent | |
response = Twilio::TwiML::Response.new do |r| | |
r.Dial do |d| | |
d.Number(params[:outgoing_number]) | |
end | |
end | |
render :xml => response.text | |
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
Build Proxygen on OSX | |
brew install boost | |
brew install libevent | |
brew install thrift | |
brew install bison |
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
package main | |
import ( | |
"encoding/json" | |
"fmt" | |
"io/ioutil" | |
) | |
/* | |
sample json |
I hereby claim:
- I am jonahglover on github.
- I am jonahglover (https://keybase.io/jonahglover) on keybase.
- I have a public key whose fingerprint is AA54 1C7C 6A1D 11CC 6969 6681 256F B6D4 683F 4E70
To claim this, I am signing this object:
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 unique_open_rate | |
recipient_activities = recipient_messages.joins(:activities) | |
((recipient_activities.where("activities.activity_type = 'open'").distinct.count.to_f / recicipient_messages.count) * 100).round(2) | |
end | |
query | |
user.messages.select("messages.*, | |
COUNT(DISTINCT recicipient_messages.id) recipient_count, | |
COUNT(DISTINCT activities.id) total_activities, |
OlderNewer