50 Lines of Code

My ramblings on Software Engineering, Open Source and Software Quality

All articles

CORS - a guided tour

When making network requests in the browser to other pages or APIs, the browser enforces the Same-origin policy to protect users and their data.
But what if we want to request data from another origin? Or if we want to run an API that isn't on the same domain? Let's see what CORS is and how we can use it.
Click here to read more!

Bits and bytes in JavaScript

If you want to work with binary data in JavaScript, this article will give you an overview of working with bits and bytes in JavaScript. Diving into bit-wise operations and their uses and how to work with the pixel data from images to filter colours, the basics of binary data and bitwise operations are the goal of the exploration in this article. Click here to read more!

JavaScript in parallel: Web Workers, Transferrable Objects and SharedArrayBuffers

JavaScript is single-threaded, which means that long-running tasks can make our web application unresponsive. Luckily, we have Web Workers as a remedy for this - but they do require some thought on how to divide a task and how to avoid a hefty memory cost when data is copied.
This article shows how to use Web Workers and transferrable objects and a new parallel primitive: The SharedArrayBuffer. Click here to read more!

Understanding different number systems

We are all familiar with the decimal system: ten symbols (0-9) combined in long rows form our way of expressing numbers. But nothing about that is a "natural" quality or necessity. Sometimes it is more useful to use other systems, such as binary and hexadecimal to express numbers.
Unfortunately, converting them between the different number systems seems tricky if not impermeable at first. Let me try to shine some light on it with this article!
Click here to read more!

HTML, DOM and JavaScript unraveled

Today, the different web technologies may be a little too much to take in at first and it won't get easier as things such as the Shadow DOM is added and frameworks and libraries may bring a Virtual DOM along. So let's dive right in an have a look at the different bits and pieces that are at play here.
Click here to read more!

The overwhelming web

There's a wave of fatigues among web developers: Framework fatigue, JavaScript fatigue, Tool fatigue - where does that come from? And: Is being a beginner in web development really harder than back in The Old Days™? I don't think so and the fatigue might be a warning indicator...
Click here to read more!

Slick and slf4j MDC logging in Scala

Logging and debugging in multi-user applications, such as servers, can be hard without context. MDC logging allows log messages to retain context without a hassle, but this only works within a single thread. We will examine how to make MDC logging work across multiple threads and especially how MDC logging works with Slick.
Click here to read more!

Five rules to stay levelheaded and efficient when handling downtimes

Downtimes, Crashes, Incidents, System Failures - they have many names, but most people involved with technology to some degree have experienced at least one at some point in their career.
Some of them I have caused, some of them I helped to resolve and in some of them I was a mere bystander.
This post is the distilled essence on how different teams that I had the pleasure of being a member, dealt and deal with the stress and the specific characteristics of these tense situations to ensure timely and proper resolution.

Click here to read more!

JSON-RPC 2.0 - for simple and powerful APIs

To my surprise a contender in the field of API protocols is yet unknown: JSON-RPC 2.0.
A standard since 2010, it is simple yet powerful but barely known amongst developers.
This article explains what it is, what makes it different and nice to work with and how to use it.

Click here to read more!

Wrapping up 2015

Now that I am winding down a bit, I get to take a look back at what’s been a wonderful, crazy year.
I would like to take this opportunity to share with you, chronologically, the many people I got to meet or meet again, the things that happened and left their impression on me and take a glimpse into 2016.


So if you wonder what’s been on my mind: read on!

Easy scaling with Docker, HAProxy and confd

Forrest is a very small shell script that binds together etcd and docker to allow easy scaling - for example with the combination of etcd + confd + HAProxy + Docker you can quickly and easily spin up a new web server instance and hook it into your load balancer.
Find out more