RSSAmplifier

Blog

Marius Gundersen

Articles from Marius Gundersen

mariusgundersen.netRSS feed ↗10 posts

Latest posts

Rotating earth-cube in CSS

I just saw a small neat demo of a rotating earth cube using css and js , and thought to myself "I can do that in only css". So that is what I'll do here. This article is the written log of how I have done this, so it might be a bit weird and rambly. Here goes. The first step is to get the 6 images and create an earth div with the six images. Note: The blog I'm writing this wraps <img> in <picture>…

Parsing user-agent strings with CSS

Which browser is this? Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/142.0.0.0 Safari/537.36 Edg/142.0.0.0 Let's have a look at the clues: It starts with Mozilla, which makes Firefox It contains Windows NT 10.0, så probably it runs on Windows 10 It Then contains AppleWebKit, so is this an Apple device? KHTML was the name of the KDE browser, but it has been…

Anchored definition popovers

Note: As of January 2026 the code on this page no longer work correctly. A change was made in the css spec that reverted an earlier change that enabled pseudo elements to be positioned relative to the anchor . There is a discussion to fix this again. For a project at work I've had to implement definition popovers . These should pop up above the word and be easily dismissed, for example by clicking…

Webpack CSS LiveReload

Webpack CSS LiveReload In this article I will describe how to make a very simple but useful live-reload plugin for Webpack, something I recently needed for a project. There are more complex plugins available, but they rely on the dev server which I couldn't use. Therefore I hacked together a simple standalone live-reload plugin, and now I'm sharing my journey with you. The goal is for the CSS in a…

Dynamic endpoint routing

I want to share a bit about how the endpoint routing in asp.net can be made dynamic. I tried to look into this, but couldn't find any documentation and so decided that I had to write about it myself. I will use asp.net 6 in this article since I can then use the minimal apis and more easily fit everything into a single file, but the code shown here will work in asp.net 5 and will work with the…

Template Literal Types

With the release of TypeScript 4.1 we get a really powerful feature called template literal types . This is based on the template literals that are in JavaScript, but now for the type system in TypeScript. Together with conditional types it makes it possible to parse strings and represent them as types at compile time. An early example that I saw was of ts-sql , which is an sql database…

Type-dictionary trick in C#

This article explores a trick in C# for looking up values based on types, much like a Dictionary<Type, T> only it's almost 10x faster! You probably don't need this trick and even if you need it, it will only work in a few very specific scenarios. But it's a neat trick that might be fun to read about. I don't know if this pattern has a name, and I'm not very good at naming things, so maybe I'll…

Duck-typed Extension methods in C#

C# might have started as a static object oriented language but over the years it has stolen implemented a lot of features from other very different languages. It has dynamic types, SQL-like queries, lambdas, async-await and so much more. In this article we'll see what kind of magic we can create if we take extension methods and mix them up with generics and duck-typing. Extension methods are ways…

Ekkiog followup

Almost two years ago I wrote about Ekkiog , and since then I haven't really written anything here, about it or anything else. In coding I follow the philosophy of agile/scrum/xp/mvp/ci where a program should always be usable and useful, but also under continuous development and improvement. And so I have worked on Ekkiog for almost two years, adding new features, improving existing parts and…

Ekkiog: Turing Complete NAND-Simulator

Today is the end of my summer holiday, and so I've decided to publish the status of my 2016 summer hobby project. This year I've been working on a webapp called Ekkiog, which is a NAND gate simulator for smartphones, using WebGL to concurrently simulate 65536 gates at 60 fps. If you are on a smartphone, click the link below to test it out. You can find the source code at GitHub . Click here for…