Skip to content

Instantly share code, notes, and snippets.

Matt Stevenson mattoc

Block or report user

Report or block mattoc

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
mattoc /
Created Nov 13, 2012
Django: handle form validation with combined POST and FILES data
"""Allows checking of form POST data as well as uploaded files when validating
a standard Django `forms.Form`.
The short version is that you check `Form().files` in the `clean()` method,
assuming the form has been bound to the request.
mattoc / .vimrc
Created Oct 11, 2012
Show line numbers in vim based on terminal size
View .vimrc
" I like having line numbers on, but don't want to wrap lines in a
" standard-sized terminal window.
fun! WinSizeAutoNumber()
if winwidth(0) > 84
set number
set nonumber
mattoc / .bash_aliases
Created Sep 27, 2012
mattoc's .screenrc
View .bash_aliases
# Use this when on your remote machine, before you reattach a screen session
alias scratch='$HOME/bin/grabssh; screen -d -R'
# Use this in a screen session on your remote machine when you need agent forwarding
alias fixssh='source $HOME/bin/fixssh'
You can’t perform that action at this time.