In the early afternoon I finished The Dragonbone Chair. I liked the book; recommended.
There are numerous blog posts about table-driven tests in Go. In this blog post, I want to show a technique we have recently started using in our unit tests. I saw it the first time when my friend Matt Layher introduced it to me at work, and since then, I gradually started using it in places where it's suitable. This technique comes especially handy for large structs with multiple nested fields.
Source: Functional table-driven tests in Go, an article by Fatih Arslan.
When choosing between pixels and rems in CSS, you should almost always use rems. It's a simple rule to follow. This article explains why.
Source: PX or REM in CSS? Just Use REM, an article by Austin Gil.
Following a brutal civil war, Osten Ard has been crushed under the rule of the two villainous High Kings. A single hope remains: if the rebels can find the three swords of legend - Memory, Sorrow and Thorn - they might be able to bring the Storm King and evil King Elias down.
Once but a humble kitchen-boy, Simon is now Simon Snowlock, dragonslayer and bearer of the mythical sword Thorn. But Simon is more alone than ever before: his friends have been imprisoned and his liege lord, Prince Josua, has been exiled. And the Storm King may also be in possession of one of the swords...
A single chance remains: if Simon can deliver Thorn to Joshua and lead his followers to the Stone of Farewell, the rebels may be able to muster the forces necessary to rise up against Elias and the Storm King. But no one knows where the Stone of Farewell is. Or, indeed, what it is...
In the evening I started in Stone of Farewell, Memory, Sorrow & Thorn Book 2 by Tad Williams.
Let’s solve part 1 of today’s Advent of Code challenge “Rock Paper Scissors” in type-level Haskell.
Instead of using term-level programming as we usually do, we make Haskell’s type system do the work of calculating the solution. So the solution is be known right after we compile the program, and we do not even need to run the compiled program.
Source: Solving Rock-Paper-Scissors in Type-level Haskell, an article by Abhinav Sarkar.
It seems more and more common, at least in the self-hosted community, to provide two methods of installations: Docker or a shell script installer. It seems that many new projects don’t even bother with a native package manager, such as dpkg or rpm, which makes me reluctant to use them.
Many talk about the security implications of piping curl into bash but it has been talked about enough and the solution is usually splitting the process into two steps, fetching the file and then running it. But what really makes me avoid running those scripts is how complicated they are and their audacity of how they treat my system.
Source: The Audacity of Piping Curl to Bash.
he world of Django deployment is huge and complicated, but that doesn't mean it has to be for you. In this guide we'll cover the big picture decisions you'll make when deploying your Django application—from choosing a hosting strategy to the nitty-gritty details of where to store your passwords. Hopefully after reading it you'll walk away with a better understanding of how to make these choices, and clear path forwards for your new little corner of the Internet.
Source: The Essential Django Deployment Guide, an article by Cory Zue.
Four years after the destruction of Isla Nublar, Biosyn operatives attempt to track down Maisie Lockwood, while Dr Ellie Sattler investigates a genetically engineered swarm of giant insects.
In the evening Alice and I watched Jurassic World: Dominion. I think the movie was OK, so I give it a 6 out of 10.
Even a decommissioned Raspberry Pi could have some utility running on the home network. With some time to spare, last weekend seemed like the weekend for building RPi images. To get going quickly it’s possible to download pre-built NixOS SD card images from Hydra. Guaranteed to save me a lot of time, that was naturally not the path I chose. I wanted to build the image and machine configuration myself, because why not1.
Source: NixOS: On Raspberry Pi 3B, an article by Martin Myrseth.
forallis something called "type quantifier", and it gives extra meaning to polymorphic type signatures (e.g.
:: a -> b,
:: a -> Int, ...).
forallplays a role of the "universal quantifier", it can also play a role of the "existential quantifier" (depends on the situation).
What does all this mean and how can forall be used in Haskell? Read on to find out!
an article by Martin Sosic.
Source: A* Algorithm in Haskell, an article by Abhinav Sarkar.
Follows a young graffiti artist who discovers a shocking secret that would put him and the ones closest to him in danger.
In the evening Alice, Esme, and I watched I Came By. I liked the movie and give it a 7 out of 10.
Rust prevents out-of-bounds memory accesses and buffer overruns via runtime bounds checks - what’s the cost of those bounds checks for a real-world, production application?
Source: How much does Rust's bounds checking actually cost?, an article by Griffin Smith.
The moment you press the Power button, Intel and Apple silicon Macs are different. What happens next on an Intel Mac is governed by its (U)EFI firmware, and any keys you might be holding at the time, whereas an Apple silicon Mac runs its own firmware and checks what you’ve done with the Power button alone.
Source: An A to Z of keys and keyboards: Startup and login, an article by Howard Oakley.
The premise of VimGolf is simple: challenges consist of a start file and an end file. The goal is to get from the start file to the end file, using Vim, in as few keystrokes as possible. I’ve been playing VimGolf as a way to acquire new skills.
Source: Vim Tips for the Intermediate Vim User, an article by Jemma Issroff.
I think dynamic typing is itself really neat and potentially opens up of really powerful tooling. It’s just … I’m not actually seeing that tooling actually exist, which makes me question if it’s possible in the first place.
Source: I am disappointed by dynamic typing, an article by Hillel Wayne.
Category theory is a domain of mathematics that exerts a strange influence over programmers. One thing that can be said for sure about category theory is that it is highly abstract, and its relationship to software engineering is not immediately obvious. I consider myself to be more on the pragmatic side of software engineering, so why did I set out to learn category theory beyond the few concepts popularized by functional programming?
Source: Why I am learning category theory, an article by Manuel Odendahl.
To get the most out of Git, you must use it the least amount possible when it comes to trunk-based development. Limit the commands you use, keep your feature branch up to date properly, and standardize usage as a team. Individually, you may enjoy the freedom to do whatever you want. But as a team, the price for freedom is paid for in friction.
Source: Minimum Viable Git for Trunk-based Development, an article by Eli Schleifer.
While writing this blog and leading Go teams for a couple of years, the most common question I heard from beginners was “What framework should I use?”. One of the worst things you can do in Go is follow an approach from other programming languages.
Other languages have established, “default” frameworks. Java has Spring, Python has Django and Flask, Ruby has Rails, C# has ASP.NET, Node has Express, and PHP has Symfony and Laravel. Go is different: there is no default framework.
What’s even more interesting, many suggest you shouldn’t use a framework at all. Are they insane?
Source: The Best Go framework: no framework?, an article by Robert Laszczak.
Flexbox is a remarkably powerful layout mode. When we truly understand how it works, we can build dynamic layouts that respond automatically, rearranging themselves as-needed.
Source: An Interactive Guide to Flexbox in CSS, an article by Josh Comeau.
It was announced a couple of hours ago, Emacs 29’s branch is now cut from the master branch! This means the
emacs-29branch will from now no longer receive any new feature, but only bug fixes.
So, what’s new with this new major release? I skimmed over the
NEWSfile, and here are the changes which I find interesting and even exciting for some.
Source: Emacs 29 is nigh! What can we expect?, an article by Lucien Cartier-Tilet.
Two-factor authentication is now essential for a lot of web sites, as it ensures that - even if someone gets your access credentials - he/she cannot login, because a token from your mobile phone is required. Therefor, the hacker should also have access to your phone and to the code to unlock it, which is highly unlikely.
Source: Two-factor authentication (2FA) in Perl with TOTP algorithm (Microsoft or Google Authenticator or others), an article by Michele Beltrame.
Now there is a new generation of shells that allow passing structured data through a pipe. This is a major thing and well worth its own article.
One of these is Elvish, a shell written in Go that runs on Linux, BSDs, macOS, and Windows. It is also the shell that managed to make me switch again.
But let's focus on another of its features: filtering of entries during menu completion. And not just the values but the descriptions as well. You will understand later why this is important.
So let's change that...
Git notes are almost a secret.
They’re buried by their own distressing usability.
But git notes are continually rediscovered by engineers trying to stash metadata inside git.
Source: Git Notes: git's coolest, most unloved feature, an article by Tyler Cipriani.
A few helpful Postgres Tips & Tricks.
CSS has a whole slew of different color formats: hex codes, rgb(), hsl(), lch(), the list goes on!
Which one should we use? It might seem like an inconsequential decision, but there are some pretty important differences between them. And, honestly, I think most of us are prioritizing the wrong things. 😅
Source: Color Formats in CSS - hex, rgb, hsl, lab, an article by Joshua Comeau.