Writing games for fun

GitHub organized a Game Off - or a game competition - back in November. The contest ran for a month and its only limitations were that the game runs in a browser and relate somewhat to forking/cloning/pushing/pulling. And I am here to tell you that no matter what kind of programmer you are, you should take part in such contests!

I am hardly a game developer. I do spend most of my time writing web things in both PHP and JS, and I had not worked on a game in at least 5 years. This sounded like a good opportunity for a little change. It is easy to get stuck in what you do once you do it well, but just like I enjoy playing with other languages every now and then, working on a different product in a familiar language also offers interesting challenges. Game mechanics, canvas rendering and more visual programming are all things that I am not used to work with.

Long story short, I came up with this small simple Split game that I invite you to try out. It was a lot of fun to write, and given the 1 month deadline you do not have time to mess around and let feature creep take over. You have to get things done fast. It is a great exercise both for programming skills and time management/prioritization.

If you are interested in seeing other entries to the contest, there is a full list available but it does contain quite a lot of incomplete and barely playable games. Having gone through most of the list, I can recommend those few games that I enjoyed, mostly because they went out of the beaten path and are trying something new: Echo, Radiance, Mazeoid and Release Cycle.

Mozilla is running a similar contest until February, so there is your chance to get your hands dirty over the Christmas holidays. You have nothing to lose, and building games is both fun and challenging!

December 02, 2012 // Web, JavaScript // Post a comment

I'm going nomad - introducing Nelmio

After almost three years working at Liip, I have finally decided to take the plunge and start my own business. Together with Pierre Spring, in early May we will start building up Nelmio.

Why? To keep it short, Liip is a great company to be employed at - and they're hiring - but both Pierre and I have had the urge to be our own bosses for a while, and that is something that's hard to suppress. Eventually we had to give in.

What next? We're both web devs, with lots of experience across the board. Pierre is probably more into JavaScript and the frontend side - along with web performance optimization. I'm a big Symfony2 contributor and more into the PHP/backend side of things, but we are both quite knowledgeable in all those technologies, they're merely complementary tools after all. Anyway, we'd love to share some of that knowledge, and will be available for some consulting/code review/coaching fun. We're based in Zürich, Switzerland, let us know if you need us.

You can find Nelmio's site at nelm.io - it's not complete yet but it should give you a good overview already. And in any case you should of course follow @nelm_io on Twitter to get more news soon :)

April 17, 2011 // News, PHP, JavaScript // Post a comment

Terminal (Bash) arguments tricks

Reading David DeSandro's last post on how to store strings in variables in terminal, or any bash-y shell (I'd say any unix shell but I'm sure there is a weird one out there that does things differently) for that matter, it struck me that many web developers seem to have a big disconnect with the shell.

Now I'm no expert, but I know that the use case he describes can be solved much more efficiently, so I felt like writing a little follow-up, and hopefully teach you, dear reader, a thing or two. The short story is that you sometimes want to do many operations on the same file. Now the neat trick to do that is to use history expansion, which allows you to reference one of the parameters from the previous commands you typed.

As always with unix stuff, it has simple useful basics, and then it can get really hairy. Here are a few examples, from most commonly useful to those things you just won't remember in five minutes.

# First, the example from DeSandro's post
# !$ references the last argument of the previous command.

mate _posts/2011/2011-04-12-terminal-strings.mdown
git add !$
tumblr !$

# Now more complex, let's copy the second argument
# !! references the last command, and :2 the second arg. 

echo foo bar baz
echo !!:2 # outputs "bar"

# Batshit crazy
# !?baz? references the last command containing baz, :0-1 grabs the two first args

echo !?baz?:0-1 # should output "echo foo"

Now if you've been paying attention, the second example had !! in it that referenced the last command. This one is really useful for all those times you forgot to sudo something. Just type sudo !! like you really mean it, and it will copy your last command after sudo. It does not work if you add cursing to it though.

So read up those history expansion docs, it's really worth if only to know your options, and if you know other related tricks, please do share in the comments.

April 13, 2011 // PHP, Web, JavaScript // Post a comment

Speaking at ConFoo 2011

I recently had the pleasure to hear that I would be speaking at the ConFoo conference. This is a great opportunity for me as I'll finally be able to meet a few US-based guys from the PHP community that I have only ever met virtually.

Besides that the conference itself also looks great, and covers an insane amount of topics with almost 150 sessions in 3 days, and boatloads of speakers. I will give two talks, one about JavaScript Scopes, Events and other complications to try and illustrate why people really ought to learn JavaScript better. The second will be about frontend web performance, i.e. how to perform well in the browser. It will include a short overview of old classics and then a couple new topics such as the Web Performance APIs and some more advanced optimizations that are hopefully not too widespread like CSS selectors and DOM reflow issues.

So I hope to see you all in Montreal for what promises to be a huge conference.

December 28, 2010 // PHP, JavaScript // Post a comment

Speaking at the IPC and WebTechCon

Next week the International PHP Conference and the WebTechCon will happen both in Mainz, Germany. I will speak at both events over the three days and the good news is that the combined 100 sessions are available for attendees of both conferences.

My only talk as part of the IPC is entitled Of knowledge sharing and the developer quality lifecycle, it's non-technical and will hopefully be more a seeded discussion than a plain presentation. We will talk about the ways to share knowledge within a company in the Gutenberg III room, monday at 11.45.

My second and third talks will be part of the WebTechCon schedule, but I think they are very good fits for PHP devs nonetheless. On tuesday at 10.15 as part of the JavaScript Day I will talk about JS Events and Scopes. Every web developer should understand those concepts so I would highly recommend you attend if you don't know how the this variable is bound in event listeners, or have never heard of variable hoisting.

The final talk will be part of the Web Security Day, and touching on the essentials of web security, the things you just can't afford to ignore. The talk is on wednesday at 9.00am however, so plan ahead and avoid getting too drunk if you want to attend :)

And finally, if anyone wants me to do some informal Symfony2 presentation, I got slides ready and would be very happy to do that, so just come and ask.

October 07, 2010 // PHP, Web, JavaScript // Post a comment

Introducing Slippy - HTML Presentations

Slippy is a HTML Presentation library written with jQuery, it takes a html file in and plays it in any browser.

It is optimal for programming-related talks since it includes a syntax highlighter and is very easy to use since it's just standard html markup with a few classes to enable specific functions.

If you are making a talk about Javascript, it can even execute your code samples live and displays alert() boxes nicely instead of using the ugly browser dialog, which -I tried it today- works quite well to prove your point interactively.

You can find the sources on github, view the example slide deck which includes some documentation or view the slides for the small talk I gave today about Javascript Events on my Slippy slide repository.

Obviously feedback is very much welcome and even though it's not perfect yet, I hope it'll be useful to others. More docs and styling fixes (the dark grey background wasn't too visible on a projector, my bad) should come soon as I have more talks planned, and the slide repository page will receive some love as well when I have time.

June 03, 2010 // News, PHP, JavaScript // Post a comment

HTML5 my ads

First came Flash. Then came advertisers that thought it'd be great to abuse it. Then came Flashblocktm and friends. The geeks don't like Flash, it's evil.

Now the iPhone & iPad don't have Flash, but they're the shit. Advertisers want a part of the shit of course, and they can put shiny ads in native apps, but not in the open apps that are websites. Thank god there is HTML5, geeks love it, it's all great. So you've got solutions like SmokeScreen developing. It's Flash without Flash, everyone should be happy right?

Have you looked at their demos? Ads. Yes. I'm not saying they won't do more one day, but for now the target market seems to be advertisers, so that they can put out Flash-like ads in HTML5, reach the iDevices and to kill two birds with one stone, they'll reach the geeks that run Flashblock. And all that while interpreting Flash content so it'll most likely be more of a resource hog than Flash is.

What's the solution? CanvasBlock? Noscript? In the end people will find ways to abuse anything.

Of course Apple could come back to the table and implement Flash in the next iPhone OS, instead of having us suck up some half-working slow Flash ersatz on top of completely broken sites.

June 02, 2010 // Web, JavaScript // Post a comment