Skip to content

Instantly share code, notes, and snippets.

@jsocol
jsocol / gist:430368
Created June 8, 2010 17:36
git-fall - Fetch and prune all remotes
#!/bin/bash
# Fetch and prune all remotes.
for r in `git remote`
do
git remote prune $r
git fetch $r
done
@jbalogh
jbalogh / async_signals.py
Created September 23, 2010 04:24
A monkeypatch for ``django.dispatch`` to send signals asynchronously.
"""
A monkeypatch for ``django.dispatch`` to send signals asynchronously.
Usage::
>>> import async_signals
>>> async_signals.start_the_machine()
``django.dispatch.Signal.send`` is replaced with an asynchronous version that
adds the signal to a queue processed on a background thread. The synchronous
@jbalogh
jbalogh / urlconf_decorator.py
Created September 23, 2010 17:32
Apply a decorator to a whole urlconf instead of a single view function.
"""
Apply a decorator to a whole urlconf instead of a single view function.
Usage::
>>> from urlconf_decorator import decorate
>>>
>>> def dec(f):
... def wrapper(*args, **kw):
... print 'inside the decorator'
# pip install growl-py
try:
import Growl
i = Growl.Image.imageFromPath('media/img/amo2009/logo-mozilla.gif')
g = Growl.GrowlNotifier(applicationName='z', applicationIcon=i,
notifications=['Info'])
g.register()
g.notify('Info', 'ZAMBONI', None)
except Exception, e:
@cowboy
cowboy / HEY-YOU.md
Last active July 1, 2024 08:37
jQuery Tiny Pub/Sub: A really, really, REALLY tiny pub/sub implementation for jQuery.
@mojombo
mojombo / vwilight.vim
Created January 26, 2011 03:23
vwilight.vim: A TRUE Twilight color theme for Vim
" Vim color file
" Converted from Textmate theme Twilight using Coloration v0.2.5 (http://github.com/sickill/coloration)
set background=dark
highlight clear
if exists("syntax_on")
syntax reset
endif
@adammiller
adammiller / douglasPeucker.js
Created February 14, 2011 16:54
Javascript implementation of the Douglas Peucker path simplification algorithm
var simplifyPath = function( points, tolerance ) {
// helper classes
var Vector = function( x, y ) {
this.x = x;
this.y = y;
};
var Line = function( p1, p2 ) {
this.p1 = p1;
#!/bin/bash
# To run do:
# wget https://gist.github.com/raw/850359/ea02e22f021b7ebf2f602811461677ab4a3f2a9e/bootstrap.sh && chmod +x bootstrap.sh && ./bootstrap.sh && source ~/.profile
#
# Based on Amazon EC2 AMI ID ami-ccf405a5 Ubuntu Server 10.10
# This script will:
# * install/config apache2
# * install mod_wsgi
# * install/config nginx
[alias]
st = status
ci = commit
co = checkout
br = branch
ls = branch
s = status
a = add
b = branch
d = diff
@jbalogh
jbalogh / django-tutorial.sh
Created April 8, 2011 03:00
Install all the tools you need to get playdoh set up.
# pip is a tool for installing Python packages.
sudo easy_install pip
# Essential tools for any self-respecting Python programmer.
sudo pip install virtualenv virtualenvwrapper ipython
# This is where we keep Python environments.
mkdir ~/.virtualenvs
# Set up our shell for virtualenvwrapper.