Skip to content

Instantly share code, notes, and snippets.

View pilt's full-sized avatar

Simon Pantzare pilt

View GitHub Profile
# deb cdrom:[Ubuntu 10.10 _Maverick Meerkat_ - Release amd64 (20101007)]/ maverick main restricted
# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to
# newer versions of the distribution.
deb http://se.archive.ubuntu.com/ubuntu/ natty main restricted
deb-src http://se.archive.ubuntu.com/ubuntu/ natty main restricted
## Major bug fix updates produced after the final release of the
## distribution.
deb http://se.archive.ubuntu.com/ubuntu/ natty-updates main restricted
@pilt
pilt / gist:1281299
Created October 12, 2011 14:03
Stevey's Google Platforms Rant
I was at Amazon for about six and a half years, and now I've been at
Google for that long. One thing that struck me immediately about the
two companies -- an impression that has been reinforced almost daily --
is that Amazon does everything wrong, and Google does everything right.
Sure, it's a sweeping generalization, but a surprisingly accurate one.
It's pretty crazy. There are probably a hundred or even two hundred
different ways you can compare the two companies, and Google is superior
in all but three of them, if I recall correctly. I actually did a
spreadsheet at one point but Legal wouldn't let me show it to anyone,
even though recruiting loved it.
2 gustaf
3 henke
1 pontus
class Foo(object):
def to_json(self):
return json.dumps(self, cls=MongoEncoder)
plans: [{id: 1, ...}, {id: 2, ...}]
meals: [{plan: 1, ...}, {plan: 1, ...}]
workouts: [{plan: 1, ...}, {plan: 1, ...}]
istället för
plans: [{id: 1, meals: [...], workouts: [...]}, ...]
$ java -version
java version "1.6.0_29"
Java(TM) SE Runtime Environment (build 1.6.0_29-b11-402-11D50b)
Java HotSpot(TM) 64-Bit Server VM (build 20.4-b02-402, mixed mode)
urlpatterns = pattern('physiology.views',
menu('phys_and_medication',
submenu('medicine', url(r'^medicine/$', ...)),
submenu('phys', url(r'^something/$', ...)),
submenu('phys', url(r'^something-else/$', ...)),
),
)
def unpacked(callback):
"""Decorator to unpack responses before passing the result to a callback.
"""
@functools.wraps(callback)
@tornado.stack_context.wrap
def unpacking_callback(response):
callback(mdp.unpack_response(response))
return unpacking_callback
>>> import boto
>>> boto.__version__
'2.4.0'
>>> boto.connect_cloudsearch()
Traceback (most recent call last):
File "<ipython-input-7-3f612380cada>", line 1, in <module>
boto.connect_cloudsearch()
File "/Users/sp/.virtualenvs/mem-backend/lib/python2.7/site-packages/boto/__init__.py", line 552, in connect_cloudsearch
from boto.cloudsearch.layer2 import Layer2
ImportError: No module named cloudsearch.layer2
@pilt
pilt / results
Created June 15, 2012 11:54
Riak storage comparisons
Test case
----------
Riak version 1.1.2. Insert 5,000 items. Do it five times and compute
means. The data dir size is calculated before and after iterations.
Bitcask vs. LevelDB
-------------------
Disk space: 1.113 : 1.000
Time taken: 1.000 : 1.016