Skip to content

Instantly share code, notes, and snippets.

View stefanfoulis's full-sized avatar

Stefan Foulis stefanfoulis

View GitHub Profile
@valyagolev
valyagolev / gist:1643096
Created January 19, 2012 21:54
a view which dispatches requests to it to different views
from django.views.generic.base import View
class HttpMethodDependedView(View):
routes = {
}
def dispatch(self, request, *args, **kwargs):
method = request.method.lower()
if method in self.routes:
@valyagolev
valyagolev / __init__.py
Created April 29, 2011 02:46
Django settings awesomness
from .base import *
try:
from .local import *
except ImportError:
pass
@smerrell
smerrell / gist:905949
Created April 6, 2011 16:13
My ~/.gitconfig aliases
[alias]
# Git-tfs workflows
ct = tfs ct --build-default-comment
tfsrebase = !git stash && git checkout master && git tfs pull && git checkout @{-1} && git rebase master && git stash pop
tfsworkflow = !git checkout master && git tfs pull && git checkout @{-1} && git rebase master && git checkout master && git merge @{-1} --ff-only && git tfs ct --build-default-comment
# Github workflows
upmaster = !git checkout master && git fetch upstream && git merge upstream/master --ff-only && git push origin HEAD
uprebase = !git checkout master && git fetch upstream && git merge upstream/master --ff-only && git push origin HEAD && git checkout @{-1} && git rebase master
@stefanfoulis
stefanfoulis / osx_developer_installation.rst
Last active December 23, 2019 02:32
Instructions on how to setup an OSX developer machine for (python/django) development

OSX Developer System installation

This guide assumes a fresh install of Mac OSX 10.7 Lion.

Brew User

@bobthecow
bobthecow / .gitconfig
Created June 10, 2010 15:30
Git aliases
[alias]
edit-unmerged = "!f() { git ls-files --unmerged | cut -f2 | sort -u ; }; $EDITOR `f`"
add-unmerged = "!f() { git ls-files --unmerged | cut -f2 | sort -u ; }; git add `f`"
lc = log ORIG_HEAD.. --stat --no-merges
smash = merge --no-commit --log
eat = branch -M
prune-all = !git remote | xargs -n 1 git remote prune
whois = "!sh -c 'git log -i --pretty=\"format:%an <%ae>\" --author=\"$1\" | sort -u' -"
whatis = show -s --pretty='tformat:%h (%s, %ad)' --date=short