Blog

A collection of my wildest adventures with computers. Mostly about web development.

Pin exact dependency versions

Published on in Miscellaneous

In a perfect world, minor- and patch-level version bumps don't have breaking changes. In the real world, things are complicated and shit happens.

error.cause needs to be logged manually to App Insights

Published on in JavaScript

If you are logging errors to Azure App Insights, and an Error object has a cause property (which too could be an Error object), the cause Error's message and stack properties are not shown in Azure App Insights. But you can log them manually.

Book notes: Atomic Habits

Published on in Books

Tiny good things accumulate into great things. Tiny bad things accumulate into horrible things. This book tells you how to do more of those good things and less of those bad things.

Linen bedclothes are the best

Published on in Sleep

I recently switched from linen bedclothes (sheets, pillowcases, duvet covers) back to cotton bedclothes – bad idea. My sleep quality took a drastic hit.

Running vs jogging

Published on in English and Running

Jogging is one type of running. When I run, I mostly jog, but I still think I'm a runner, not a jogger. Huh?

Stop keeping your phone in your pocket

Published on in NoSurf

A trouser pocket is way too easily reachable. I often find myself reaching for my phone automatically even if I don't have anything to do with the phone.

Why compose() is right-to-left

Published on in JavaScript

Functions composed together with compose() are called from right to left. It feels unintuitive at first, but it's conventional and kind of makes sense.

JSX vs HTM (Hyperscript Tagged Markup)

Published on in JavaScript and React

Last updated on

HTM provides a transpiler-free alternative to JSX via tagged templates. HTM has some limitations, but can be used in browsers and can be good for smaller projects.

11ty vs Eleventy

Published on in Eleventy

The two names are often used interchangeably, but there's a slight difference: 11ty is the organization, Eleventy is the static site generator.

Goodbye Cookbook, hello more blog posts

Published on in Blogging

Last updated on

I ditched my website's Cookbook section and converted existing recipes to blog posts. Mostly to reduce stress and make things clearer.

Two-way data binding in React

Published on in JavaScript and React

Normally you would use one-way data binding in React apps: parent components own data and pass it to children. You can mimic two-way data binding with a custom hook.

Frequency illusion

Published on in Miscellaneous

That cool thing you just heard about – is it suddenly gaining popularity, or are you just noticing the topic more?

Action-driven CSS animations

Published on in CSS

Polish your animations by animating based on actions or events, like mouse-enter and mouse-leave, instead of animating based on states, like default and hover state.

Assume vs presume in English

Published on in English and Mnemonics

Last updated on

Both are guesses. Assume is weaker (little or no evidence), presume is stronger (reasonable evidence). But how to remember which is which?

Coding SVG icons by hand

Published on in SVG

Last updated on

Creating icons and simple figures by handcrafting SVG code is not as hard as it sounds.

Formatting lists with JavaScript's Intl.ListFormat

Published on in JavaScript

Last updated on

Pass an array of strings and get back a string with the array items separated by commas, except with the last comma replaced with the word "and" or "or." Like "item 1, item 2 and item 3."

"Illegal invocation" errors in JavaScript

Published on in JavaScript

Last updated on

The error is thrown when calling a function whose this keyword isn't referring to the object where it originally did, i.e. when the "context" of the function is lost.

Dynamic tag names in Pug

Published on in Pug

Last updated on

Use string interpolation at the beginning of a line, e.g. #{myVariable}.

My new microphone: RØDE Procaster

Published on in Battlestation

Last updated on

Much better than a Jabra headset, but also much pricier. Why a dynamic XLR microphone instead of a condenser USB microphone? Read on to find out.

RFC 2119 in a nutshell

Published on in Miscellaneous

Last updated on

RFC 2119 defines key words such as "MUST," "MUST NOT," "REQUIRED" and "SHALL" that are often used in specifications. Here's a summary of the key word definitions.

How to change Modified date programmatically in Episerver

Published on in C# and Episerver

Last updated on

When migrating content from another platform to Episerver, I wanted to set a specific datetime for each content's Modified date (Saved property). Sounds simple, but it was only possible by using Episerver's internal, undocumented API.