This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
> fact(100) | |
>> _fac1(100) | |
>>> _fac1(50) | |
>>>> _fac1(25) | |
>>>>> _fac1(12) | |
>>>>>> _fac1(6) | |
>>>>>>> _fac1(3) | |
>>>>>>>> _fac1(1) ==> (1, 1, 0) | |
>>>>>>>> _fac_odd(3, 4) ==> 3 | |
>>>>>>> _fac1(3) ==> (3, 3, 1) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
di: 7292 | |
st: 7281 | |
log: 3844 | |
ci: 3660 | |
rev-parse: 3192 | |
push: 1880 | |
config: 1670 | |
nudge: 1441 | |
for-each-ref: 1369 | |
qref: 1287 |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# Script to manage iptables rules -- executed when eth1 is brought up. See | |
# also /etc/network/interfaces | |
if [[ `whoami` != 'root' ]] | |
then | |
echo "Sorry dude... Gotta be root." | |
exit 1 | |
fi |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def _autofmthelper(name, fmt, postprocess=None): | |
def fmtfunc(self): | |
result = fmt.format(self=self) | |
if postprocess is not None: | |
result = postprocess(self, result) | |
return result | |
fmtfunc.__name__ = name | |
return fmtfunc | |
def autounicode(fmt): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# prompt examples: | |
# [3 jobs master virtualenv] ~/code/myproject/foo | |
# [1 job my-branch virtualenv] ~/code/bar/ | |
# [virtualenv] ~/code/ | |
# ~ | |
# Very, very fast, only requiring a couple of fork()s (and no forking at all to determine the current git branch) | |
if [[ "$USER" == "root" ]] | |
then | |
export PS1="\e[1;31m\]\u \[\e[1;33m\]\w\[\e[0m\] "; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Performs a "safe" merge, confirming the commits to be merged, the merge | |
# strategy, any conflicts, etc. | |
# Useage: | |
# $ git safemerge master | |
# Commits: | |
# * bc911ef Fix bug in widget | |
# * e80f8d1 Clean things up | |
# | |
# Changes: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"net" | |
"strings" | |
"bufio" | |
"fmt" | |
) | |
const ( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Reverts HEAD back to ORIG_HEAD, for example after a 'git pull' accidentally | |
# creates a merge. This is identical to running 'git reset --hard ORIG_HEAD', | |
# except that unpull prints some helpful information along the way. | |
# Useage: | |
# $ git unpull | |
# HEAD: a0ac0fd Merge branch 'master' of /tmp/foo | |
# 2284c9d some remote commit | |
# ORIG_HEAD: 35431fd my local commit | |
# Really reset HEAD to ORIG_HEAD? (y/n) y |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- looking at the first 4 characters of names | |
-- count name | |
-- 1 197 names that appear once | |
-- 2 30 names that appear twice | |
-- 3 ryan, nick, just, juli, jess, jenn, fran, bria, bran, aaro | |
-- 4 matt, marc, jeff, anto, andr | |
-- 5 mike, dani, dan | |
-- 6 jame, davi | |
-- 7 jaso | |
-- 8 alex, adam |