3 Tips for Designing RESTful APIs

There are countless books, websites and other resources that talk about how RESTful APIs should be designed. So naturally I have to add to the pile.

The Three Stages of a Programmer

A pet theory of mine is, that there are three stages every programmer goes through throughout their career. Maybe they sound familiar to you.

How Programming Has Made Me a Better Person

I guess there's something to learn in anything. During the last few month I was thinking about what programming has taught me. When the notion of "it probably made me a better person" popped into my mind, I was pretty surprised, to say the least.

Musings on Object Oriented Programming: Asking the Right Questions

Here's a thing I don't like: People asking me stuff like Hey, do you have time on Saturday? while they want to ask Hey, I'm moving. Can you help me haul all my stuff up and down 22 floors on Saturday? I have no way knowing what they want until I gave an answer (or asked why?).

Rainerhaertl.de

Update: Sadly Rainer, who I considered more than a client, died much too early on the 26th of October 2013. I know he will be missed.

RESTful Web Applications: Code Less, Do More

What does web development mean? Usually you build some software that gets data out of some database converts it to HTML and sends it to a browser. Usually that software has to handle the other case, too: Receive input from a browser, make sense of it and write the data into the database. There’s your average web project.

How to Handle Database Views in Django/South

In a recent Django project I had to work with Postgres views quite extensively. The problem is that while South does a great job handling model related stuff, you’re on your own when handling views and other database level stuff. So I thought I’d share the simple/simplistic solution I came up with.

Siri is from the Future

So you probably heard about the new iPhone by now. And perhaps you are one of the many people that said something along the lines "Meh, so it's just the iPhone 4 with upgraded hardware and that gimmicky feature which allows you to talk to your phone.” You probably are failing to see the point because it’s too big.

How to Make a Better Analog Watch

Have you ever thought about the difference of digital watches versus analog ones? I'll tell you: Digital ones are better at their job and here's why.

Studi-tools.de

Update 2012-11-07: My uni decided to put the schedule and room information behind a login so I my scripts can no longer access those. As such the project is pretty much dead. This is especially sad since the tools the uni offers are - let's say lacking.

On CSS Structure

Because I have to do some collaborative work on CSS files (no Sass/Compass) these days I'd like to take the time and write down some pointers regarding CSS structure.

My Take on Indention

Many battles have been fought about how to indent. And finally it's my time to beat you around the head with my opinion. Here we go.

Why Web Development is Done in PHP or Java

These days I'm getting more and more frustrated by my fellow students. It seems everybody is trying to get through with as little work as possible and those who are at least motivated are very reluctant to learn any new languages/technologies.

Why My Mac Made My Sansa Clip+ Hang

Yeah well the other day I got me one of those shiny modern MP3 player thingies — namely a Sansa Clip+. Really nice gadget and all but whenever I copied some of my OGGs on it it would hang during the library update.

A Howto on Django Syndication

Last week I had to implement a customized RSS feed in Django for the first time. Sounded like a fun project to me until I had a look at the documentation which is… well let's just say it's not as good as the core documentation.

The Difference Between Work and Play

The other day I was wondering what the difference is between work and the screwing around I do at home for fun. After putting quite some thought into it and coming up with the typical explanations like not getting paid, being able to choose what you want to do and stuff it struck me: There are no deadlines for stuff.

Clear Up Gelato CMS' Gibberish

My search for a nice and easy tumble blog I can host myself lead me in a pretty straight line to Gelato CMS. But when I looked into the database after I had been playing around with it a bit I saw that all umlauts (äöü for you non-umlaut knowing ignoramus people) turned to garbage.

Make Django Send Mails to Admins Only

Image you are running a staging system for your Django project on which all the testing for the production system is done. You are using a dump of the production database to have some actual data you can play around with. And you have this one/many function/s in which you send email to some/all users. They probably will not be happy to get all those emails from your staging system while not having the slightest idea what's going on.

How to Fix Portage

And all of a sudden I got this on my Gentoo server no matter what I tried to emerge:

Wee Free Icons

I'm talking about the little images - not the star people everybody goes crazy about. Anyway, after having used the Silk Icons for what seems an eternity (they are good you know) it was time for something new.

The Problem With Django, Nginx and FCGI

Alright after about a whole day of near-continuous downtime I finally found the bug that I overcame few months ago already. I'm using nginx as proxy to Django per FCGI. Now after upgrading nginx the site started to misbehave. No matter which location I tried to access I always ended up on the index page.

Pink Ponies for Everybody!

These days I'm quite amused by all the rage about HTML5 and CSS3. Don't get me wrong I absolute am for it. There are so many hacks and 'techniques' around to archive stuff that should just be in there that sometimes people seem to forget that it could be different.

Whoosh Makes the Haystack

In search of a workable search pluggable for Django I played a bit with Django Sphinx some time ago. Its potentially nice but involves a lot of work to configure Sphinx itself. So it was difficult enough to configure for me to drop it.

Selenium is Pretty Neat

I've been playing with Selenium at work for some time now and the more I saw of it the testing framework the more I was impressed.

OpenID for Free

After I see more and more sites offering OpenID authentication and more and more people using it I finally got interested enough to see for myself what it all is about. I didn't do so earlier because I just am getting a little paranoid and OpenID just seemed to me like giving some big, faceless company access to virtually anything I do on the web. Turns out that is not the case.

CSS is the New C - Sass is the Future

So the other day I started to look for tools that let me use variables in CSS. This mainly was because it really gets old to copy paste the same colors over and over again. Thanks to Twitter soon I was pointed in the direction of LESS.

Die Cache, Die

If you ever need to remove a cache fragment that has been created by the cache template tag do like so:

What if Twitter Stopped to be Tomorrow?

So a combination of two Tweets made me go to thinking mode the other day. The first one asked: "What would you do/think if Twitter didn't exist tomorrow?" And the second one: "I'll leave Twitter in the coming weeks - 140 characters aren't enough."

Django Performance Tuning - Speed Up!

So these days I spend a lot of my workday trying to get a Django app up to speed that... wasn't exactly written with performance in mind. Here are a few things that helped me speed up that thing (all without going down to SQL level):

Django Members That are in Fact Raw SQL

So the other day I wondered if it wasn't pretty cool if Django models would have something like members that are in fact raw queries. On the bus home it occurred to me that this functionality already exists. Just add a custom manager to a model which always returns querysets with extras.

With Django Debug Toolbar You Can Debug Django… Duh

So since right now I'm playing the performance optimizer again I searched for a nice profiling/debugging tool for Django. Loads of snippets I found, loads of middleware, loads of scripts and stuff. And then a colleague of mine said "you know I always used something called Django debug toolbar or something". I'm like "alright let's google for it and see if it's any good".

Macs are Like Tools

So I will say this and then I'll be out of the whole Mac/PC flamewar again.

Why I Barely Ever Read Comments

Alright, after some out-time mainly due to work-overload in the last few weeks (and the general laziness of my person) let's see what we can do.

Fun With Forms in Django

Now here I got another pearl. It bugged me to no end that one cannot have a ModelForm and override only certain attributes of a certain field without having to overwrite the whole field with all of its default attributes. Well, seems that is actually possible, like so:

Subversion: Ignore More

Just a little reminder for myself, since I never am able to recall how to ignore stuff in Subversion:

It's Time for Python Dateutils

Since I often have to do with date and time arithmetic, Python dateutil seems quite interesting. Loads of additional features concerning date and time stuff. I have play a bit with it sometime.

Html Validator - Valid HTML - Profit

If you are into web development you probably have to code some HTML from time to time if not constantly. And if you are anything like me you always try to get your HTML as valid as possible (I mean, come on - there are cases when you just say 'screw it'). So while the W3 Markup Validation Service is nice and stuff, its not really what you call convenient.

Django Can Be Too Convenient

Django is nice, I think I have made my point clear on that. As a framework it lets you some truly short code that does quite a lot. It's convenient. But you should be careful to not let yourself fall into the trap of convenience. Here's an example of what I mean:

Get Windows for Free (For Internet Explorer Testing on Mac)

Alright so you're one of those web developer/web designer guys, too? And you're on a Mac and still need to test those websites on the loathed abomination known as Internet Explorer? If you don't want to shell out any money to be able to do what you probably hate here's a quick guide:

Fun With Python Stracktraces

Today while happily hacking away at my Python code I found myself in the following situation: I needed the traceback of an exception while not wanting the whole app to exit because of the exception being raised.

So Sweet the Crons - Sweetcron

If you are one of those people that totally are into life feeds/streams of... well anything then you will perhaps be interested in Sweetcron. It's one of those hip lifestream tools - but if you're a bit paranoid about your personal data (like me) than you probably would rather host something like that yourself.

News From the South

Okay this is exciting news. My favorite Django migration tool South has received a major update. I just stumbled over some changes to the documentation when I browsing the site the other day.

Take a Note on the Side With Sidenote

So you're coding for a living and every few minutes there is this snippet of code you would like to keep around just in case but don't know where to put it? Or perhaps you're one of these people that have great ideas constantly but just never got a piece of paper?

Piwik Even Sounds Cooler Than Google Analytics

For all of you who like me are getting a bit paranoid about Google these days and still would like to have the nice stuff that a tracker like that provides I got one nice tool for you: Piwik. This thingie tries to be the free, open source Google Analytics (they actually say that) and it actually comes pretty close for its price.

Pixen, Pixel… Editor

Okay I couldn't come up with a witty title this time - sue me. But nevertheless I have a real treat for you today. Sure we all use Photoshop and there surly isn't anything that can compare. Yeah, yeah we know that. But what about those times you fire up the big beast that Photoshop is just to edit some tiny little graphic or need to come up with a simple icon?

Suspicious SuspiciousOperation Exceptions

Using Apache and Django is throwing SuspiciousOperation Exception in your face and you have no idea why? Chances are you are using absolute paths. Django doesn't like that. It expects you to be a good boy/girl and put all your stuff under MEDIA_ROOT with relative paths. Everything else is perceived as suspicious behavior it seems.

Plug in TextMate

Funny that I didn't know until a short while ago that my favorite text editor TextMate supports plug-ins. Even funnier: With ProjectPlus the lighty light TextMate almost becomes a mini IDE.

Put Into Grand Perspective

I've been searching for a Mac app that allows me to see where all my precious hard drive space has gone. There is quite a nice little app called SequoiaView which is really good at that task — sadly it's not available for my beloved Mac.

Sub Fine Mecum Nemo Non Consentiet

I find it interesting that everybody that had the chance (was forced) to work on a Mac for a period of time buys one sooner or later. Most probably do cause these thingies are really good lookin' - I'm not deluding myself there. But I also think that once used to Mac OS nobody really wants to go back to Windows that soon.

You Don't Print the Web Do You?

Somehow I find it funny that so many web designers and agencies advertise their services with 'pixel perfectness'. That probably would mean the site looks like the Photoshop template - down to the pixel. Just like with print stuff where you define positions with a precision of three positions after decimal point and it will look exactly like that when it's done.

What the Heck is a KeePass?

Sometimes I don't get people: "Oh heck what was my ICQ again? Could you give it to me?" Or how about "Oh... what was my login and pass for my web space again?"

I'm Too Cheap for .Mac

Got multiple Macs and don't feel the need to spend money on .Mac? Unison to the rescue! This little tool lets you synchronize directory trees and acts like its some kind of simple CVS, meaning it detects conflicts (for example when a file has been changed on multiple Macs) and lets you resolve them.

Going South

Okay so after taking a few hours to find out how to get a unique SlugField into the database per South here's what I found out:

Database Switcheroo

Switching the database is quite fun with Django. In my case I'm slowly migrating my sites from MySQL to Postgres.

Django? Isn't That Something Like Rails?

Rails is great. At least better than anything I know that is done with PHP. PHP is really some nasty stuff. Seems like more and more people realize that and jump on the Ruby on Rails band wagon. Well since everybody else says its that great it has to be, no?