This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# profile_middleware - a middleware that profiles views | |
# | |
# Inspired by udfalkso's http://www.djangosnippets.org/snippets/186/ | |
# and the Shwagroo Team's http://www.djangosnippets.org/snippets/605/ | |
# | |
# Install this by adding it to your MIDDLEWARE_CLASSES. It is active | |
# if you are logged in as a superuser, or always when settings.DEBUG | |
# is True. | |
# | |
# To use it, pass 'profile=1' as a GET or POST parameter to any HTTP |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
git_status() { | |
STATUS=$(git status -s 2> /dev/null) | |
LOCAL=$(git rev-parse "@" 2> /dev/null) | |
UPSTREAM=$(git rev-parse "@{u}" 2> /dev/null) | |
if [[ -n $STATUS ]] || ([[ -n $UPSTREAM ]] && [[ $LOCAL != $UPSTREAM ]]); then | |
git status -bs | |
fi | |
} | |
venv_git_status() { | |
[[ ! -d "$VIRTUAL_ENV" ]] && return |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
The MIT License (MIT) | |
Copyright (c) 2016 Interaction Consortium | |
Permission is hereby granted, free of charge, to any person obtaining a copy | |
of this software and associated documentation files (the "Software"), to deal | |
in the Software without restriction, including without limitation the rights | |
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
copies of the Software, and to permit persons to whom the Software is |