How to automatically run unit tests from a git push

Tags:

Typically when working on code that has tests, you would want to make sure your tests pass when you share your code with other people. It’s generally a good idea to run the tests once in a while too, but why do it manually when you can automate?

In this post I’ll show a simple shell script you can use to plug into git, and automatically run your testsuite and optionally reject a push with failing tests.

Read More

DIY: LCD monitor repairs for beginners

Tags:

Broken LCD monitor. Doesn’t turn on, or maybe it doesn’t stay on once turned on, or perhaps it makes an annoying buzzing noise.

Sound familiar? One of my monitors recently broke and became like that, in fact it had all the symptoms above.

I thought I would have to waste a two-three hundred euros to get a new one, but turns out it might be possible to very easily (and cheaply!) repair it yourself.

Read More

Writing HTML is fun (if you don’t have to deal with IE)

Tags:

HTML and CSS are relatively straightforward languages. Yet there’s a certain amount of elegancy to them – I think you could even call well written markup art.

I quite enjoy writing HTML and CSS from time to time. Despite being simpler than programming languages, writing HTML still provides a challenge: How to put a design into code in the most elegant and functional way.

In programming you typically consider architectural things like classes and design patterns, how to separate concerns nicely and so on.

In HTML you don’t have these questions. Instead you face some different ones, like how do I do this part? Is using a h1 enough or do I need to wrap it into a div? What if I did it like this, could it save me some of that extraneous markup?

In programming having less code is usually good, but it also applies in markup, perhaps even more so. In programming, you can achieve benefits from abstracting, which leads to some more code but is justifiable from the benefits. In HTML, you don’t have things like this, so all extra is usually that – useless extra.

What takes away from being able to make your HTML and CSS elegant or nice is often the issue of cross-browser compatibility, particularly Internet Explorer. When things need to work in IE, you can’t take advantage of many of the CSS features which allow you to make the markup better. This also takes away the fun from it, and instead everything becomes horribly, horribly frustrating.

Using spatial data in Doctrine 2

Tags:

In this post I’ll introduce you to extending Doctrine 2 to provide ways to use custom data types and DQL functions.

We needed a simple way to store locations and calculate distances between points on maps and some other stuff for Wantlet. Since we are using MySQL, we decided to use MySQL’s Spatial Extensions for it since they seemed suitable.

We’re using Doctrine 2 as the ORM layer in the application, but it didn’t have any sort of data types or functionality for storing and operating on spatial data. Thankfully though, Doctrine 2 is very easy to extend to accomodate new data types and new DQL functions. It did require a small workaround for an issue not yet addressed in it, but in the end it worked out quite well.

Read More

Hello 2011

Tags:

So what’s up? It’s 2011! Well yes, it has been 2011 for almost a month already, but I’ve been kinda busy with stuff.

Here’s some statistics from Codeutopia in 2010 and what interesting things have been going on lately.

Read More