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
@mixin angle($pseudo, $flip: false, $angle: 2deg) { | |
// Possible values for $pseudo are: before, after, both | |
@if $pseudo == 'before' or $pseudo == 'after' or $pseudo == 'both' { | |
position: relative; | |
z-index: 1; | |
$selector: if($pseudo == 'both', '&:before,&:after', '&:#{$pseudo}'); | |
#{$selector} { | |
background: inherit; | |
content: ''; |
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
# | |
# Working with branches | |
# | |
# Get the current branch name (not so useful in itself, but used in | |
# other aliases) | |
branch-name = "!git rev-parse --abbrev-ref HEAD" | |
# Push the current branch to the remote "origin", and set it to track | |
# the upstream branch | |
publish = "!git push -u origin $(git branch-name)" |
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
alias dj="python manage.py" | |
alias djdd="python manage.py dumpdata" | |
alias djld="python manage.py loaddata" | |
alias djm="python manage.py migrate" | |
alias djsh="python manage.py shell" | |
alias djsm="python manage.py schemamigration" | |
alias djs="python manage.py syncdb --noinput" | |
alias djt="python manage.py test" | |
alias djrs="python manage.py runserver" |
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
from django.http import HttpResponseRedirect | |
from django.conf import settings | |
from re import compile | |
EXEMPT_URLS = [compile(settings.LOGIN_URL.lstrip('/'))] | |
if hasattr(settings, 'LOGIN_EXEMPT_URLS'): | |
EXEMPT_URLS += [compile(expr) for expr in settings.LOGIN_EXEMPT_URLS] | |
class LoginRequiredMiddleware: | |
""" |