Skip to content

Instantly share code, notes, and snippets.

View jtauber's full-sized avatar

James Tauber jtauber

View GitHub Profile
How I created a Google Apps [email protected] gmail account when I already had a Google Account called
[email protected]:
1) While signed in to [email protected] Google Account, I created a temporary @gmail.com email address.
This effectively enabled me to alternatively log into my existing Google Account via that @gmail.com address
2) I logged out and signed up for Google Apps with username [email protected]
3) I added a 'jtauber' user under the jtauber.com Google Apps domain and gave it Super Admin privileges.
That effectively shut out my ability to log into my original Google Account with [email protected] but
I still can using the temporary @gmail.com address created in step 1.
@jtauber
jtauber / .bash_profile
Created September 3, 2011 10:55
OS X 10.7 Setup
export PATH=/usr/local/bin:$PATH
export PATH=/usr/local/share/python:$PATH
RED="\[\033[01;31m\]"
GREEN="\[\033[32m\]"
LGREEN="\[\033[01;32m\]"
YELLOW="\[\033[01;33m\]"
BLUE="\[\033[01;34m\]"
PURPLE="\[\033[01;35m\]"
CYAN="\[\033[01;36m\]"
#!/usr/bin/env python
import os
import os.path
for root, dirs, files in os.walk("."):
for filename in files:
path = os.path.join(root, filename)
if any(filename.endswith(ending) for ending in [".py", ".html", ".txt", ".css"]):
marked = []
#!/usr/bin/env python
import os
import os.path
for root, dirs, files in os.walk("."):
for filename in files:
path = os.path.join(root, filename)
if any(filename.endswith(ending) for ending in [".py", ".html", ".txt", ".css"]):
tabs = False
@jtauber
jtauber / gist:167009
Created August 13, 2009 05:33
Pi in Hex
# Implementation of Simon Plouffe's formula for Pi in Hex
#
# James Tauber 2007-03-14
# http://jtauber.com/blog/2007/03/14/generating_the_hex_digits_of_pi/
def pi():
N = 0
n, d = 0, 1
while True:
xn = (120*N**2 + 151*N + 47)
# Python implementation of the Gibbons-Lester-Bird algorithm[1] for enumerating
# the positive rationals.
#
# James Tauber 2004-07-01
# http://jtauber.com/
#
# [1] http://web.comlab.ox.ac.uk/oucl/work/jeremy.gibbons/publications/rationals.pdf
def rationals():
"""
# brainf*** Interpreter in Python
# Copyright (c) 2002 & 2006, James Tauber
#
# see http://en.wikipedia.org/wiki/Brainfuck
import sys
class brainf:
def __init__(self, program):
# Bash snippet to open new shells in most recently visited dir.
# Useful if you want to open a new terminal tab at the present
# tab's location.
#
# Put this in your .bashrc or whatever.
pathed_cd () {
if [ "$1" == "" ]; then
cd
else