Skip to content

Instantly share code, notes, and snippets.

View tsnow's full-sized avatar

Tim Snowhite tsnow

  • Palantir
  • Washington, DC
View GitHub Profile
@tsnow
tsnow / .travis.yml
Created December 10, 2013 18:11
RC Travis test speed up ideas
cache:
- db/max_fixture_date
- db/max_script_date
- db/test_data_cache.sql
script: bundle exec rake db:test:from_travis_cache test
#!/usr/bin/env ruby
require 'bundler'
gems = ARGV
if gems.empty?
puts "Updating all gems"
Bundler.definition(true)
@tsnow
tsnow / 0_README.md
Last active December 28, 2015 20:19
Rack VCR proxy

VCR-Proxy

This is a sinatra server which might proxy requests to a backend, and VCR that shit so you can rerun further integration tests later against the same data.

Oh. And it has some pretty limited support for mocking responses too.

@tsnow
tsnow / proxy.rb
Created November 20, 2013 00:00 — forked from torsten/proxy.rb
#!/usr/bin/env ruby
# A quick and dirty implementation of an HTTP proxy server in Ruby
# because I did not want to install anything.
#
# Copyright (C) 2009 Torsten Becker <[email protected]>
require 'socket'
require 'uri'
@tsnow
tsnow / compare.rb
Created November 19, 2013 19:13 — forked from mattgaidica/compare.rb
require 'digest/md5'
require 'aws/s3'
#set your AWS credentials
AWS::S3::Base.establish_connection!(
:access_key_id => 'XXX',
:secret_access_key => 'XXX'
)
#get the S3 file (object)
@tsnow
tsnow / 1_initiate_subscription.js
Created November 11, 2013 20:16
Temporary Subscription / WebHook API
// To get all the events for a given device during a particular
// period without polling, one can create a subscription API.
// This is somewhat similar to PubSub, save that each event is
// it's own http connection.
//
// This is an extension of a simple firehose API,
// which allows subscribing to specific subfeeds. Here we'll assume that
// the subfeeds are subscribed to by device_name/id, but any static list
// of characteristics would do.
//
@tsnow
tsnow / 1_Initiate_call.js
Last active December 27, 2015 22:39
Twilio "Dial Someone Else" Flow
// When your user wants to call someone, they call your /make_call webservice:
// yourserver.com POST /{user_id}/make_call.json?To={OtherParticipantPhoneNumber}
//
// You then ask Twilio to call your user (user_id)'s phone number.
// You'll then tell Twilio to call the other participant's phone number.
//
// yourserver.com Client => api.twilio.com POST /2010-04-01/Accounts/{AccountSid}/Calls{?From,To,Url}
// From: a twilio phone number
// To: first participant (user_id)'s phone number
// Url: the url for 2_call_logic.xml below. Probably something like:
@tsnow
tsnow / 0_reuse_code.js
Created October 28, 2013 16:49
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@tsnow
tsnow / resque.sh
Created October 28, 2013 07:01 — forked from cwise/resque.sh
#!/bin/sh
#
# This script starts and stops the Resque daemon
# This script belongs in /engineyard/bin/resque
#
PATH=/bin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:$PATH
CURDIR=`pwd`
usage() {
sudo yum install git
#need IAM credentials for read for all services, see https://github.com/Netflix/edda/wiki/AWS-Permissions
export AWS_ACCESS_KEY_ID=xxx
export AWS_SECRET_KEY=xxx
export JAVA_OPTS="-XX:MaxPermSize=256M -Xmx1g"
git clone git://github.com/Netflix/edda.git
cd edda
./gradlew build
cd ..
wget http://fastdl.mongodb.org/linux/mongodb-linux-x86_64-2.4.3.tgz