Skip to content

Instantly share code, notes, and snippets.

# ~/.virtualenvs/circus/bin/postactivate
#! /bin/bash
export BASE_URL="http://localhost:8000"
export DJANGO_SETTINGS_MODULE="circus.settings"
# ~/.virtualenvs/postdeactivate
#! /bin/bash
unset BASE_URL
unset DJANGO_SETTINGS_MODULE
function! TrimWhiteSpace()
%s/\s\+$//e
endfunction
autocmd BufWritePre * :call TrimWhiteSpace()
function TrimEndLines()
let save_cursor = getpos(".")
:silent! %s#\($\n\s*\)\+\%$##
call setpos('.', save_cursor)
endfunction
/*ELOQUENT JAVASCRIPT*/
// forEach
function forEach(array, action) {
for (var i = 0; i < array.length; i++)
action(array[i]);
}
// map
function map(func, array) {
var result = [];