View Vagrantfile
# -*- mode: ruby -*-
# vi: set ft=ruby :
BOX_NAME = ENV['BOX_NAME'] || "ubuntu"
BOX_URI = ENV['BOX_URI'] || "http://files.vagrantup.com/precise32.box"
AWS_REGION = ENV['AWS_REGION'] || "us-east-1"
AWS_AMI = ENV['AWS_AMI'] || "ami-23d9a94a"
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
VAGRANTFILE_API_VERSION = "2"
View basic_auth.py
import urllib2, base64
request = urllib2.Request("http://api.url")
base64string = base64.encodestring('%s:%s' % (username, password)).replace('\n', '')
request.add_header("Authorization", "Basic %s" % base64string)
result = urllib2.urlopen(request)
View file_completion.py
#!/usr/bin/env python
import readline
import glob
def complete(text, state):
for file in glob.glob(text+"*"):
if not state:
return file
else:
state -= 1
View python_tab_complete.md

Add this to your PYTHONSTARTUP (~/.pythonrc.py) file:

try:
    import readline
except ImportError:
    print "Module readline not available."
else:
    import rlcompleter
    readline.parse_and_bind("tab: complete")
View google.py
#!/usr/bin/env python
import urllib
import urllib2
import getpass
from xml.dom import minidom
class Grua:
def __init__(self, username, password):
View git-env-setup.sh
#!/bin/bash
if [ $# -ne 2 ]
then
echo "Usage: $0 <name> <email>"
exit 1
fi
git config --global user.name $1
git config --global user.email $2
View timing.py
from timeit import default_timer
class Timer(object):
def __init__(self, verbose=False):
self.verbose = verbose
self.timer = default_timer
def __enter__(self):
self.start = self.timer()
View ajax.js
function ajax(url, callback) {
var x = new XMLHttpRequest();
x.onreadystatechange = function(){
if (x.readyState == 4) {
callback(x.responseText);
}
};
x.open("GET", url);
x.send();
}
View genpass.py
#!/usr/bin/env python
# genpass.py
# Random password generation
# author: Patrick Pelletier
import md5
import random
def genpass(len=20):
''' generates a random password based on the md5 of a random float '''
View shell.py
#!/usr/bin/env python
import cgi
import subprocess
import cgitb
cgitb.enable()
def run(command):
if not command: