context:
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# encoding: utf-8 | |
""" | |
Invalidate Johnny Cache's cache for given models outside "normal Django" | |
(e.g. in a management command). | |
""" | |
from johnny.cache import invalidate | |
from johnny.middleware import QueryCacheMiddleware |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# source of a massive memory leak in a Django app (if obj is QuerySet): | |
if not obj: | |
return None |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# encoding: utf-8 | |
""" | |
Get list of JavaScript game engines ordered by number of watchers at GitHub. | |
""" | |
import json | |
from BeautifulSoup import BeautifulSoup | |
import requests |
Photographs from Wikipedia articles:
Oh, the joys of running tests with Johnny Cache on...
ipdb> Currency.objects.all()
[]
ipdb> Currency.objects.get(symbol='EUR')
<Currency: EUR/PLN>
ipdb> Currency.objects.count()
0
EDIT: solved -_-'
Etsy's statsd. Halp.
> node stats.js
/Users/narf/sandbox/statsd/config.js:33
{ graphitePort: 2003, graphiteHost: "localhost", port: 8125 }
moved to
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# Requirements: requests, lxml, cssselect | |
import requests | |
from lxml import html | |
TALKNAME = "TITLE OF MY AMAZING TALK (it's a secret!)" | |
COLOR = '\033[1;34m' | |
END = '\033[0m' | |
r = requests.get('http://2013.djangocon.eu/vote/') |
foo foo
(bar) (bar)
(baz ) (baz )
( qux)