This file contains 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
#!/usr/bin/env python | |
from dateutil import parser | |
from dateutil.tz import gettz | |
import csv | |
import os | |
import sys | |
FORMAT = '%Y-%m-%d %H.%M.%SZ.pdf' |
This file contains 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
#!/usr/bin/env python | |
from dateutil import parser | |
from dateutil.tz import gettz | |
import csv | |
import os | |
import sys | |
FORMAT = '%Y-%m-%d %H.%M.%SZ.pdf' |
This file contains 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
import ast | |
from django import template | |
register = template.Library() | |
class StripNode(template.Node): | |
""" | |
Strips leading and trailing characters in the enclosed content. |
This file contains 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
user www-data; | |
worker_processes 1; | |
error_log /var/log/nginx/error.log warn; | |
pid /var/run/nginx.pid; | |
events { | |
worker_connections 1024; | |
} |
This file contains 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
#!/bin/bash | |
#/etc/init.d/uwsgi | |
daemon=/usr/local/bin/uwsgi | |
pid=/var/run/uwsgi.pid | |
args="--master --emperor /etc/vassals/ --uid www-data --daemonize /var/log/uwsgi/uwsgi.log" | |
case "$1" in | |
start) | |
echo "Starting uwsgi" |
This file contains 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
[uwsgi] | |
socket = /tmp/example.com.sock | |
; Worker processes | |
master = 1 | |
processes = 4 | |
; Virtualenv and home directory | |
virtualenv = /var/virtualenvs/example.com | |
chdir = /var/www/example.com |
This file contains 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
server { | |
listen 80; | |
server_name example.com; | |
charset utf-8; | |
location /static/ { | |
alias /var/www/example.com/static/; | |
} |
This file contains 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
#!/usr/bin/env python | |
import argparse | |
from fractions import Fraction | |
MAX_BRIGHTNESS_FILE = '/sys/class/backlight/intel_backlight/max_brightness' | |
BRIGHTNESS_FILE = '/sys/class/backlight/intel_backlight/brightness' | |
if __name__ == '__main__': |
This file contains 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
#!/usr/bin/env python | |
import sys | |
import random | |
if __name__ == '__main__': | |
contents = sys.stdin.readlines() | |
random.shuffle(contents) | |
sys.stdout.write(''.join(contents)) |
This file contains 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
" With pathogen: place in ~/.vim/bundle/quicktab/plugin | |
" Without pathogen: place in ~/.vim/plugin | |
" Sets tab size to `size`. | |
function! QuickTabSet(size) | |
let &tabstop = a:size | |
let &softtabstop = a:size | |
let &shiftwidth = a:size | |
echo 'Changed tab size to '.a:size.' spaces' | |
endfunction |