How to set Content-Type header for specific URIs using Apache RewriteRule

I was working on an HTML 5 application that loads & plays MP4 files and noticed that some older version of Firefox simply refuse to load media files, although their codec is supposed to be supported.

Read more

Webpack: here are a few tricks that can boost your build performance

Webpack is a nice tool but the default configuration can be very slow at generating builds, even for small projects. Fortunately it takes only a few modifications to drastically reduce build times.

Read more

Migrating from Jasmine 1.3 to Jasmine 2.0

If you just started a new JavaScript project with Jasmine, you likely started using Jasmine 2. But if you’re working on an existing project, it’s highly possible you’re using Jasmine 1.3 and maybe want, like me, migrate to Jasmine 2. Here are a few tips how to do it.

Read more

Finding a process using a specific network port with the lsof command

Today I could not launch a node server: the port my app was targeted was already in use. Fortunately Unix comes with very handy command line tools when it comes to finding which processes are using a specific port/address.

Read more

Ping a server from a grunt task

I was working on a small project that sets up a proxy using grunt, and then starts a node server. Problem is that if the proxy wasn’t up and running, grunt would still start the server and any call to the proxy would make the grunt server crash with some unrelated error.

I decided to add a simple task that would ping the proxy server, and simply fail with an explicit error if it wasn’t responding.

Read more

Getting to know display:flex

I know I’m late, but I have finally been toying with the new CSS 3 display modes like flex and I’m already running into trouble.

It seems there are a lot of inconsistencies across browsers which makes me wonder if it’s ready to be used.

Read more

Optimising the Canvas HTML5 element

While developing my own tile/sprite drawing engine, I stumble upon several problems related to the Canvas element: I thought it would be a good idea to share my experiences.

Read more

Node.js: production management with PM2

It’s real easy to come with having your site running with Node.js: simply start it with “node server.js” and here you go.
But what if you wanted to take advantage of the multiple cores of your server ? What about log aggregation ? What about process management ?
Well, none of these are easy to deal with.

There were already some useful tools like nodaemon or node-forever but unfortunately, these tools are either not ready for production environment, or lack process-mangement/cluster support.

This was a problem before PM2!

Read more

Android: how to use slide transitions in activities?

Recently, I have been playing with Android development. Having already done some very basic Java development a long time ago, I was surprised how fast I came with my very first application.

Read more

Introduction to AngularJS

Lots of things are happening in the JavaScript world: it’s moving so fast it’s difficult to keep up with it!

Angular-JS is an open-source MVC framework created by Miško Hevery and Adam Abrons in 2009 which has been bought and is now maintained by Google.

Read more