module.exports early, a simple pattern

Here's a very quick blog post about a pattern I started to use some time ago when creating node.js modules. I often see code like this: var func = function() { } var otherFunc = function() { } var working = 'yes'; // // dozen of functions // and at line 150.. module.exports = someFunc; What's wrong? Well I…

Read More

why I use function declarations and named functions

How do we define functions theses days ? var hello = function() { console.log('hello') } function hello() { console.log('hello') } obj.hello = function() { console.log('hello') } The first and third examples are anonymous functions stored in variables (first example) or inside a property (third example). What's wrong with that? anonymous functions are…

Read More

secret productivity tips for developers

I hope to get a lot of rage comments with this title because there is no need for secrets when coding. troll intro While coding, do you sometimes look like this? The tricks you will learn here will make you type like this: LET'S GO! almost serious intro Like any…

Read More

headless chrome and firefox in selenium with docker

Selenium automates browsers. That's it. What you do with that power is entirely up to you. Not a lot of people likes selenium, because: it's hard to install it seems unstable it's old (and thus not very attractive) Getting the selenium installation right on every developper environment can be very…

Read More

Premature optimization in nginx configuration

Nginx is good at serving static files, better than node.js. But serving files is accessing disk and disks can be slow, right? After posting Increase ghost and expressjs performance with some Nginx tuning, someone on twitter said: @zeroload And you also can enable Nginx's open file cache…

Read More

Increase ghost and expressjs performance with some Nginx tuning

Ghost blog platform is shiny, new and the markdown editor is GREAT! As a web-performance addict, I wondered how well my DigitalOcean small instance ghost blog was performing. load test I did a load test using blitz.io which is a very simple load testing tool. I selected Ireland location…

Read More