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")
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() |
#!/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 |
#!/usr/bin/env python | |
import urllib | |
import urllib2 | |
import getpass | |
from xml.dom import minidom | |
class Grua: | |
def __init__(self, username, password): |
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")
#!/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 |
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) |
# -*- 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" |