Blog

Installing FreeBSD on a Thinkpad X121e

I decided it was time to try FreeBSD. And what better way is there to learn about an operating system than to use it every day? So I decided to put it on my x121 and to dual-boot with Debian. Networking I was pleasantly surprised that the NIC (Atheros AR8151) ... more

Installing Debian GNU/Linux on a Thinkpad X121e

Installing Debian GNU/Linux on a Thinkpad X121e Installing Debian (testing/wheezy) on the X121e (AMD) was pretty easy, but the documentation I found online was a little contradicting and confusing. I encountered a few problems. Ethernet Update: You can skip this section if you're using a Linux kernel 3.1.0 or newer. The Installation notes on the Debian Wiki ... more

Import WXR files from server or on plugin activation

I recently patched the WordPress reset plugin to make it possible to reactivate multiple plugins after the reset. Until sivel releases an update you can download the patched version from my server (Edit: ancient content removed). As I frequently need to wipe WordPress installs during development I was looking for ... more

How to minify WordPress theme stylesheets properly

If you build WordPress theme you'll eventually come to the point where you want to minify the stylesheets. But the WordPress theming system has a fundamental flaw: It expects theme headers like name, version information etc. to be in the style.css. This is bad because removing the headers from the ... more

A Better Related Posts Plugin

There are many plugins that find related posts for WordPress, and I was happy to use one of them in the past. However, WordPress evolves. One of the biggest change was the addition of custom post types. They are very useful and I use them a lot for my own ... more

Extract HTML with PHP’s DOM extension

I recently had to parse HTML with PHP and had a look at PHP's DOM at last. Here's a way to extract an element's content by ID: <?php /** * Extract an element by ID from an HTML document * Thanks http://codjng.blogspot.com/2009/10/unicode-problem-when-using-domdocument.html * * @param string $content A website * ... more

Better Recent Posts Widget

The built-in recent posts widget in WordPress isn't too bad, but it doesn't support custom post types. That's why I wrote this new widget. You can choose any custom post types you want. This way you can always get a list of recent updates on your blog. The widget ignores ... more