Category Archives: Development

PHPUnit: Closures as dataProviders help with repetitive code

Since PHP5.3 we have closures. The concept behind closures is unbelievably powerful, and even though PHP has struggled with the concept of typing, callables and whatnot, the main concept of closures remains: passing logic in stead of data, or even: as if it were data. In my previous post I argued that functional and declarative […]

Posted in Development | Tagged , | Leave a comment

Declarative is the new black.

The paradigm shift in the purest sense of the expression. The old paradigm makes way for new ones. And declarative is the new one. Well…, not new new …

Posted in Development | Tagged , | Leave a comment

Symfony2 + PHPCR + Doctrine2 + Jackalope recipe

Lately I’ve followed some developments in the Symfony2 corner of the PHP community with great interest. One of the most enticing developments is the usage of a Content Repository as a backend for your CMS. There is some work being done on the Symfony CMF, combining Symfony2, Doctrine2, PHPCR and Jackalope into a set of […]

Posted in Development | Tagged , , , | 15 Responses

Unit testing and Drupal; what’s wrong with this picture?

I guess the guys at Drupal.org didn’t really understand the concept of unit testing. In comparison to the Zend Framework 1.13 and Symfony 1.4 test suites, of which some tests did not pass mainly due to some configuration issues (98.6% and 99.9% respectively), Drupal had some, let’s say, surprising results. Though it reported 100% of […]

Posted in Development | Tagged , , | Leave a comment

Enhancing Python unit tests further with decorators

Decorators in Python are awesome. In follow-up to my previous post on a missing feature in Python’s unittest module in comparison to PHPUnit, here’s the implementation of PHPUnit’s @expectedException annotation in form of a Python decorator

Posted in Development | Tagged , | 4 Responses

Endless scrolling based on a simple HTML pager

We had a little brainstorm today at work at how endless scrolling could be best implemented utilizing progressive enhancement. Here’s my idea and a proof of concept. And a good example of progressive enhancement in pure form, if I may say so. The concept When I think of endless scrolling, I see it as just […]

Posted in Development | Tagged , , | 5 Responses

PHPUnit style dataProvider in Python unit test

PHPUnit has a handy feature with which you can provide testdata to your tests. This is called a data provider, and is implemented by annotating a test with @dataProvider methodName. Python’s unittest module doesn’t seem to have such a feature.

Posted in Development | Tagged , | 7 Responses

Introducing Spritzer: A CSS sprite generator

CSS sprites are pretty useful in web development. The general idea is you use one big image that contains all your icons and other interface-related images and use that image as a background for your HTML elements, shifting it’s position such that the right portion of the sprite is displayed. This technique is becoming more […]

Posted in Development | Tagged , , | 6 Responses

About MySQL, UTF-8 and saving headaches

One of the most confusing topics ever in web development history is character sets. MySQL has a lot of features to help you with this, but when things go wrong, it can be a real pain to get it solved. Read this and fear no more.

Posted in Development | Tagged , | 7 Responses

HTML5 WebSocket Server – Work in Progress

So, I thought I’d devise a websocket server in Python. I’ve been tweeting some stuff about that too, but as soon as I wanted to publish the source code, I accidentally deleted websocket.py, instead of websocket.pyc (which I didn’t want to occur on github). That was quite dumb…

Posted in Development | Tagged , | 7 Responses