Skip to content

Instantly share code, notes, and snippets.

View mrtazz's full-sized avatar
👨‍🔧
computer plumbing

Daniel Schauenberg mrtazz

👨‍🔧
computer plumbing
View GitHub Profile
@mrtazz
mrtazz / carbon.md
Created November 6, 2009 01:50 — forked from defunkt/carbon.md

Vim

autocmd BufWritePre * :%s/\s\+$//e

Emacs

(add-hook 'before-save-hook 'delete-trailing-whitespace)

Textmate

@mrtazz
mrtazz / license
Created January 27, 2010 11:56 — forked from defunkt/license
#!/bin/sh -e
# Usage: license
# Prints an MIT license appropriate for totin' around.
#
# $ license > COPYING
#!/bin/sh
echo "Copyright (c) `date +%Y` Daniel Schauenberg
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
import sys
import time
def progressbar(it, prefix = "", size = 60):
count = len(it)
def _show(_i):
x = int(size*_i/count)
sys.stdout.write("%s[%s>%s] %i/%i\r" % (prefix, "="*x, "-"*(size-x), _i, count))
sys.stdout.flush()
def tsplit(string, delimiters):
"""Behaves str.split but supports multiple delimiters."""
delimiters = tuple(delimiters)
stack = [""] # stack to return
for i in xrange(len(string)):
if string[i] in delimiters:
stack.append("")
else:
@mrtazz
mrtazz / history.txt
Created September 15, 2011 13:47 — forked from kennethreitz/history.txt
Most used commands, in order by usage, since last install
588 git
328 ls
249 cd
146 make
112 vim
100 cat
73 echo
64 chef-client
61 knife
57 gcc