Google App Engine finally adds supports PHP

Whooohooo!

At the latest Google I/O PHP-support for the Google App Engine was announced. During the presentation the speakers mentioned that PHP now runs on 75% of all websites. WOW!

However, when you use Google App Engine with PHP, you have to get to used to some downsides (no mod_rewrite, no curl). But I think the advantages of the powerful Google environment outbalance it. For more information check out this article from the guys at phpclasses.org:
http://www.phpclasses.org/blog/post/208-5-Reasons-Why-the-Web-Platform-War-is-Over-PHP-Won-with-75-says-Google.html

Hg Init: a Mercurial tutorial

http://hginit.com, a wonderfully written Mercurial-tutorial by Joel Spolsky from Fog Creek Software (Trello). Especially when you come from Subversion like me, Joel made me think several times “Ohhh, yes, you’re right!”:

Subversion always gives you this horrible dilemma. Either the repository is full of bugs because it includes new code that was just written, or new code that was just written is not in the repository.

Go check it out: http://hginit.com

SourceTree: free client for Git & Mercurial

Recently I work more and more with products from the guys at Atlassian, like Jira and Confluence. In 2010 they bought the company BitBucket, a Mercurial hoster, and a little bit later its Mac client SourceTree. It is even freeware by now, and I must say it is a very good alternative to terminal.

Sourcetree for Mac
Sourcetree for Mac

http://www.sourcetreeapp.com

Some weeks ago they even got the Windows-Version out:

http://blog.sourcetreeapp.com/2013/03/19/introducing-sourcetree-for-windows-a-free-desktop-client-for-git/

Git for Beginners

Do you know Codeschool? Ever heard of CodeAcademy? These are great plattforms for beginners who are willing to start learning to code. It’s like a wizard which guides you through your first steps of programming, really easy and convenient. You can see it in action (with no signing up-hassle) here: http://www.codecademy.com/

The guys from Codeschool have a course about Git, perfect for diving into it:

http://www.codeschool.com/courses/try-git

Titanium: Android toast-like notifications in iPhone

In a recent project I worked with Titanium Appcelerator, a plattform to code once (using a  Javascript-API) and publish twice (iOS and Android). So goes the story… In real life it is not sooooo easy, because while you are coding you realize that iOS and Android do have some differences. :)

For example: a little growl-like notification-window which fades out after a few seconds. For Android there is a Titanium-API-function, for iOS not.

Anyway, I just wanted to share a function which works for both:

Source: http://developer.appcelerator.com/question/137662/android-toast-notification-in-iphone

Brilliant wizard for regular expressions

This is something for all the lazy programmers that are not able to write down regular expressions like their mother tongue (I heard there are some…)

http://txt2re.com/

It’s quite easy:

  1. enter the string you want to examine, for example “regexp’ing in the 90ies was fun, but now it is a pain in the ass!”
  2. this string gets enriched with many links for the different sections that are possible to search for. If you click on the link “int” beneath the number 90, this number gets extracted in a variable.
  3. as a result you get the code in your preferred language (PHP, perl, Javascript, …): Et voilà!

Brilliant tool, especially when you are wasting too much time in “rexexp-try-and-error-hell”.

Trailing slash in Symfony route

I found several approaches to get rid of the annoying 404-error when you open a route with a trailing-slash:

www.symfonysite.com/route
>> ok

www.symfonysite.com/route/
>> Error: 404-not found

The easiest solution is to add a RewriteRule to your .htaccess:

Now all requests with trailing-slash are redirected to the one without trailing-slash.

Notice that this only works as long as you do not have any routes which want require a trailing slash, because this would lead to an redirect loop:

 

Table inheritance with Doctrine

Currently I am programming a web-application with Symfony. In this app we got different kind of users: patients, doctors, experts, admins and so on. All of these users share some attributes (username, password, email), but some attributes only apply to several usertypes. A doctor for example has a departement, an expert a phone-number etc.

In the object oriented world of PHP this is an easy task: Patient extends User. But thanks to the magic of Doctrine this can be used within MySQL as well!

Daniel Barsotti wrote an excellent post about it: http://blog.liip.ch/archive/2012/03/27/table-inheritance-with-doctrine.html

Works like a charm!

Hello world!

In times of Google+, Facebook & Twitter I think it is time for something new, something innovative, something the world has waited for: A blog!

Ok, maybe it’s not so fancy, but anyway: Here I can write down anything I am working on, any new tool or whatever is happening in my techbrain right now :)