Skip to content

Instantly share code, notes, and snippets.

View leewardbound's full-sized avatar

Leeward Bound leewardbound

View GitHub Profile
@leewardbound
leewardbound / redis-server.init.d
Created June 13, 2012 19:26
Ubuntu Redis init.d file
#! /bin/sh
### BEGIN INIT INFO
# Provides: redis-server
# Required-Start: $syslog $remote_fs
# Required-Stop: $syslog $remote_fs
# Should-Start: $local_fs
# Should-Stop: $local_fs
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: redis-server - Persistent key-value db
def curry_instance_attribute(attr, func_name, instance):
""" Curries the named attribute to the named function
>>> class Person():
... def __init__(self, name):
... self.name = name
... curry_instance_attribute('name', 'print_record', self)
... @classmethod
... def print_record(cls, name):
... print 'Person',name
>>> Person.print_record('bob')

Development Journal

9/13/11 --- I have finished the research

PHP:

New Visitors:

Time elapsed: 0.56040978431702

@leewardbound
leewardbound / bootstrap.sh
Created June 2, 2011 20:50 — forked from anonymous/bootstrap.sh
Django on Heroku with Celery and Sentry
virtualenv --no-site-packages .
source bin/activate
bin/pip install Django psycopg2 django-sentry
bin/pip freeze > requirements.txt
bin/django-admin.py startproject mysite
cat >.gitignore <<EOF
bin/
include/
lib/
EOF
# In .vimrc
" ipython integration
autocmd FileType python map <F5> :w<CR>:!screen -x ipython -X stuff $'\%reset\ny\n\%cd %:p:h\n\%run %:t\n'<CR><CR>
# In .bashrc
function vips() {
# A named screen session attached to ipython
# so it can be sent commands (from vim)
screen -D -R -S ipython ipython