
Import Kindle highlights in Trello
Lately I had a lot of books to read, most of them technical in nature, but also some novels. While I did take speeding reading classes, I don’t always apply it, as I have different styles of reading a book based on its contents. For example, when reading a novel or a narrative, I don’t […]

Hacking the BCN house market
…is the name of the presentation I gave last week at the Barcelona Python Meetup, held for the first time on Skyscanner‘s premisses. It was supposed to be a lightning talk taking no more than 10 minutes about my adventure finding a flat in Barcelona, but it got stretched out to around 20 minutes. Once […]
Iterate thru dates in Python
Few days ago I was working on some python scripts that needed to iterate back and forth through calendar dates. Working with dates in python is pretty easy, due to its datetime package. Basically is like this:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
#!/usr/bin/env python import datetime start_date = datetime.date( year = 2010, month = 2, day = 1 ) end_date = datetime.date( year = 2010, month = 1, day = 1 ) list = [] if start_date <= end_date: for n in range( ( end_date - start_date ).days + 1 ): list.append( start_date + datetime.timedelta( n ) ) else: for n in range( ( start_date - end_date ).days + 1 ): list.append( start_date - datetime.timedelta( n ) ) for d in list: print d |
This works, but is somewhat lame and not quite reusable. The most “python-ish” way to do it […]
Django “anonymous_required” decorator
I like Django’s login_required decorator. It’s a clean and simple way to allow and/or deny un-logged-in users to access parts of the website. But I also felt the need for a decorator to allow me to restrict access to some views only to non logged-in users. For instance, if an user in logged in, it […]
Django configuration file
I’ve been using Django for quite some time now and I kind of like it. It provides a fast – really fast – and clean way of doing things. When I first started with Django, I’ve used it mainly for simpler projects and kept the larger, more complicated ones on Zend Framework. That’s because I […]
Advertising blog entries on Pidgin’s status
I wanted to write this post ever since I’ve read Radu’s Fortune and Pidgin’s status on Ubuntu post. Radu’s approach is quite lame and hard to use, because it relies on the user exporting a SQL dump file every time he posts something on the blog. And really, do you need *all* the posts in […]
Downloading a page’s content with python and WebKit
I’ve been bragging with this post for quite some time now. Well, I won’t do that any more, because it seems that pywebkitgtk isn’t the best way to to things out there and that my first solution to the problem sucks 🙁 Yes, the sad truth… Yesterday, I tried to put the application on the […]

Django…for the very first time
This is a post I’ve wanted to write for quite some time now, but there is so much say that I couldn’t get the time to write it all down. So I’ve decided to split the first impression on django topic into smaller articles, this being the first post from a longer django series. I […]

Pywebkitgtk – execute Javascript from python
Last week I’ve got a new assignment at my job: a crawler that was supposed to periodically visit some sites and download their content. Sounds simple, isn’t it? Well, it’s not. Mainly because we want to also get all the flash content and some of it is inserted with Javascript, via various libraries like SWFobject […]
Vim and python
Few months ago, at a wurbe edition, I’ve seen two great editors in action: vim and emacs. At first, I was impressed by Alex Nedelcu‘s presentation of emacs and I gave it a try, but I’ve switched to vim soon after, because emacs just…”didn’t feel right”. What I liked about emacs was that could be […]
Most commented