Skip to content

Instantly share code, notes, and snippets.

@baob
baob / gist:1389393
Created November 23, 2011 18:06
Activating Git completion for homebrew-installed git
ln -s /usr/local/git/contrib/completion/git-completion.bash /usr/local/etc/bash_completion.d/git
(unless of course /usr/local/etc/bash_completion.d/git already exists, in which case you shouldn't be reading this)
@WebReflection
WebReflection / Function.prototype.notifier.js
Created November 7, 2011 18:08
A Function.prototype method handy to monitor "functions lifecycle"
Function.prototype.notifier = (function () {"use strict";
// (C) WebReflection - Mit Style License
function create(callback) {
function notifier() {
var args = [].slice.call(arguments), output;
if (fire(notifier, "before", callback, this, args, null)) {
try {
output = callback.apply(this, args);
} catch(e) {
fire(notifier, "error", callback, this, args, e);
@patrys
patrys / abstract.py
Created September 17, 2010 11:59
Parametrized apps for Django
class AbstractMixin(object):
_classcache = {}
@classmethod
def contribute(cls):
return {}
@classmethod
def construct(cls, *args, **kwargs):
attrs = cls.contribute(*args, **kwargs)