Skip to content

Instantly share code, notes, and snippets.

View kevinastone's full-sized avatar

Kevin Stone kevinastone

View GitHub Profile
@kevinastone
kevinastone / workon.bash
Last active August 29, 2015 13:55
Bash function and completion script to allow quick switching between projects (especially if they share a relative virtualenv dir)
# Change this to your base projects path [$WORKON_BASE_DIR/{project1,project2,...}]
WORKON_BASE_DIR=/mnt/hgfs
# Change this to your relative virtual_env dir (if exists) [$WORKON_BASE_DIR/{project}/$VENV_DIR]
VENV_DIR=".env"
function workon() {
[ -z "$VIRTUAL_ENV" ] || deactivate
cd $WORKON_BASE_DIR/$1 &&
[ -d $VENV_DIR ] && source $VENV_DIR/bin/activate
@yuchant
yuchant / sorl_pil_engine.py
Created February 27, 2012 01:29
Sorl Thumbnail PIL Engine that accepts PNG conversion to JPG with background color
"""
Sorl Thumbnail Engine that accepts background color
---------------------------------------------------
Created on Sunday, February 2012 by Yuji Tomita
"""
from PIL import Image, ImageColor
from sorl.thumbnail.engines.pil_engine import Engine