Skip to content

Instantly share code, notes, and snippets.

@jwebcat
jwebcat / gist:5122366
Last active October 9, 2025 13:52 — forked from lemenkov/gist:1674929
Properly download from github using wget and curl
wget --no-check-certificate --content-disposition https://github.com/joyent/node/tarball/v0.7.1
# --no-check-cerftificate was necessary for me to have wget not puke about https
curl -LJO https://github.com/joyent/node/tarball/v0.7.1
@sebclaeys
sebclaeys / autodict.py
Created September 19, 2011 20:49
Python autodict: implicitly create a dictionary instead of raising KeyError + support for object-like dot access + dictionary visitor
# Autodict class
# Create new autodict if accessing undefined key
# support dot access syntax (mydict.test == mydict['test'])
class autodict(dict):
def __getitem__(self, name):
if not name in self:
dict.__setitem__(self, name, autodict())
return dict.__getitem__(self, name)
def __getattr__(self, name):
@justintv
justintv / .bashrc
Created August 17, 2009 00:53
Display git branch in bash prompt
# If you work with git, you've probably had that nagging sensation of not knowing what branch you are on. Worry no longer!
export PS1="\\w:\$(git branch 2>/dev/null | grep '^*' | colrm 1 2)\$ "
# This will change your prompt to display not only your working directory but also your current git branch, if you have one. Pretty nifty!
# ~/code/web:beta_directory$ git checkout master
# Switched to branch "master"
# ~/code/web:master$ git checkout beta_directory
# Switched to branch "beta_directory"