View gist:bd66ad8cf4586674abe5
{ | |
"folders": | |
[ | |
{ | |
"path": "site", | |
"folder_exclude_patterns": [ | |
"node_modules", | |
".sass-cache", | |
".tmp", | |
"dist" |
View gist:91e0f24e3cbfa2852bbc
export EDITOR='nano' | |
export PATH="/Applications/Postgres.app/Contents/Versions/9.4/bin:/usr/local/bin:/usr/local/sbin:/usr/local/share/python:$PATH" | |
export HISTSIZE=10000 | |
export HISTFILESIZE=10000 | |
#export PROMPT_COMMAND='echo -ne "\033]0;`hostname -s`\007"' | |
export LSCOLORS=gxfxcxdxbxegedabagacad | |
export PIP_DOWNLOAD_CACHE=$HOME/Library/Caches/pip-downloads | |
alias ls='ls -aGp' | |
alias ll='ls -la' |
View grouper.html
<html> | |
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script> | |
<script> | |
// FUNCTION | |
function group(data, groupby) { | |
var grouped = {} |
View add_error.py
from django import forms | |
from django.forms.forms import NON_FIELD_ERRORS | |
class AddErrorMixin(object): | |
"Backport add_error() for django <1.7" | |
def add_error(self, field, msg): | |
field = field or NON_FIELD_ERRORS | |
if field in self._errors: | |
self._errors[field].append(msg) | |
else: |
View duration.py
from django import forms | |
from django.db import models | |
def split_duration(value): | |
if value: | |
return ( '%02d' % (value // 3600), | |
'%02d' % ((value % 3600) // 60), | |
'%02d' % (value % 60), | |
) | |
return ('00', '00', '00') |
View doubledecode.py
#!/usr/bin/env python | |
""" | |
Ever had a mysqldump of utf8 data stored in latin1 tables, dumped in utf8 and | |
munged with windows cp1252? | |
If so this is your friend. Just pipe it through this little baby and spare | |
yourself hours of unicode hell- it'll take your dirt and spit out clean utf8. | |
You can also import it and use it in your python code. |