Pedro Assunção

Archive for September, 2009

Django template filter: Show list of objects as table with fixed number of columns

I recently ran into the following problem: I needed to be able to display a list of users in a table that had a maximum of X columns. Since I could not find the solution on the Internet I decided to give it a try and here is my resulting template filter to do it: [...]

Busy dropzone

Just came back from an awesome weekend in my beautiful country of Portugal and I’m missing it already It started on Saturday morning, with a cool Airsoft game (similar to paintball, but more fun) in some cliffs in Evora. The plan was to go play in the morning, find a geocache nearby, and then stop [...]

Lunch reading habits

Lately I’ve been grabbing a couple of Paul Graham’s essays just before lunch and devouring them along with the meal. And I must say I’m getting addicted to them. He is clearly a well lived, intelligent person whose writing can be really inspiring to everyone, especially developers like me. I recommend, with no particular order, [...]

Found the coolest Japanese shop…

…right around the corner from the place where I’m staying now. And as proper Japanese culture fan-boy I could not resist the temptation of buying a new kimono. Boy, does this bring back memories from when I practiced Karate and Tai Chi Sayonara

OSX: Preventing iTunes from launching when pressing multimedia key

If, like me, you have this annoying problem where iTunes insists on launching every time you press a multimedia key on your keyboard (for instance play/pause/next/previous song) the fastest and most effective way to work around it is to get rid of iTunes completely: Move iTunes to the trash (from the applications folder); Move FrontRow [...]

Python: Sort list of tuples by second item

Straight from the PythonInfo Wiki: >>> import operator >>> L = [('c', 2), ('d', 1), ('a', 4), ('b', 3)] >>> map(operator.itemgetter(0), L) ['c', 'd', 'a', 'b'] >>> map(operator.itemgetter(1), L) [2, 1, 4, 3] >>> sorted(L, key=operator.itemgetter(1)) [('d', 1), ('c', 2), ('b', 3), ('a', 4)]

Super useful article on PostgreSQL

I’ve always been a fan of PostgreSQL, even though I’ve been forced to use MySQL at work for ages (you know, IT policies). Anyways, after reading this article I’m definitely switching all my pet projects to PostgreSQL. The documentation is amazing, the database itself is blazing fast and super scalable. And it’s open source. What [...]

Another successful jump day :)

Another great Saturday in the land that can have the 4 seasons all in one day. Started up early, getting up at 7am (part of my ongoing early riser experiment) and taking the train for 1 hour from Amsterdam to Apeldoorn. After that, since I took my bike with me, a nice 20m cycling ride [...]

Another day of jumping out of airplanes :D

Tomorrow I get to try out my new toy. That’s right, I just bought me a nice audible altimeter and can’t wait to use it. Here’s a pic: Hopefully the weather will cooperate and I’ll be able to do 3/4 jumps in Apeldoorn, Holland. They have a really cool parachute store right in front of [...]

Trying to become an early riser

After reading a post by Steve Pavlina I thought if  I could become a natural early riser, i.e, someone that gets up really early in the morning and has no problem with that. I felt curious when I read that, after turning into an early riser, he became more productive and felt more refreshed throughout [...]