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 / testlib.sh
Created December 20, 2015 21:10 — forked from rtomayko/testlib.sh
Simple shell command language test library.
#!/bin/sh
# Usage: . testlib.sh
# Simple shell command language test library.
#
# Tests must follow the basic form:
#
# begin_test "the thing"
# (
# set -e
# echo "hello"
- Information and the Nature of Reality, Davies and Gregersen
- Swarm Intelligence, Bonabeau, Dorigo, Theraulaz
- Chaos, ed. Arun V. Holden
- Linked, Baraboa
- The Origins of Order, Kauffman
- Investigations, Kauffman
- Emergence, Steven Johnson
- Elements of Information Theory, Cover, Thomas
- The End of Certainty, Prigogine
- Physical Fluid Dynamics, Tritton

How to set up stress-free SSL on an OS X development machine

One of the best ways to reduce complexity (read: stress) in web development is to minimize the differences between your development and production environments. After being frustrated by attempts to unify the approach to SSL on my local machine and in production, I searched for a workflow that would make the protocol invisible to me between all environments.

Most workflows make the following compromises:

  • Use HTTPS in production but HTTP locally. This is annoying because it makes the environments inconsistent, and the protocol choices leak up into the stack. For example, your web application needs to understand the underlying protocol when using the secure flag for cookies. If you don't get this right, your HTTP development server won't be able to read the cookies it writes, or worse, your HTTPS production server could pass sensitive cookies over an insecure connection.

  • Use production SSL certificates locally. This is annoying

func fetch(c *check) {
f := &fetcher{}
for {
f.once(c)
}
}
struct fetcher {
resp *http.Response
err error
}
#!/usr/bin/env ruby
require 'bundler'
gems = ARGV
if gems.empty?
puts "Updating all gems"
Bundler.definition(true)
@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 <torsten.becker@gmail.com>
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 / 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