All posts in General

Video – Laupheimer Ansichtskarten

For www.laupheimer-ansichtskarten.de I created a short video, giving an impression of this extraordinary collection.

Smart Herb Garden (Click & Grow)

Just in time for christmas (on the 23rd) the smart herb garden that I backed on kickstarter arrived. The guys from Click & Grow did an awesome job sending out as many gardens before christmas. So one thing up front: congrats, great kickstarter campaign!

The garden is now planted since the 25th and I just want to give a brief review: awesome! It works very well, there are just three small things I would like to give Click & Grow as feedback:

Float indicator problems

Many people on kickstarter reported problem with the float indicator. This tiny pice of styrofoam is used to measure the water level and allows the plants to call for more water. Click & Grow gave some quick instructions on how to fix this (moving the lighter arm in a different position, checking the float indicator orientation), but none of them helped in my case. But there was a very easy fix for me: I pulled out the magnet from the styrofoam just a bit more. When putting the garden back together take care to put the float indicator into the right position, so that it does not get stuck! If the magnet is pulled out too much, you can easily damage the float indicator!

Instructions

The smart herb garden comes with very little instructions. Only some basic information is printed on the inside of the (great!) packaging. Click & Grow should provide some more instructions on how to add the seedpods, when to remove the lids, etc. Just to be sure, that you’re doing the right thing!

SOS!

That’s definitely one of the most bothering things: The very strong LEDs start to morse SOS when the garden needs water. This seems like a funny idea, but considering that we planned to place the garden in our window facing the street, I’m quite sure that some people will not think about a plant that calls for help, but (hopefully) will call the police if they see SOS signals morsed from an apartment. If the garden needs water in the middle of the night, it will blink SOS for the whole night – with quite strong LEDs that should be visible over a great distance.

So, to Click & Grow: Please, don’t play around with international emergency signals! For now I think I will disable the float indicator to make sure, that our (to be honest, it’s my Tamara’s) garden won’t signal SOS.

XBMC sleep mode playlist

XBMC offers a lot of cool features, most of them I still don’t really understand and don’t use currently. But one of them I just learned to love: smart playlists and python scripts.

I was looking for a plugin that would allow me to setup a playlist with random episodes of tv shows that runs for X minutes and then shuts down the media center (or in my case as I use openELEC just stop playback). To make this part short: I did not find any.

But I found smart playlists and python scripting. So I finally got what I wanted:

A one button solution (well, I extended it to two buttons for more flexibility) that starts a playlist and stops after a specified time. To achieve this, I needed three steps:

  1. Setup a smart playlist that randomly selects episodes from a given set of tv shows
  2. A python script that tells xbmc to play the playlist and starts a timer (asking you for the amount of time) that will stop playback or shutdown xbmc
  3. Mapping the python script to a button on my remote

Smart playlist

This one is quite easy. You can use the GUI version to create a smart playlist or just create a xml file inside Userdata/playlists/video/playlistname.xsp with the following content:

This creates a smart playlist with the name “playlistname” (change this!) with two rules. The first is to select the tv shows and the second one defines that only episodes that have a playcount greater than 0 should be selected (this will only add watched episodes to the playlist – just remove the rule block to disable this). It only adds 50 elements (which is enough for me) and orders them randomly.

You can test the playlist from inside XBMC under the video -> playlists menu.

Python script

This is easier than it sounds. Just create a file named “playplaylist.py” in our userdata folder:

The last three lines are important: The last one sets the timer (named “sleepmode”) and defines the action to perform at the end (Stop the playback – you can also use other XBMC functions here, like XBMC.ShutDown). The previous one starts playback of the playlist (check your playlist name here!) and the first one just cancels a previously started alarm, if available.

Remote control button

So the last step is to link the python script to a remote control button. I’ve added a remote.xml file to the keymaps directory (in your Userdata directory). This file will override the default mappings:

This tells XMBC to start run the python script when the blue button is pressed on the remote. Voila!

checking eu vat numbers with php

Validating VAT numbers in php is quite easy – simply sending a get request to the EU vies api and checking the response for a css class name. The following code gives an example of how to do this (in the easiest way possible – consider using more advanced methods for sending the request, but file_get_contents() is fine in most cases).

Welcome!

New website!

As a web developer it’s kind of a shame to have an outdated website. But as I tend to treat myself not as the best customer, it took some time to update my personal website. I have switched back to wordpress, which allows me to use a blog again – a long planned feature.

I’m currently still working on the portfolio section and hope to update as many items as possible with a description providing a more detailed view on some selected previous projects.