Skip to content

Instantly share code, notes, and snippets.

View sagnew's full-sized avatar

Sam Agnew sagnew

  • Twilio
  • New York City
View GitHub Profile
@sagnew
sagnew / pennapps.py
Created September 4, 2015 22:03
PennApps demo make phones ring
from twilio.rest import TwilioRestClient
client = TwilioRestClient()
for msg in client.messages.iter(to='74310', date_sent='2015-09-04'):
client.calls.create(to=msg.from_, from_='+16103475323',
url='http://gnarly.io/pennappsvoice.xml')
@sagnew
sagnew / resend.php
Created June 24, 2015 20:50
PHP Resend example
<?php
$client = new Services_Twilio($AccountSid, $AuthToken);
$messageSIDs = array("Insert", "Array of", "Message SIDs", "here");
foreach ($messageSIDs as $sid) {
$msg = $client->account->messages->get($sid);
if ($msg->status == "undelivered") {
@sagnew
sagnew / food.py
Created June 24, 2015 18:40
Quick python help
candy = 'snickers'
right = True
while right:
answer = (raw_input('whats your favorite candy? '))
if answer == candy:
print 'yes'
right = False
elif answer == 'chocolate' or answer == 'food':
print 'close. try again'
$(document).ready(function(){
var total = $("div[id^='0']").length;
var count = 0;
var click_array = [];
var run = function(){
$('td>div').each(function() {
$(this).one( "click", function() {
$( this ).css( "background-color", "blue" );
click_array.push(this);
@sagnew
sagnew / gist:f0772ac77fe64c5484cf
Last active August 29, 2015 14:04
Foodbot todo/ideas
User Friendliness:
Display more restaurants if only 2 or 3 have different cuisine
Display order number when order is placed, and total price.
Display prices of meals when displaying meals
Display top 5 matches
Bugs:
Bot gets killed for unknown reasons