<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title>webcodr</title>
		<link>/</link>
		<description>Recent content on webcodr</description>
		<generator>Hugo</generator>
		<language>en-us</language>
		
		
		
		
			<lastBuildDate>Sun, 05 Jul 2026 20:28:50 +0000</lastBuildDate>
		
			<atom:link href="/index.xml" rel="self" type="application/rss+xml" />
			<item>
				<title>Find things even faster with srchr</title>
				<link>/2026/07/find-things-even-faster-with-srchr/</link>
				<pubDate>Sun, 05 Jul 2026 20:28:50 +0000</pubDate>
				<guid>/2026/07/find-things-even-faster-with-srchr/</guid>
				<description>&lt;p&gt;Inspired by my last post about &lt;code&gt;rgp&lt;/code&gt; and &lt;code&gt;fdp&lt;/code&gt; I got the idea to combine both into a more powerful and easier tool called &lt;code&gt;srchr&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;p&gt;It&amp;rsquo;s a TUI written in Rust and uses similar or the same libraries as &lt;code&gt;rg&lt;/code&gt;, &lt;code&gt;fd&lt;/code&gt;, &lt;code&gt;fzf&lt;/code&gt; and &lt;code&gt;bat&lt;/code&gt;, but in one package. There are no external dependencies and it comes for macOS, Linux and Windows in aarch64 and x86-64.&lt;/p&gt;&#xA;&lt;p&gt;Currently &lt;code&gt;srchr&lt;/code&gt; is not available via package managers, but there&amp;rsquo;s an installation script:&lt;/p&gt;</description>
			</item>
			<item>
				<title>Using fd, rg, fzf and bat to find things fast</title>
				<link>/2026/07/using-fd-rg-fzf-and-bat-to-find-things-fast/</link>
				<pubDate>Sun, 05 Jul 2026 17:05:03 +0000</pubDate>
				<guid>/2026/07/using-fd-rg-fzf-and-bat-to-find-things-fast/</guid>
				<description>&lt;p&gt;Modern terminal programs like &lt;code&gt;fd&lt;/code&gt; or &lt;code&gt;rg&lt;/code&gt; make it really easy to find stuff, but there&amp;rsquo;s still room for improvement. In this post I will show you how to use fish to write to small functions with &lt;code&gt;fd&lt;/code&gt;, &lt;code&gt;rg&lt;/code&gt;, &lt;code&gt;fzf&lt;/code&gt; and &lt;code&gt;bat&lt;/code&gt; to search for file names and file content with an interactive list and even a preview in the terminal.&lt;/p&gt;&#xA;&lt;h2 id=&#34;i-dont-know-that-stuff&#34;&gt;I don&amp;rsquo;t know that stuff?&lt;/h2&gt;&#xA;&lt;p&gt;First things first. If you already know &lt;code&gt;fd&lt;/code&gt; or the other tools from above, feel free to skip this section.&lt;/p&gt;</description>
			</item>
			<item>
				<title>Fix Omarchy Gaming (Vulkan)</title>
				<link>/2025/10/fix-omarchy-gaming-vulkan/</link>
				<pubDate>Fri, 31 Oct 2025 21:48:59 +0000</pubDate>
				<guid>/2025/10/fix-omarchy-gaming-vulkan/</guid>
				<description>&lt;p&gt;After setting up my new notebook, I wanted to try some games on Steam. Works like a charm on my mini PC with Omarchy, but not this time. After starting a game, it takes a few seconds and nothing, the game silently crashes.&lt;/p&gt;&#xA;&lt;p&gt;After fiddling and searching around, Proton logging etc., still no cause in sight. Then I tried Doom 2016 and it worked! But why? Doom starts with an OpenGL renderer, after switching to Vulkan it behaves like the other games. So there&amp;rsquo;s something wrong with Vulkan?&lt;/p&gt;</description>
			</item>
			<item>
				<title>Hyprland Trackpad Tips &amp; Tricks</title>
				<link>/2025/10/hyprland-trackpad-tips-tricks/</link>
				<pubDate>Wed, 29 Oct 2025 22:57:34 +0000</pubDate>
				<guid>/2025/10/hyprland-trackpad-tips-tricks/</guid>
				<description>&lt;p&gt;For first time in my life I bought a PC notebook. I didn&amp;rsquo;t even consider to boot in the pre-installed Windows 11 and installed Omarchy right away.&lt;/p&gt;&#xA;&lt;p&gt;The HP ZBook has a quite good trackpad, even compared to MacBooks, but some things seemed off. No right-click with two fingers, instead it would only work in the lower right corner. And I absolutely hate tapping, I want real clicks.&lt;/p&gt;&#xA;&lt;p&gt;Turns out, it&amp;rsquo;s not the hardware. It&amp;rsquo;s all configurable in Hyprland. In Omarchy you can find the settings in &lt;code&gt;.config/hypr/input&lt;/code&gt;, sub-category &lt;code&gt;input:touchpad&lt;/code&gt;.&lt;/p&gt;</description>
			</item>
			<item>
				<title>More awesome CLI tools</title>
				<link>/2025/08/more-awesome-cli-tools/</link>
				<pubDate>Fri, 29 Aug 2025 21:34:15 +0000</pubDate>
				<guid>/2025/08/more-awesome-cli-tools/</guid>
				<description>&lt;p&gt;This a follow up article to &lt;a href=&#34;/2024/03/awsome-cli-tools/&#34;&gt;Awesome CLI tools&lt;/a&gt; with even more useful CLI tools.&lt;/p&gt;&#xA;&lt;h2 id=&#34;btop&#34;&gt;btop&lt;/h2&gt;&#xA;&lt;p&gt;It&amp;rsquo;s &lt;code&gt;top&lt;/code&gt; on steroids with a beautiful terminal UI. Way more information at a glance and just a joy to use.&lt;/p&gt;&#xA;&lt;h2 id=&#34;delta&#34;&gt;delta&lt;/h2&gt;&#xA;&lt;p&gt;Do you often look at git diffs? Are you missing syntax highlighting? &lt;code&gt;delta&lt;/code&gt; is here to help. Just install it, configure delta as pager for git and voila, diffs with syntax highlighting.&lt;/p&gt;&#xA;&lt;h2 id=&#34;dog&#34;&gt;dog&lt;/h2&gt;&#xA;&lt;p&gt;Dog is a modern DNS lookup tool with colored output and a simple interface.&lt;/p&gt;</description>
			</item>
			<item>
				<title>I&#39;m using Arch btw</title>
				<link>/2025/08/im-using-arch-btw/</link>
				<pubDate>Fri, 01 Aug 2025 20:36:11 +0000</pubDate>
				<guid>/2025/08/im-using-arch-btw/</guid>
				<description>&lt;p&gt;Well, that escalated quickly. One week ago I would have said never to touch Arch (except SteamOS). Nothing personal, it&amp;rsquo;s just that I am primarily a Mac guy and never stayed with Linux that long. I really enjoyed Pop!_OS. System76 created a really nice flavor of Ubuntu, but it&amp;rsquo;s still Ubuntu, so packages are often out of date and you always have to rely on custom repos or other means to get current versions.&lt;/p&gt;</description>
			</item>
			<item>
				<title>Please don&#39;t do this with switch statements</title>
				<link>/2025/05/please-dont-do-this-with-switch-statements/</link>
				<pubDate>Wed, 28 May 2025 20:22:07 +0200</pubDate>
				<guid>/2025/05/please-dont-do-this-with-switch-statements/</guid>
				<description>&lt;p&gt;The classic C-like switch statement is fine, but it has its flaws. It&amp;rsquo;s no coincidence that modern languages like Kotlin or Rust offer alternatives like &lt;code&gt;when&lt;/code&gt; or &lt;code&gt;match&lt;/code&gt; or a more fine-tuned version of &lt;code&gt;switch&lt;/code&gt; like Zig.&lt;/p&gt;&#xA;&lt;p&gt;I&amp;rsquo;m currently the in early stages of rewriting a large and complex Java code base to Kotlin. Some parts of this codebase are really ugly and uncessarily complicated and convoluted. Yesterday I crossed the path of a nasty use of a switch statement in a operation on a Java Stream. Unfortunately I can&amp;rsquo;t share the real code, but imagine something like this:&lt;/p&gt;</description>
			</item>
			<item>
				<title>Fixing no A2DP with Bluetooth headsets on Linux</title>
				<link>/2024/10/fixing-no-a2dp-with-bluetooth-headsets-on-linux/</link>
				<pubDate>Mon, 07 Oct 2024 20:00:00 +0200</pubDate>
				<guid>/2024/10/fixing-no-a2dp-with-bluetooth-headsets-on-linux/</guid>
				<description>&lt;p&gt;&lt;strong&gt;Please beware that the following instructions are suitable for media consumption only! After this changes your headset can&amp;rsquo;t make any calls without a dedicated microphone until you undo them.&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;p&gt;Having trouble with the audio quality of your Bluetooth headset on Linux? It sounds awful if you&amp;rsquo;re listing to music and videos? Well, congratulations, I had the same problem and found a solution. At least if you&amp;rsquo;re only into listening and won&amp;rsquo;t make any calls. This works on Ubuntu or Ubuntu-based distributions like Pop!_OS or any other distribution that relies on Blue Z and Pipewire/WirePlumber for Bluetooth audio.&lt;/p&gt;</description>
			</item>
			<item>
				<title>Awsome CLI Tools</title>
				<link>/2024/03/awsome-cli-tools/</link>
				<pubDate>Wed, 06 Mar 2024 20:21:06 +0000</pubDate>
				<guid>/2024/03/awsome-cli-tools/</guid>
				<description>&lt;p&gt;There are some incredibly useful CLI tools out there. Here&amp;rsquo;s a list with some awesome tools I&amp;rsquo;m using for my daily work.&lt;/p&gt;&#xA;&lt;h2 id=&#34;atuin&#34;&gt;atuin&lt;/h2&gt;&#xA;&lt;p&gt;&lt;a href=&#34;https://atuin.sh/&#34;&gt;Atuin&lt;/a&gt; is a history replacement with a fuzzy finding search and sync/backup options (self-hosted if you need). It&amp;rsquo;s written in Rust (blazingly fast!) and stores the history entries in a SQLite db. You can even import your current history from your shell. Atuin supports bash, zsh, fish and NuShell.&lt;/p&gt;</description>
			</item>
			<item>
				<title>Micro DSLs for builders with Kotlin</title>
				<link>/2024/01/micro-dsls-for-builders-with-kotlin/</link>
				<pubDate>Fri, 19 Jan 2024 14:33:07 +0200</pubDate>
				<guid>/2024/01/micro-dsls-for-builders-with-kotlin/</guid>
				<description>&lt;p&gt;The builder pattern is a great tool and it&amp;rsquo;s heavily used in many Java projects and dependencies. But in a Kotlin code base it&amp;rsquo;s looks a little odd and out-of-date. In this short post I will show you how to write a micro DSL on top of builder with just a few lines of code.&lt;/p&gt;&#xA;&lt;p&gt;I&amp;rsquo;m using Spring&amp;rsquo;s &lt;a href=&#34;https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/http/ResponseCookie.html&#34;&gt;ResponseCookie&lt;/a&gt; class as base for the DSL as it has a builder already on-board.&lt;/p&gt;</description>
			</item>
			<item>
				<title>US International Keyboard Layout Without Dead Keys</title>
				<link>/2023/05/us-international-keyboard-layout-without-dead-keys/</link>
				<pubDate>Sat, 27 May 2023 21:36:06 +0000</pubDate>
				<guid>/2023/05/us-international-keyboard-layout-without-dead-keys/</guid>
				<description>&lt;p&gt;Depending on your country&amp;rsquo;s keyboard layout writing code can be quite annoying. The German ISO layout is an exceptional pain in the ass, as almost all relevant symbols require a modifier key, sometimes even two (I&amp;rsquo;m looking at you, Apple). German has some special characters (ä. ö, ü, ß) and it makes sense to have them readily available without modifier keys, but it just sucks for programming.&lt;/p&gt;&#xA;&lt;p&gt;I decided to switch to the US ANSI layout and bought two new keyboards: a Keychron K3 Pro for my MacBook Pro (light and portable, perfect if I have to go to my company&amp;rsquo;s office) and Keychron Q1 version 2 for my Windows PC. By the way, the Q1 is heavily modded and will be tweaked further in the coming weeks. I will write an article about the mods after the keyboard is finished.&lt;/p&gt;</description>
			</item>
			<item>
				<title>Introducing Server Runner</title>
				<link>/2023/05/introducing-server-runner/</link>
				<pubDate>Fri, 26 May 2023 23:53:33 +0000</pubDate>
				<guid>/2023/05/introducing-server-runner/</guid>
				<description>&lt;p&gt;In my recent adventures with Rust, I planned to write a REST API with the help of the excellent book &amp;ldquo;Zero To Production In Rest&amp;rdquo; from Luca Palmieri. That&amp;rsquo;s still happing, but as small side project, I wanted to write some kind of CLI tool.&lt;/p&gt;&#xA;&lt;p&gt;A few weeks ago I had wrote a bash script to run some web servers and check their status until they&amp;rsquo;re up and running. When all servers are ready, a command would be executed and all servers would be closed after this command is finished. Since I hate bash with passion, I asked an friend to help me: ChatGPT.&lt;/p&gt;</description>
			</item>
			<item>
				<title>Terminal evolved</title>
				<link>/2023/05/terminal-evolved/</link>
				<pubDate>Mon, 15 May 2023 19:22:14 +0000</pubDate>
				<guid>/2023/05/terminal-evolved/</guid>
				<description>&lt;p&gt;I﻿ always saw myself as a casual user of the terminal. I preferred zsh with the Prezto framework within in iTerm 2 with tabs and that&amp;rsquo;s about it. No more! A colleague of mine introduced me to kitty as terminal emulator, together with tmux and Neovim. That&amp;rsquo;s a lot to swallow. I was never a fan of the vi/vim user experience and more of a mouse guy. Well, what should I say? It&amp;rsquo;s awesome if you&amp;rsquo;re getting used to it. Let me explain &amp;hellip;&lt;/p&gt;</description>
			</item>
			<item>
				<title>Real-world performance of the Apple M1 in software development</title>
				<link>/2021/01/real-world-performance-of-the-apple-m1-in-software-development/</link>
				<pubDate>Thu, 21 Jan 2021 20:39:53 +0000</pubDate>
				<guid>/2021/01/real-world-performance-of-the-apple-m1-in-software-development/</guid>
				<description>&lt;p&gt;There are enough videos on YouTube out there to show how awesome the new Macs are, but I want to share my perspective as a software developer.&lt;/p&gt;&#xA;&lt;p&gt;About six weeks ago, I was too hyped not to buy an ARM-based Mac, so I ordered a basic MacBook Air with 8 GB RAM (16 GB was hard to get at this time). As strange as it sounds, I don’t regret buying only 8 GB of RAM. On an Intel-based Mac this would be an absolute pain in the ass, even my old 15” MacBook Pro Late 2017 with 16 GB struggles sometimes with RAM usage.&lt;/p&gt;</description>
			</item>
			<item>
				<title>Ryzen vs Apple Silicon and why Zen 3 is not so bad as you may think</title>
				<link>/2020/11/ryzen-vs-apple-silicon-and-why-zen-3-is-not-so-bad-as-you-may-think/</link>
				<pubDate>Wed, 18 Nov 2020 22:34:23 +0000</pubDate>
				<guid>/2020/11/ryzen-vs-apple-silicon-and-why-zen-3-is-not-so-bad-as-you-may-think/</guid>
				<description>&lt;p&gt;Apple‘s M1 is a very impressive piece of hardware. If you look at the benchmarks, like SPECperf or Cinebench, it‘s an absolute beast with a ridiculously low power consumption compared with a Ryzen 9 5950X.&lt;/p&gt;&#xA;&lt;h2 id=&#34;zen-3-is-that-inefficient&#34;&gt;Zen 3 is that inefficient?&lt;/h2&gt;&#xA;&lt;p&gt;10 W vs 50 W looks really bad for AMD, but the answer to this question is a little more complicated than this raw comparison of power usage.&lt;/p&gt;&#xA;&lt;p&gt;Here are basic things to know:&lt;/p&gt;</description>
			</item>
			<item>
				<title>webcodr goes Netlify CMS</title>
				<link>/2020/10/webcodr-goes-netlify-cms/</link>
				<pubDate>Sat, 31 Oct 2020 22:54:24 +0000</pubDate>
				<guid>/2020/10/webcodr-goes-netlify-cms/</guid>
				<description>&lt;p&gt;Until today posts on webcodr were published via a simple git-based workflow. If I wanted to create a new posts, I had to open the repository in Visual Studio Code and created a markdown file. After pushing the commit with the new file, a GitHub hook notified Netlify to pull the repo and build and publish the site.&lt;/p&gt;&#xA;&lt;p&gt;It was quite simple and effective, but lacks comfort and does not work on iOS/iPadOS devices. After buying a new iPad Air and Magic Keyboard, I wanted a pragmatic way to write posts without my MacBook or PC.&lt;/p&gt;</description>
			</item>
			<item>
				<title>Kotest and JUnit with IntelliJ or: don’t frak up your toolchain upgrades</title>
				<link>/2020/08/kotest-and-junit-with-intellij-or-dont-frak-up-your-toolchain-upgrades/</link>
				<pubDate>Sat, 29 Aug 2020 22:26:07 +0200</pubDate>
				<guid>/2020/08/kotest-and-junit-with-intellij-or-dont-frak-up-your-toolchain-upgrades/</guid>
				<description>&lt;p&gt;My team and I recently decided to use Kotlin for new features in our existing project. It was a great choice to implement a new authentication process and we’re now rewriting some older parts of the application from Java to Kotlin.&lt;/p&gt;&#xA;&lt;p&gt;Actually I wanted to use Kotlin for a while now, but there were only minor tasks within the Java part of the project. That finally changed and we can focus to improve the Java backend drastiscally.&lt;/p&gt;</description>
			</item>
			<item>
				<title>macOS Catalina EDID Override AKA HDMI color fix</title>
				<link>/2019/10/macos-catalina-edid-override-aka-hdmi-color-fix/</link>
				<pubDate>Mon, 07 Oct 2019 22:26:07 +0200</pubDate>
				<guid>/2019/10/macos-catalina-edid-override-aka-hdmi-color-fix/</guid>
				<description>&lt;p&gt;HDMI connections from your Mac to monitor can be a pain in the ass. There is a chance that macOS&#xA;will detect your monitor as a TV and set the color space to YCbCr. You will get wrong colors&#xA;and sometimes blurry fonts.&lt;/p&gt;&#xA;&lt;p&gt;If you&amp;rsquo;re having this problem, like me, you know the fix: a patched EDID created with this&#xA;&lt;a href=&#34;https://embdev.net/attachment/168316/patch-edid.rb&#34;&gt;little Ruby script&lt;/a&gt;.&lt;/p&gt;&#xA;&lt;p&gt;The installation of this EDID override could be tedious since the release of El Capitan, as SIP won&amp;rsquo;t let you&#xA;access the necessary system files. Just disable it in recovery mode, copy the file and enable&#xA;it again. Sucks, but works just fine.&lt;/p&gt;</description>
			</item>
			<item>
				<title>Hello, Dark Mode</title>
				<link>/2019/09/hello-dark-mode/</link>
				<pubDate>Wed, 25 Sep 2019 22:20:12 +0200</pubDate>
				<guid>/2019/09/hello-dark-mode/</guid>
				<description>&lt;p&gt;Dark mode for Android and iOS? Hold my beer &amp;hellip;&lt;/p&gt;&#xA;&lt;p&gt;It&amp;rsquo;s quite simple to implement. Every modern browser can evaluate media queries in JavaScript with&#xA;&lt;code&gt;window.matchMedia()&lt;/code&gt; and supports CSS variables.&lt;/p&gt;&#xA;&lt;p&gt;I added the following to my application JavaScript file:&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-js&#34; data-lang=&#34;js&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;kr&#34;&gt;const&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;preferColorSchemeResult&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;nb&#34;&gt;window&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;matchMedia&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s1&#34;&gt;&amp;#39;(prefers-color-scheme: dark)&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;k&#34;&gt;if&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;preferColorSchemeResult&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;preferColorSchemeResult&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;matches&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;===&lt;/span&gt; &lt;span class=&#34;kc&#34;&gt;true&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;nb&#34;&gt;document&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;documentElement&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;setAttribute&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s1&#34;&gt;&amp;#39;data-theme&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;s1&#34;&gt;&amp;#39;dark&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;}&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;else&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;nb&#34;&gt;document&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;documentElement&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;setAttribute&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s1&#34;&gt;&amp;#39;data-theme&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;s1&#34;&gt;&amp;#39;light&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;The script will set the data attribute &lt;code&gt;theme&lt;/code&gt; on the document element (html) with the possible values&#xA;&lt;code&gt;dark&lt;/code&gt; or &lt;code&gt;light&lt;/code&gt; depending on the result of the media query.&lt;/p&gt;</description>
			</item>
			<item>
				<title>Snapshot Tests With Jest</title>
				<link>/2018/06/snapshot-tests-with-jest/</link>
				<pubDate>Wed, 13 Jun 2018 16:31:12 +0200</pubDate>
				<guid>/2018/06/snapshot-tests-with-jest/</guid>
				<description>&lt;p&gt;Writing tests can sometimes be a tedious task. Mocks and assertions can be a pain in the ass. The latter is especially nasty when HTML is involved. Give me the second p element from the 30th div within an article in aside etc. &amp;ndash; no thanks.&lt;/p&gt;&#xA;&lt;p&gt;The creators of Jest (Facebook) have found a better way: Snapshot tests!&lt;/p&gt;&#xA;&lt;h2 id=&#34;how-does-it-work&#34;&gt;How does it work?&lt;/h2&gt;&#xA;&lt;p&gt;Take a look the following assertion:&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-javascript&#34; data-lang=&#34;javascript&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;nx&#34;&gt;it&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s1&#34;&gt;&amp;#39;should create a foo bar object&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;()&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;kr&#34;&gt;const&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;result&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;foo&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;bar&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;()&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;nx&#34;&gt;expect&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;result&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;).&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;toMatchSnapshot&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;()&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;})&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;code&gt;toMatchSnapshot()&lt;/code&gt; takes what ever you give to &lt;code&gt;expect()&lt;/code&gt;, serializes it and saves it into a file. The next test run will compare the expected value to the stored snapshot and will fail if they don&amp;rsquo;t match. Jest shows a nicely formatted error message and diff view on failed tests.&lt;/p&gt;</description>
			</item>
	</channel>
</rss>
