Christian Heilmann

You are currently browsing the Christian Heilmann blog archives for September, 2012.

Archive for September, 2012

Quick one: converting a multi-page PDF to a JPG for each page on OSX

Sunday, September 30th, 2012

I had this great task to convert a PDF to JPGs, meaning a multi page PDF should become a lot of JPGs. I don’t own Adobe Acrobat Pro and I didn’t want to buy an extra piece of software for it. So I went for the thing that hardly ever lets you down – even it it speaks in tongues – the command line.

So here is how to convert a PDF to JPGs:

Install homebrew by going to the terminal and copying and pasting the following:

ruby -e "$(curl -fsSkL"

The script explains what it does while it runs. It is not the matrix, although it is green and full of text.

Next get Ghostscript – just go to the command line and do a:

brew install ghostscript

This can take a while, so get a cuppa on. Once you are done, here’s the command to convert a PDF to a lot of JPGs:

gs -dNOPAUSE -sDEVICE=jpeg -r144 -sOutputFile=p%03d.jpg file.pdf

The PDF is file.pdf and this will generate files called “p001.jpg” to “p004.jpg” for a 4 page document for example. You can change that with the p%03d.jpg setting above. For example plonk%04d.jpg would create plonk0001.jpg.

Once the conversion is done you are in the GS> prompt, just press Ctrl+C to get out.

The true king rules without a crown – yes, you matter on the web

Tuesday, September 25th, 2012

Going through the Twitter feedback of my closing keynote at Smashingconf I read a lot of “this is awesome, I feel so ready to do stuff, but what can I do – I am not a known entity on the web.”.

I guess everybody has songs to listen to when need some perking up. You know, the ones that make you tap your feet or, if you are like me, bounce a bit. Friday I’m in Love by The Cure is a classic for that. One of my favourites is the Mighty Mighty Bosstones’ Everybody’s better:

The lyrics of that one have some wonderful moments:

Everybody’s better than I am
I think everybody’s better than me
And everybody’s swell I guess
They’re doing well some more or less
Everybody’s better than I am I think
You know to be king you don’t need a castle
To row back to shore can sure be a hassle
Why you walk around with your head low down
The true king rules without a crown
If your boat’s afloat after the typhoon
Row it safely back to the lagoon
And nevermind the green grass you won’t mow
Or what it is you have or don’t to show
Or what it is you can or can’t afford
The good are good without reward

I think there is a lot of truth in that – especially on the web. So if you are not a known entity on the web, so what? You are still very much invited to participate, your actions can speak for you and bit by bit you will get people thanking and encouraging you.

Lower profile = less pressure

You can get the warm fuzzy feeling without getting the pressure of having to be perfect in all you do. Once you are known on the web it can be quite annoying that something you throw out as an idea or a concept or a hack gets quoted out of context as the best thing ever and something to use immediately. As a part of the “making” web crowd you can play, get others to improve and build upon what you did and get feedback – good or bad – that is untainted.

With know web entities I find that not enough people challenge what they do and give constructive criticism. Instead there is a lot of polarisation going on – either people love your work or they try to show that you are wrong and their other heroes are right. Or people will attack you personally and disagree just to be part of the conversation and appear as someone in the know.

Everybody else is better

As mentioned in my keynote, there is quite a tendency in people to compare our behind the scenes footage with other people’s highlight reels. There is no need to go from zero to hero in a fortnight and it is not a natural thing to happen. I blame all the “talent” shows on television giving us that impression – it is the Tinseltown dream and the old from dishwasher to millionaire illusion pushed to a seemingly more achievable goal. Only seemingly, though.

Communication is a key

I don’t consider myself a web entity or a celebrity, but here is how I got where I am now: a lot of work. And not only paid work – on the contrary. Most of my connections and learnings happened outside the delivery cycle in my companies. They happened on mailing lists, IRC, forums, conference hallways, in cafés when people commented on my computer or what I did on the screen. It boils down to communication and being not afraid to ask questions and to talk to people.

It is not about a breakthrough product

One big mistake people make is thinking that quick products will get you known and a following. That can happen, but as they are quick products they are also a dime a dozen and hundreds of links on hacker news a day. I’ve made that mistake – a lot:

  • A PHP templating system to allow for HTML/JavaScript documentation
  • A “Learn to let go” PHP script that allows for users to define the page layout
  • The “Obsoletely famous” blog to name and shame outdated web resources and re-link them to better ones
  • The “CSS Toolshed”, a CSS Zen Garden but with a simulated CMS output – asking designers to come up with flexible CSS to support changing content and variable navigation item numbers
  • A PHP script to allow for CSS variables by precompiling the CSS - in 2005

All of these were massive failures, and frustrated me quite a lot and ask myself what is wrong with me that nobody calls these awesome and mentions them in talks. There can be many reasons why they failed, but the main one was that I thought I’d build it and people use it. This is not how it works.

Collaborative work wins

All the products that got people known in the last few years were works of collaboration: Modernizr being probably the most shining example. So if you want to go that route, don’t go for the quick win and call it finished, throw out an idea and a stub instead and call for people to work with you.

The best way to get known and to have fun and achieve things though is to collaborate with existing projects, give feedback, write documentation and examples – in short, get yourself out there visible as a helpful person who knows their stuff. The MDN documentation is a great starting point as it is an open Wiki and needs some love in many places. And as soon as you edit your name will be under it.

when your flesh and blood is gone your actions will remain

So here’s to all the kings without a crown – you are doing great work, even if it doesn’t look it and the immediate success is yet to come. Have patience, share, communicate and give constructive feedback in the form of feature requests, pull requests and patches. Your work will be visible and speak for you – even if you are not yet a loud voice.

Got a comment? How about joining the thread on Google+

WebmaKey MaKey? – here is something to start from

Sunday, September 23rd, 2012

MaKey MaKey is amazingly cool. It is a very simple Arduino based board with a USB cable and Alligator Clips to simulate keys pressed by touching a cable and closing the circuit by holding the other cable. This would be boring though, so you can connect the second clip to anything that can transmit a current – fruit, play-doh, graphite pen drawings, you name it. Check out the video to see the idea behind it and some examples.

More than a toy

On first glance this is cool, but seems like a toy for children to do their first steps with computing. And yes, it is magic for that as the Night Zoo teacher experiment shows. But there is more to this.

A great accessibility opportunity

I’ve almost given up on trying to get the accessibility web world excited about affordable and open solutions, but using a MaKey MaKey you could create switch interfaces for people who can not handle a keyboard on a shoestring and have fun at the same time as it can be customised in any way you want to. The beachball interface for Flabbyphysics is a great example of that.

There is a whole section on the MaKey MaKey forums dedicated to accessibility called Hackcess. In general it is a good idea to check the forums for inspiration as people build a lot of wonderfully crazy things with it.


The thing I was missing a bit on the site was the web component, as a lot of the demos used Flash or native code of sorts. As I thought it a good idea to mix MaKey MaKey with Webmaking I put together a very simple blueprint to use MaKey MaKey input in an HTML page called Testy Testy.

All it is are event handlers for the right keys showing and hiding different sections in the page. There is also a demo for moving a Foxkeh around with the cursor keys.

Here’s what the README explains:

As MaKey MaKey simulates various keystrokes and click events you can interact with the computer. Testy Testy is a simple start for doing something with this.
The HTML contains sections linked to the keys simulated by MaKey MaKey. When you activate one, the appropriate section is shown, when you release the key (or the cable) it gets hidden.

<section id="right" class="reactors">

So, if you want to for example connect your MaKey MaKey to a Banana and show a picture of a banana, all you need to do is alter the HTML:

<section id="right" class="reactors">
  <a href="" 
     title="Banana - Isolated by robin_24, on Flickr">
      alt="Banana - Isolated">

Hopefully this will get some people started to mix HTML learning and MaKey MaKey hacking.

Mozilla Festival

At this year’s Mozilla Festival we’ll have a MaKey MaKey session. and I am actually working on a hug/kiss/high-five camera booth using MaKey MaKey and WebRTC. Let’s see how that works out :)

In any case I can only recommend to get a kit yourself as it is incredibly fun to play with!

The discussion happens on Google+ (maybe).

That was Smashingconf 2012 – well, for me, at least…

Friday, September 21st, 2012

The last few days I spent in Freiburg, Germany at the first Smashingconf. All the things I did there have been released as slides, screencast and a long article (my notes, actually) on Smashingmag. The video should be out soon, too. So this is about my impressions of the conference.

The organisation

The success of a conference stands and falls with the passion of the organisers and Marc Thiele and Vitaly Friedmann are two guys that are 100% behind what they are doing. I know Marc for years (we’ve done stuff in the C64 demoscene together) and I got to know Vitaly a few years ago when I complained that Smashingmag has terrible quality and he asked me to write and become an editor there.

The organisation was incredible, as speakers you got your travels booked, got picked up at the airport, and put up in the hotel where a welcome basket full of cute little edible and non-edible things waited for you together with your badge, wireless information and how to get to the venue:

Speaker goodies in the room

Not that the latter was needed, as most of the speakers walked there as a group as it was a 5 minute walk down the road.

The conference itself worked well, the tech was fitting (the wireless was a bit hit and miss but that was partly due to the building and the speakers got Mi-Fi backups), timing worked out, there was always enough nibbles, coffee and drinks and the space was easy to navigate. Light and sound conditions in the room weren’t ideal, but there was nothing the conference organisers could have done about that.

Instead of catering lunch and endless queues there was a 2 hour break to get something to eat outside which made the tickets cheaper and also allowed people to form smaller groups to go out to hunt for food. With a market just outside the building this was not hard at all.

The afterparty was in a club which was a tad loud and people smoked inside which didn’t quite do it for me but the attendees were happy, and that is the most important.

The online coverage of the event was superb, with the team live-blogging and tweeting and the lanyrd page getting constantly updated.

I can’t think of much that could be improved, and the venue gave the conference a cute touch others lack which makes you forgive not having a bullet proof connectivity throughout.

The location

If you haven’t been to Freiburg yet, let me just tell you that it is so sweet it must be fattening just to look at it. It is a very quaint little town full of narrow streets, shops with cute things and cobblestones throughout. Arriving at the Airport means you can leave for Switzerland or Germany via France – how cool is that?

The conference venue itself was a very old and posh building complete with red velvet chairs and chandeliers:

Smashingconf building

All over were also old oil paintings of statesmen and kings and queens including Lord Cameltoe (as I christened him – seriously it was disturbing to look at):

Lord Cameltoe

Space was scarce and before we opened the windows it got quite hot in the room. After opening the windows the nearby church bells were audible at times during the talk but sitting in such an amazing building made up for these small niggles.


The talks

I didn’t see all the talks, but here are my quick reviews of the ones I followed.

  • Stephen Hay’s “Style Guides are the new Photoshop” had some very good advice how to automatically generate style guides from your prototypes and products using scripting. A designer not scared of the command line was unique to the audience and Stephen did a great job breaking down initial fears and animosities. Stephen has been around for donkey’s years (talking about donkeys, check the awesome magazine in the hotel room) and really knows his stuff. At the same time he is very humble about it. Top lad, and well done.
  • Nicole Sullivan’s “OOCSS and preprocessors in a tree, k-i-s-s-i-n-g” was all about her adventure into SASS land and how it relates to the OOCSS work she has done before. I found it a very good reminder not to fall for the siren song of preprocessors without analysing the final code that gets generated. It was also very good to see that Nicole wasn’t going into it with a “this is it, you all should do exactly what I do now” attitude, but instead took a “here is what worked for me after I did it wrong” approach.
  • Jake Archibald’s “Application Cache: Douchebag” was the third time for me (as we spoke at the same conferences) but it is a very worth-while talk with a truckload of research going into it. It is also a very important topic as the success of HTML5 apps stands and falls with our ability to store content offline. Check this out for all the hacks Jake had to do to build Lanyrd mobile. It is also incredibly funny.
  • Lea Verou’s “10 more CSS secrets” was not announced but she replaced her regular expressions talk with that one in the last moment. Lea is incredibly knowledgeable about CSS and showed a lot of cool tricks with modern CSS. Some of them were very useful, others more edge-case. What I love about Lea’s solutions is that they do not only show you how to do this in the coolest and newest browsers but also how to degrade gracefully. The whole talk was live-coded, which meant that she got 15 minutes over the allocated time, but I am sure the audience didn’t mind. I always want Lea’s CSS talks as an article afterwards as it is too much to take in by just watching.
  • Josh Brewer’s “Responsive is as responsive does” explained his journey towards finding a solution to have a perfect measure in line-length in responsive designs. I really liked the talk and the way Josh explained how he got far too obsessed with finding the perfect formula. Good ideas, lots of research and entertaining to watch
  • Tim Ahren’s “Web fonts backstage and on stage” taught us all there is to know about font formats on the web and how rendering of them works. Lots to take in and quite some in-depth information there.
  • Jonathan Snook’s “Your CSS is a mess” explained the rationale behind his SMACSS approach to writing CSS and had quite a lot of handy tips how to organise your style sheets. Jonathan is a very down-to-earth guy and it shows in his talk. Facts and some dry humour, I like.
  • Brad Frost’s “Beyond media queries (and a lot more words I am too lazy to type now)” on the other hand was a whirlwind experience of knowledge about responsive design and how to use it for the benefit of our users rather than because it is cool. I am a bit of a fanboy of Brad and I think we can expect great things from him (wow, I sound like Mr. Ollivander here) and he didn’t disappoint. A very funny and impeccably timed talk. Go and watch it when it is out.

All in all I think Smashingconf was very much worth our while and the audience should have gotten a lot for their money. It is a conference to watch as if they keep the quality up it can be the new Fronteers or @media.

Keeping it dry

Thursday, September 20th, 2012

If you thought this post is about scripting patterns and methodologies I have to disappoint you – it is about a personal matter. As a rule, I do not post personal life things here as this started as a professional scratchpad and will remain that way. However, as this personal matter does in a roundabout way affect my work life, I thought it a good idea to disclose the information.

Losing my touch

So here goes: the other day I woke up and couldn’t feel my ring finger and pinky. Well, I could, sort of, but it was as if they are asleep and just tickled a bit. That makes you wonder. When a day later it didn’t get much better I wondered if it got better or I just got used to it (I am very good at adapting to annoying things when they happen continuously). So I went to the doctor and had myself checked over.

My doctor rocks. He is this wonderful crazy scientist type who speaks three languages (at the same time) and practices a variety of different medical methods. He also has a very dark sense of humour – we go along very well.

Turns out I couldn’t feel my fingers as coming back from Campus Party Berlin I feel asleep on the plane with my Nexus 7 in my hand. I had pinched a nerve and it was damaged. Now, a normal doctor of the NHS ilk would have given me a paracetamol and sent me on my merry way but mine thought it better to see why a simple tablet in my hand can cause such distress to my nerve system. If you think about it – our brains are mostly nerves and when they get damaged that would mean worse things.

So we did a blood test and when the results came back they looked like some kid on sugar rush had a go at a chemistry set and mixed everything that wasn’t meant to me mixed. It also showed that apart from the gingerism I also inherited another thing from my mother: a deficiency in my nerve system.

So to counteract this and lengthen my happy life on this planet I am changing my lifestyle. More vitamins, more iron, zinc and other bits and bobs and above all less caffeine and less alcohol. Whilst I didn’t drink excessively my blood picture showed a lot or as my doctor put it “you drink like a Londoner”. In essence the deficiency I have means that whatever bad thing I do to my body has a tenfold effect.

Shaken and stirred

So here is the thing that could change my professional life: I am not drinking any alcohol at the moment and will most likely not do that for quite a while.

As someone who lives at conferences and meetups the temptation to have a drink is high but I really will not. So if you meet me don’t be surprised when I go for a lime and soda or water when the rounds come in. I will not judge you for drinking and I am also still happy to buy a round, so no worries.

Is this the end of my socialising at conferences?

Here comes the interesting part though. You might remember the Twitter storm in April when Ryan Funduk’s “Our Culture of Exclusion” complained about the culture of drinking at conferences and thus excluding people who do not partake. The Twitters more or less painted IT conferences as Frat House parties where people who do not do the keg stand get hazed out and much more nonsense.

Now, ever since my doctor scared the living daylights out of me, I attended Reasons to be Creative in Brighton, England, Mozcamp in Warsaw, Poland, went to an all inclusive Robinson Club in Mallorca, Spain and the Smashing Conference in Freiburg Germany.

All of these had free drinks and I didn’t have any. I also didn’t get any grief for it or felt left out. I actually had a great time and found it interesting to see other people who are not the social type come out more and talk to me and have very interesting things to say.

Yes, this might be because I am a speaker and people know me, or, as Lea Verou put it “you do and say things sober that other people need to be drunk for” (whatever that means). All in all I have to say though that even as one not drinking I find conferences and after parties a great thing to go to and having chats with people. In most cases I didn’t even have to explain why I don’t want a drink when people offered, and in the few that I had to explaining that I am trying to live healthier was all that was needed.

So, no, our market is not full of brogrammers and you have to be the one to drink others under the table. And seriously, I have much more reasons not to hang out or socialise with people who’d fit the brogrammer stereotype than the drinking.

So cheers to all of you who I met and to the ones I will meet soon :) If you got something to say about this, let’s have a chat on Google+