Blog and portfolio of Patrick Zahnd



As I am personally using Gitflow and I found the graphics by nvie ( very useful, I created an own version of them. Feel free to use them.

the big picture

feature branches

Gitflow feature branches

master and develop

gitflow main branches

hotfix branches

scrum sprint

git (vs. svn) data transport commands

For some git presentations I wanted to print an overview of the git (and svn) data transport commands. I found several nice visualisations in the web, but none with a high resolution. This is why I took some time to create an own version of it. Feel free to use it yourself. Also I am happy about feedbacks.

svn data transport commands:

svn data transport commands

git data transport commands:

git data transport commands

other resources

An interactive git cheat sheet:

Learn git by github:

PHP OpenID library

In the last days I played around with SSO (Single Sign On) and the Google OpenID provider. Therefore I used the LightOpenID library found on gitorious (

What I found after some hours was that my requirements were bigger than what the library was made for. I then decided to fork the library ( and started restructuring it a bit. This is what is new:


Composer support

You can now use Composer to add the repository. The library is automatically added to the autoloader.

    "repositories": [
            "type": "vcs",
            "url":  ""
    "require": {
        "paza/lightopenid": "*"

Removed logic from __construct

I removed logic from the class __construct method. This was mainly about gaining flexibility and to be able to pass GET/POST parameters from outside.

Further changes

  • Added a namespace to the library
  • Public variables removed
  • Added public getter and setter methods
  • Removed the magic methods __get and __set
  • Updated and moved examples

Usage example

Get the Openid URL

// Example path

$openid = new Paza\OpenID\LightOpenID('');

$authUrl = $openid
    ->setOptional(array('namePerson', 'namePerson/friendly'))

echo '<a href="' . $authUrl . '">Login with google</a>';

Handle the Openid provider login response

// Example path

$openid = new Paza\OpenID\LightOpenID('');

$authUrl = $openid


// Check if it is in the response state (response received from the OpenID provider)
if (!$openid->isResponseState()) {
    throw new Exception('The response set is not a correct Openid response');

// Check if the user has cancelled the OpenID Auth
if ($openid->checkUserCancelled()) {
    throw new Exception('The user cancelled the request');

// Validate the response
if ($openid->validate()) {
    // Logged in

    // Get the unique user ID
    $id = $openid->getClaimedId();

    // Get User attributes
    $attributes = $openid->getAttributes();

    echo sprintf('<b>User ID</b>: %s', $id);
    echo '<br /><b>Attributes:</b></a>';
    echo '<pre>';
    echo '</pre>';
} else {
    throw new Exception('The request could not be validated');


With the updates I did it is now easy to use the library with frameworks like Symfony2 for example. Mainly the change to pass the GET/POST variables from outside makes the library much more flexible.

A more detailed description and usage examples you can find on Github (

Around three months ago I released my private project The goal of the website is simplifying the civil service search for the persons doing community service in lieu of the army in Switzerland.

Swiss community service

In Switzerland every year several thousand men apply for doing community service, which most of are approved. Currently there are more than 23’000 active persons doing community service.

The civil service lasts 1.5 times longer than the military service, which makes a total of around 1.5 years. A normal service takes 26 days and everyone has to perform a so called long service of 180 days.

On the other hand, there are around 2’500 service hosts which provide around 8’000 places of employment every year.


The official platform

The official platform EIS (Einsatzinformationssystem) contains a search, extended search and a detail page for each position. The new EIS introduced in August 2012 consists of a redesign and some new features, like the collapsed search list which allows to view some additional informations for each entry by toggling.

Official EIS:

Why create an alternative search?

After talking to others performing community service and after my own experience with the current search, I had a list with points which could be improved. To give you an overview, I list some of the main ideas:

  • Having fewer outdated entries
  • Simplifying the search form
  • Possibility to mark interesting entries
  • Reminder for new matching search entries

After checking the legal requirements within my topic IT Law at university, I started collecting the data and creating the page, which took me several months to finish.

The result

Today, three months after releasing the page, it has an average of hundred people browsing the entries every day and several members getting a weekly or monthly reminder, containing new interesting results. Also I got some feedback, which I try to implement most of.

For the future I hope to make it easier to find a matching service and also enjoy having an alternative search for myself.

More feedback – of course – is welcomed warmly :)