Skip to content

Instantly share code, notes, and snippets.

View porcow's full-sized avatar
🏠
Working from home

0xNil porcow

🏠
Working from home
View GitHub Profile
@porcow
porcow / configure.sh
Created July 21, 2012 14:49
Configure parameters for PHP 5.4 on Lion
./configure \
--prefix=/usr \
--mandir=/usr/share/man \
--infodir=/usr/share/info \
--sysconfdir=/private/etc \
--with-apxs2=/usr/sbin/apxs \
--enable-cli \
--with-config-file-path=/etc \
--with-libxml-dir=/usr \
--with-openssl=/usr \
@porcow
porcow / tail_call_optimized.py
Created May 3, 2012 01:58
Tail Call Optimization Decorator (Python recipe)
## {{{ http://code.activestate.com/recipes/474088/ (r1)
#!/usr/bin/env python2.4
# This program shows off a python decorator(
# which implements tail call optimization. It
# does this by throwing an exception if it is
# it's own grandparent, and catching such
# exceptions to recall the stack.
import sys
@porcow
porcow / PrimeIter.py
Created April 13, 2012 19:39
Prime Number Iterator
def PrimeIter(num):
seq = [ i for i in xrange(num) ]
def gen():
for n in seq:
if 2<=n<=num/2:
yield n
@porcow
porcow / hack.sh
Created March 31, 2012 10:16 — forked from erikh/hack.sh
OSX For Hackers
#!/usr/bin/env sh
##
# This is script with usefull tips taken from:
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
#
# install it:
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh
#
@porcow
porcow / about.md
Created November 9, 2011 05:16 — forked from jasonrudolph/about.md
Programming Achievements: How to Level Up as a Developer