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
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
Photographs from Wikipedia articles:
| #!/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 |
| # source of a massive memory leak in a Django app (if obj is QuerySet): | |
| if not obj: | |
| return None |
| #!/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 |
| #!/usr/bin/env sh | |
| sudo curl -L http://3.narf.pl/iTunes.icns > /Applications/iTunes.app/Contents/Resources/iTunes.icns | |
| echo 'relog, remove itunes from dock, go to /Applications and drag it back' |
| -- mysql unicode ffs | |
| DROP DATABASE foo; | |
| CREATE DATABASE foo CHARACTER SET utf8 COLLATE utf8_general_ci; |
To fix plotting in Octave.app in latest Snow Leopard (10.6.6 at the
moment of writing) change /Applications/Gnuplot.app/Contents/Resources/bin/gnuplot
as follows:
@@ -31,7 +31,7 @@ ROOT=`(cd "${BASE}" 2>/dev/null && pwd)`
# startup the Gnuplot program.
GNUPLOT_HOME="${ROOT}"
PATH="${ROOT}/bin:${PATH}"
-DYLD_LIBRARY_PATH="${ROOT}/lib:${DYLD_LIBRARY_PATH}"
+DYLD_LIBRARY_PATH="${ROOT}/lib"
I wasted too much time trying to make MySQLdb work with Python 2.5 (mysteriously it worked fine with 2.7). I thought I'll share my experience.
I installed MySQLdb normally with pip install MySQL-python (yeah,
ingenious name) and there were no problems. But every time I imported
it, I got following error: