brew install pipenv
echo "alias py=\"pipenv\"" >> ~/.zshrc
echo "PYTHONDONTWRITEBYTECODE=1" >> ~/.zshrc # don't create .pyc files for Python source files
echo "PIPENV_VENV_IN_PROJECT=1" >> ~/.zshrc # create .venv in the source project
# From http://chriskiehl.com/article/parallelism-in-one-line/ | |
import urllib2 | |
from multiprocessing.dummy import Pool as ThreadPool | |
urls = [ | |
'http://www.python.org', | |
'http://www.python.org/about/', | |
'http://www.onlamp.com/pub/a/python/2003/04/17/metaclasses.html', | |
'http://www.python.org/doc/', |
[alias] | |
c = commit -m | |
a = add | |
aa = !git add -u && git add . && git status | |
co = checkout | |
cob = checkout -b | |
up = !git fetch origin && git rebase origin/master | |
ir = !git rebase -i origin/master | |
undo = reset HEAD~1 --mixed | |
st = status --short |
window.$w8 = window.$w8 || function (fn) { | |
if (document.readyState === 'complete' || document.readyState !== 'loading') { | |
fn(); | |
} else { | |
document.addEventListener('DOMContentLoaded', fn); | |
} | |
}; | |
window.$gme = window.$gme || document.querySelector.bind(document); | |
window.$$gme = window.$$gme || document.querySelectorAll.bind(document); |
I hereby claim:
To claim this, I am signing this object:
// http://jsfiddle.net/D8VQs/ | |
function print(str, obj) { | |
console.log(str, obj); | |
// Use jQuery if it's available | |
if (typeof($) != 'undefined') { | |
var $output = $('#output'); | |
if ($output) { |
from os import path | |
from django.conf import settings | |
DOCUMENT_ROOT = path.dirname(path.realpath(__file__)) | |
urlpatterns += patterns('', | |
url(r'^robots\.txt$', 'django.views.static.serve', { | |
'path': settings.STATIC_URL + 'robots.txt', | |
'document_root': DOCUMENT_ROOT, |
from django.http import Http404 | |
from django.shortcuts import render_to_response | |
from django.template import RequestContext, TemplateDoesNotExist | |
def content(request, template_name): | |
try: | |
return render_to_response('content/' + template_name + '.html', {}, RequestContext(request)) | |
except TemplateDoesNotExist: | |
raise Http404 |
import urllib2 | |
from multiprocessing.dummy import Pool as ThreadPool | |
urls = [ | |
'http://www.python.org', | |
'http://www.python.org/about/', | |
] | |
pool = ThreadPool() |