All posts by

Espen Hovlandsdal

expand_more

Be environment aware!

Blog post header

Every once in a while, I see or hear someone complaining that a basic React application ran through Webpack ends up being 700 kB or more. I think it’s important to take a look at why this is happening – cause it’s usually all about the environment. When you’re in

JavaScript Code Style

Blog post header

Code is read much more often than it is written. Having a consistent and defined coding style helps developers read the code, and it also helps to make a code base feel like one unit, instead of individual pieces written by different authors with their own way of doing things. Having

Writing, testing and publishing Javascript modules

Blog post header

So you want to write reusable, maintainable and modular Javascript, huh? Good. Here’s a rather extensive “getting started”-guide by yours truly – which means it’s my own preferred way of doing things. It’s written with open-source in mind, but most points can be applied to “private” modules as well.

The magic of createObjectURL()

Blog post header

The web platform is maturing faster and faster, and we’re seeing the work normally done by native desktop applications now often shifting towards web-based applications instead. Features that may appear to have little importance can be really powerful when combined together. A good example of this is URL.createObjectURL(). On it’s own,

NPM, Travis, Node 0.8 and the “Caret Operator”

Blog post header

If you have a node.js project that you want to have tested using Travis-CI, you may run in to a problem if you want to support node <= 0.8. The reason for this is the new caret operator, which was introduced in node-semver. This module is used by npm to

Visualizing the most read articles on VG

Blog post header

D3. Behind this name is a pretty neat concept, called Data-Driven Documents. I took a look at the framework last year after seeing a lot of cool demos using it. It’s really flexible, and is not tied to a specific form of presentation – you can use D3 to generate an

OpenVPN configuration files + Ubuntu’s network manager

Blog post header

OpenVPN has feature that exports client configuration files. While it is definitely possible to run OpenVPN from the command line, I prefer to have a GUI that allows me to easily connect/disconnect from VPN. Ubuntu’s network manager and the .ovpn configuration files exported from OpenVPN does not play well together,

Varnish + requests with no Content-Length header

Blog post header

HTTP 1.1 introduced the concept of chunked transfer encoding. This (among other things) enables us to send a request without knowing how large the content is going to be at the time we start the request. An example usage would be where you generate content on-the-fly. You could potentially send chunks

EditorConfig: Consistent coding style

Blog post header

If you’ve worked on more than one project in your coding career, you’ll probably have come across different coding styles. While some projects prefer an indentation of four spaces, others might prefer to only use two. Some may even use tabs. Then there’s line-endings, charsets and trailing whitespace. When you

PHP: Perform HTTP requests in parallel

Blog post header

Ever had to request multiple HTTP-resources in your web application? Often, you need data from one request to be able to request the second – in this case there is little you can do but wait for the first to return. However, if the requests are not dependent on each

WebGL DAE model viewer

Blog post header

3D modeling is pretty fun. I’m nowhere near an expert – in fact, I’ve only really used Sketchup. There was a time when I was really into it, making 3D-models for all sorts of PC components. The other day, I was looking at a WebGL demo made in three.js, and

Server-side Highcharts rendering

Blog post header

Highcharts is a fantastic tool for generating javascript-based charts. It’s flexible, fast and can be extensively customized. Recently, I had to find a way to render Highcharts as static images on the server as we wanted to attach charts in emails. The reason why we wanted to stick with Highcharts