Skip to content

Instantly share code, notes, and snippets.

@aroscoe
aroscoe / multifile.py
Created February 20, 2010 01:22
MultiFileInput, MultiFileInput for Django
"""
A newforms widget and field to allow multiple file uploads.
Created by Edward Dale (www.scompt.com)
Released into the Public Domain
"""
from django.utils.encoding import force_unicode
from django.utils.datastructures import MultiValueDict
from django.utils.translation import ugettext
@aroscoe
aroscoe / pp.sh
Created March 4, 2010 05:49
pretty print piped json
python -c "import sys, json; data = sys.stdin.read(); print json.dumps(json.loads(data), sort_keys=True, indent=4);"
@aroscoe
aroscoe / serve.sh
Created May 16, 2011 22:08 — forked from iamjwc/serve.sh
Start a simple python server to serve files
#!/usr/bin/env bash
IP=`ifconfig | grep "inet " | grep -v "inet 127.0.0.1" | cut -f 2 -d " "`
PORT=$1
if [ -z "$1" ]
then
PORT=8000
fi
# Copy ip and port to pasteboard
@aroscoe
aroscoe / gist:1055150
Created June 29, 2011 22:14
Download all the files off a web page
wget -r -l 1 -nd --no-parent http://example.com/whereever/files/