Blog Archive

Saffire january 2013 update

Date: 26 Jan 2013
Tags: [ saffire ]  [ varags

Most development languages will have some kind of printf() functionality. It takes a string, and can have optional arguments, depending on the placeholders you have set inside your string.

Saffire - Programming the web since 2013

Date: 20 Dec 2012

So, Saffire started as a way to “learn” a bit about flex/bison. I’ve dealt with these systems before a long time ago (pre-2K), and i forgot lots about them. So it was about time for a refreshal. Unfortunally, looking on the internet for tutorials, almost all of them are about how to write a calculator (bison’s version of “hello world”, most probably). Very soon, I decided to try and parse my own language, with some idea’s I collected over time on how *my* favorite language should look like. Two hours later: Saffire was born.

Debugging remote CLI with phpstorm

Date: 20 Dec 2012

Even in these days, with full-featured PHP IDEs around,  I still see PHP developers using var_dump() and die() to debug their code. Not only is this a very bad way of “debugging”, it has other dangers as well, like side-effects on calling (non-idempotent) methods multiple times, not removing debug statements and possible even committing this to the VCS repository, which gets send onto your production environment. We’ve probably all been there,.. But we don’t have to. Debugging your code properly through an IDE is quite easy, but one of the major problems is debugging CLI code. Since many frameworks like Zend, Symfony and micro-frameworks like Cilex can be used to create command-line apps, cronjobs and even daemons, so how do we easily debug this kind of code?

Introducing the REST cookbook

Date: 12 Dec 2012

One of the many things I do, on pretty much a weekly basis, is answering questions about REST and HTTP. Is this status code correct for X, should I use POST or PUT, is this hateoas enough, how do i handle logins in a RESTful API etc, etc…  This is why I decided to setup a simple website, that pretty much tries to answer any question about REST.  It’s not completed yet.. Actually, it hasn’t got many posts to begin with :), but a start has been made and we will fill it with questions and answers about REST and HTTP issues.

Saffire: december 2012 update

Date: 10 Dec 2012

A few months ago I started with a new programming language called Saffire, and it’s time for an update. Since then, we have merged over 100 pull requests, and the number of contributors is steadily increasing. This post is explains of the functionality we already implemented (or want to implement).

Installing composer: russian roulette.

Date: 15 Oct 2012

I love working with composer. I think it’s a really neat way of dealing with dependencies in (PHP) projects and it’s not for nothing that big frameworks like symfony2 are using composer as their primary way of handling bundles and other components. But this blogpost is not about problems with composer (well, not really anyway). It’s about installing composer. It is fundamentally wrong, and it sets a very, very bad precedent for both experienced and inexperienced (php) developers.

Writing a language

Date: 17 Aug 2012
Tags: [ ast ]  [ bison ]  [ flex ]  [ grammar ]  [ lex ]  [ saffire ]  [ yacc

In the last blogpost I was talking about a new language in the making. Unfortunately, writing a complete new language - from scratch - isn’t as easy and takes a fair bit of time. During this development process, I will try and blog a bit on the things we are developing, the problems we are facing and the solutions we are implementing. The current Saffire status: we are able to generate AST tree’s from   Saffire source programs. If you have no clue what I’m talking about, no worries: this blogpost will try and explain it all.

Saffire: A dive into a new language

Date: 04 Aug 2012
Tags: [ bison ]  [ flex ]  [ saffire

Confused by Perl? Bored by Python? Ruby too 2011? What’s the alternative? PHP? Come on!  Well, seek no further since here is the next language for at least the coming decade: Saffire!

MultiParamConverter for Symfony2

Date: 04 Aug 2012
Tags: [ annotation ]  [ bundle ]  [ multiparamconverter ]  [ symfony ]  [ symfony2

If you know Symfony2, you probably are using (or at least, have heard of) the [@paramConverter annotation][1] from the SensioFrameworkExtraBundle. This is a really simple way to convert slugs into entities. But lots of times I find myself having multiple slugs inside my routes, and this is something the @paramConverter annotation cannot do. So that’s why I’ve created the multiParamConverter.

Using varnish to offload (and cache) your OAuth requests

Date: 06 Jul 2012
Tags: [ oauth ]  [ offloading ]  [ varnish

For a current project both me and a [colleague][1] are working on a big API system that authenticates through an OAuth system. Normally, such an API does all the necessary OAuth checking, handling of tokens etc, but we wanted to have a system that actually offloads our authentication just the same way one could offload HTTPS traffic for keeping the API simple, extendible and even performant.

Symfony2: Implementing ACL rules in your Data Fixtures

Date: 04 Jul 2012
Tags: [ doctrine ]  [ PHP ]  [ proxy ]  [ symfony2

Doctrine’s DataFixtures are a great way to add test data to your application. It’s fairly easy to get this going: Create a fixureLoader that extends Doctrine\Common\DataFixtures\AbstractFixture, had a load() method and off you go. However, sometimes you want your data also to be protected by Symfony 2’s ACL layer. Since there isn’t a common way to do this, here is one way on how I implemented this

Using vagrant and puppet to setup your symfony2 environment

Date: 29 Jun 2012
Tags: [ puppet ]  [ symfony2 ]  [ vagrant

As you may now by now, I’m a big fan of using Puppet for configuration management. Since the rise of virtualization, these applications are becoming one of the more dominant tools in a developers tool chain. Together with other tools, setting up a complete development environment with just a single command is not only reality, but it’s becoming for a lot of developers a daily practice. But even for open source projects like and are seeing the benefits of  having "development environment on the fly". New contributors don't have to spend a lot of time setting up their environment, but it's automatically generated: the code setup, the database server together with a filled set of data, any additional components like varnish, memcache, reddis etc. This blog post gives an overview on how to setup a symfony2 project with the help of vagrant and puppet.

DPC speaker's dummy guide into arduino

Date: 23 Jun 2012

This year the DPC (and DMC) bought all speakers one of the coolest gifts I’ve ever got (or seen) for speakers: an Arduino. During the speaker dinner, a lot of people were a bit confused on how it was and works. So this post is for all of those, plus everybody else who wants to get involved in Arduino, programming and some electronics. It really is fun!

Using augeas (in PHP)

Date: 04 Jun 2012

Even though I really like using sed and awk, sometimes its hard to change or add parameters in configuration files. Big sed statements that may or may not work, double checking if everything has been done correctly etc. Augeas is a really cool tool that lets you view / add / modify and delete all kind of data from configuration files. If you are using Puppet, you are probably aware of this tool, but I notice that a lot of PHP developers have never heard of it.. Let’s explore..

301 vs 303

Date: 02 May 2012
Tags: [ http ]  [ rest ]  [ see other

During a [presentation][1] I gave yesterday about REST, there was a discussion about redirection (more detailed, a redirection from a queue to the actual resource during [asynchronous operations)][2]. During this presentation (and blog-post), I’m using a [303 HTTP status code][3] to indicate that the operation has been completed and that the created resource can be found at another URI. So in essence, it makes sense to use a 303. At least to me, and quite possibly the rest of the world too.. But this triggered a side-discussion on which HTTP status code to use, and the more I think about it, the more complex it believe this problem actually is.

Conference retrospect

Date: 25 Apr 2012
Tags: [ conference season

So even in the middle of conference season, I’d like to update you with some of the awesome things I’ve seen and experienced over the last few weeks.

Bloom filters

Date: 09 Apr 2012

In a span of two months or so, I’ve noticed a peak in implementation of bloom filters. Maybe the “if you got a hammer, everything looks like a nail” applies here, but statistically I’m doing a larger number of bloom filter implementation as usual.  Yet, most of my co-workers never really heard of bloom filters, and I’m continuously need to explain what they are, what their purpose is and why it’s a better solution than other ones. So let’s do an introduction on bloom filters.

PHPShout : a shoutcast streamer in PHP: Part 4

Date: 24 Mar 2012
Tags: [ C ]  [ extension ]  [ icecast ]  [ PHP ]  [ streaming

In the [last post][1], we created a template extension for our shout class. Next up, we need to do the actual implementation.![][2]

PHPShout : a shoutcast streamer in PHP: Part 3

Date: 24 Mar 2012
Tags: [ C ]  [ extension ]  [ icecast ]  [ PHP ]  [ streaming

In the [last post][1], we started with the implementation of the constructor and one method. Next up, let’s do a bunch more.

PHPShout : a shoutcast streamer in PHP: Part 2

Date: 24 Mar 2012
Tags: [ C ]  [ extension ]  [ icecast ]  [ PHP ]  [ streaming

In the [last post][1], we created a template extension for our shout class. Next up, we need to do the actual implementation.