How JavaScript promises work

The world of JavaScript has had promises since long, in the form of libraries like Q, BlueBird and many others, like jQuery's deferred. And it's been native in JavaScript for awhile now.

I love them!

Read more

5 things remote working taught me about productivity

Since I started working remotely, now almost 3 years ago, I've learned a thing or two about my productivity. These lessons are not necessarily tied to working remotely per se, they'll also apply in a traditional working environment. The remote aspect just forced us to rethink how we deal with time & communication.

Read more

How to make your code scale

Building scalable software means that you are prepared to accommodate growth. There are basically 2 things you need to consider as your data grows:

  • Will requests be handled at a faster rate than they come in?
  • Will my hardware be able to store all the data?

Obviously, you will need more infrastructure as you grow. You'll need more machines. You'll probably also need/want to introduce additional applications to help lighten the load, like cache servers, load balancers, ...

Read more

You don't want to build your own minifier

Every developer has likely at least considered writing their own framework or CMS. Until you start to realize just how much work it is and how much of your problems have actually been solved by someone else already. Then you throw in the towel and start using (and hopefully, contributing) to existing open source projects that suit your needs. Writing a minifier is very much alike.

While working on a CMS we had started, we wanted to serve our CSS and JavaScript minified, automatically. We threw some regular expressions at those static files. Eventually, it became more complex, it grew into a project of its own.

Read more

Geographic searches within a certain distance

A 2-dimensional location on our earth can be represented via a coordinate system similar to an X & Y-axis. These axes are called latitude (lat) & longitude (lng).

Latitude is the north-south axis with a minimum of -90 (south pole) and maximum of 90 degrees (north pole). The equator is zero degrees latitude.

Longitude is the X-axis equivalent, running around the globe from east to west: from -180 to +180 degrees. The Greenwich meridian is 0 degrees longitude. Everything west and east from it is respectively negative and positive on the longitude scale, up until the middle of the Pacific Ocean, near the International Date Line, where -180° longitude crosses over to 180°.

Read more