def cache(func): """ A thin middleware that caches based on function name and arguments. """ def _inner(*args, **kwargs): a_str = "&".join([str(a) or None for a in args]) kw_str = "&".join(["%s=%s" for key, val in kwargs.iteritems()]) key_name = slugify("%s:%s:%s" % (func.__name__, a_str, kw_str)) cached = cache.get(key_name) if not cached: cached = func(*args, **kwargs) cache.set(key_name, cached) return [...]
Category Archives: Uncategorized
On Meditation
Third, meditation can help a man “be his own man” and feel comfortable in his own skin. That constant stream of input we face each day often carries messages of what we’re supposed to think or feel. Talking-heads spout off opinions as if they were facts. Advertisers try to convince us that buying such-and-such product [...]
Focus Time Hack (OSX)
Block facebook and reddit on your Mac; focus longer and get work done instead. Open up a terminal, copy and paste this: sudo echo “127.0.0.1\tfacebook.com\n127.0.0.1\treddit.com” >> /etc/hosts
Google Circles
I started using Google Plus three weeks ago. I like it a lot; I think I’ll keep using the service. The UI works, a lot of my friends are already on it, but most importantly it solves a problem that has not yet been solved online: easy, logical information sharing. Logical information sharing. Information sharing [...]
Land
LAND his approach to love he said was that of a farmer most love like hunters and like hunters most kill what they desire he tills soil through toes nose in the wet earth he waits prays to the gods and slowly harvests ever thankful. via Ayo
Forecast: Advertisements shown on the Amazon Kindle will drive higher click-through rates than current online advertising networks
Amazon announced their intentions of releasing an ad-supported Kindle today. There has been much discussion, and I’d like to add my thoughts. I purchased an Amazon Kindle in November 2010 and have had an interesting relationship with it from the beginning. I went through several typical phases that I imagine most Kindle owners go through: [...]
python goo.gl url shortener
#!/usr/bin/python from urllib2 import urlopen, Request from urllib import quote from simplejson import loads def shorten(url): u = urlopen(Request(‘http://goo.gl/api/url’, ‘url=%s’ % quote(url), {‘User-Agent’:'toolbar’})) a = loads(u.read()) return a['short_url']
Untitled Avicii Track – Yes!
ID_+_Vocal.mp3 Listen on Posterous This is the first house track that I’ve been excited about in a long time. I can only imagine what it would be like to drop this into the mid / late segment of a set. Amazing buildup; melody that takes you far, far away. ULTRA has an amazing lineup this year.
see you, space cowboy.
http://www.reddit.com/r/IAmA/comments/fy6yz/51_hours_left_to_live/c1jigox