Skip to content

Instantly share code, notes, and snippets.

View mou55's full-sized avatar

Moussa IDARDAR mou55

View GitHub Profile
@mou55
mou55 / tips.py
Last active September 7, 2015 15:10 — forked from nicolargo/tips.py
Python tips for optimization
#############################################################################
# Apply a function to a list
#############################################################################
# Instead of...
newlist = []
for word in oldlist:
newlist.append(word.upper())
# ... use map
for name in *.wav; do lame $name "$name.mp3"; done
@mou55
mou55 / .gitconfig
Created February 26, 2015 18:17
some useful git aliases (.gitconfig file)
[user]
email = X@Y.Z
name = name
[alias]
llog = log --date=local
runserver = instaweb --httpd=webrick
stopserver = instaweb --httpd=webrick --stop
logg = log --graph --decorate --oneline --abbrev-commit --all
ls = log --pretty=format:"%C(yellow)%h%Cred%d\\ %Creset%s%Cblue\\ [%cn]" --decorate
ll = log --pretty=format:"%C(yellow)%h%Cred%d\\ %Creset%s%Cblue\\ [%cn]" --decorate --numstat
apt-get install python-pygraphviz
pip install django-extensions
# add 'django_extensions' to INSTALLED_APPS in settings.py
python manage.py graph_models trees -o test.png