The Right Code

Home of Greg Bergé. Let's speak about JavaScript.

Naming functions, yes but not all the time

You've probably heard that using named functions is better in JavaScript, better for stack trace and debugging. In most cases it's true, but sometimes it's better to avoid naming a function. Unreferenced functions The functions that I call unreferenced are functions that are not attach to an object. Some examples…

Cody, my Ghost theme

I have just release my Ghost theme on Gumroad, it's named Cody. Cody is a simple and beautiful responsive theme optimized for developers. This blog is a live demo. Features : Support of Ghost version 0.5+ Focused on content Fully responsive Easy to configure Perfomance (minification, prefetching, async loading) -…

Add node_modules to .gitignore

If like me, you are tired to create .gitignore in your node projects. Just do this: echo "node_modules/\nbower_components/" >> .gitignore You can also add in your ".bashrc" or in your ".zshrc" the alias: alias gitignore='echo "node_modules/\nbower_components/" >> .gitignore' Congratulations! You will…

Use minimal-ui in viewport meta tag

Apple has just released iOS 7.1, it's more stable, more beautiful, more "the most advanced operating system". But with all that, there is a great improvement for web developpers, particulary for mobile web developers that we are all, of course. They added the possibility to minimize Safari UI without…

Use primus with a cluster

What is Primus ? Primus is a great module, it provides an abstraction for real-time library. You can use Engine.IO, ws or SockJS without changing any line of code. But that's not the only advantage of Primus. The library has a lot of plugins: events, rooms or resources (share code…