View easypost-scrape.js
const async = require('async');
const Easypost = require('node-easypost');
const csv = require('fast-csv');
const fs = require('fs');
const stream = require('stream');
var start_date = new Date('2017-03-01');
var easypost_key = 'fixme';
View ssh identity stash for private repos
eval "$(ssh-agent -s)"
eval ssh-add ~/.ssh/id_rsa
Enter passphrase for /Users/developer/.ssh/id_rsa:
Identity added: /Users/developer/.ssh/id_rsa (/Users/developer/.ssh/id_rsa)
npm install
View localized time on App Engine
def getLocalDatetime():
utc_dt = datetime.datetime.now()
central_tz = pytz.timezone('US/Central')
utc = pytz.utc
ltime = utc.localize(utc_dt).astimezone(central_tz)
return ltime
## end getLocalDatetime
View app-engine-redirector.py
import os
import logging
from google.appengine.ext import webapp
from google.appengine.ext.webapp import util
blog_slugs = {
'my-post' : '/12/09/',
'my-second-post' : '/12/12/'
}
View posterous-get-posts.js
var request = require('request');
var site_id = 7963;
var grab_post_page = function(page) {
request.get({
url: 'http://posterous.com/api/2/sites/'+site_id+'/posts/public?page='+page,
headers: {
'Content-Type': 'application/json'
}
}, function(error, response, body) {
View gist:1209756
class CallHandler(webapp.RequestHandler):
def post(self):
# extract the message and phone
message = self.request.get('Body')
phone = self.request.get('From')
# the first word tells us everything...
first = message.lower().split()[0]
View gist:1209748
class CronHandler(webapp.RequestHandler):
def get(self,time_slot=""):
logging.debug('running cron for timeslot %s' % time_slot)
if systemIsOn() is False:
logging.error('bailing... the system is turned off')
return
# grab the row of data out of the spreadsheet
results = getResults(time_slot)
View Twilio prompt user for verification
<Response>
    <Say>
Press one if you said, I love Fluffernutter Pie. Otherwise, press two.
</Say>
    <Gather
action="/verificationHandler"
/>
</Response>
View Twilio REST interrupt call
POST https://api.twilio.com/2010-04-01/Account/{AccountSid}/Calls/{CallSid}
   CurrentURL=http://mydomain.com/interrupthandler
View Twilio hold pattern
<?xml version="1.0" encodeing="UTF-8"?>
<Response>
    <Say>
Please wait while we work on your request.
</Say>
    <Play loop=100>
http://mydomain.com/coolmusic.mp3 
</Play>
</Response>