Monthly Grinder

Prepare for MAYhem, as I’m about to blast a bunch of links right at you! May you find them useful and/or entertaining!
-
Tagged template literals in JS seem to be less well-known than they deserve. It’s a fun and simple way to sprinkle some customized magic over bog-standard strings, kind of like a domain-specific language. Here’s a creative example in Jest, which lets you specify an array of data, visually looking like a table of data.
-
Turns out there’s a built-in HTML attribute to make something editable… and it reaches further than expected! Try it on a list or a table and be amazed! Admittedly it’s more fun than practical, but there’s nothing wrong that.
-
CSS has an :empty pseudo-class that lets you target elements with nothing inside them. While this may seem like a solution looking for a problem, it can in fact be pretty handy for dealing with the empty state of error messages, info blocks, and the like.
-
Chrome now has a feature to find an open tab by its name, handy if you have 40 of them open at any given time. If you’re like me, an even better option is to use OneTab and stash away unused URLs onto a single list (…where, if you’re like me, the vast majority will rot for the rest of eternity)
-
Here’s about a dozen security concerns you’d rather not think about when setting up a server. Unfortunately, you must, since people on the internet are assholes (present company excluded).
-
Gitlab CI now supports references for reusing config snippets. Previously you could choose between
extends
(works cross-file, but copies whole jobs) andanchors
(works only in the same file, but can be a partial config). And this is why you should use a programming language for configuration, because sooner-or-later you’ll end up there anyway. -
Newer SQL server versions have a feature called memory grant feedback, which will automatically react to memory grant warnings (too much / too little), and adjust future query executions accordingly. Though admittedly, it’s better to eliminate such warnings by using narrower or non-variable-width columns in the first place.
-
Check out this neat intro to the concept of branchless programming, a somewhat non-intuitive low-level optimization technique for modern CPU architectures. If you’re wondering if it’s still relevant today: even with CPU branch prediction and compilers being super smart these days, hand-written assembly is still 20-40x faster in one example. So don’t worry, the machines aren’t taking over just yet… metallic laughter
-
Depressing link of the month: Cryptocurrency is an abject disaster.
That’s it for this time, see you next month!