Posts with tag software development

How to solve canvas crash in Vitest with threads and jsdom



Themed websites with multiple color schemes the easy way


Nowadays a lot of Operating Systems support Light and Dark themes and even Web browsers started supporting it thanks to the prefers-color-scheme media query.

In this blog post I'm going to explain you how to apply and switch color schemes (themes) in a web application. I find it important that the mechanism is simple and the codebase stays maintainable (DRY).


I want a mock API and change responses on runtime


Nowadays many web applications are Single Page Apps that connect to an API via HTTP (for example REST or GraphQL). When you develop such an application, you do not only have to run a local development server, but also an API where it connects to. The API could be running on a dev cluster, but you can also run it locally on a different port for example.

A big advantage of connecting to a real API, is that you probably create less bugs. On the other hand, it is sometimes hard to test or setup up all possible scenarios. How do you for example test, in a controlled way, that your API responds with an internal server error and how the client handles this? In this blog I explain how to do this.


Mocking Vuex in Storybook and Vue Test Utils


This blog post demonstrates how to set up a simple unit test and story for a component that is connected to a Vuex store. These components usually are smart/container components.


5 Reasons why you should test your code


It is just like in mathematics class when I had to make a proof for Thales’ theorem I wrote “Can’t you see that B has a right angle?! Q.E.D.”, but he still gave me an F grade.


L-system Tree

For my 3D Computer Graphics course in 2010, I had to create a procedural model as an assignment. We decided to make a tree using L-systems. After a few daws of coding, the result of this assignment is a program which can draw procedural trees using OpenGL. Although OpenGL is nowadays an oldfashioned 3D drawing technique, the result looks quite pretty.


ColorBrewer interpolation comparison

The ColorBrewer color scheme picking tool is a wizard in the data visualisation world, especially for maps. What makes these color schemes so powerful?