Benchmarking `bun run` and `bun build` with `hyperfine`

When writing small tools that support me with my daily work, I usually opted to shell-scripting with sh, bash or even zsh because I find the concept of piping text from one command to another pretty appealing. It's a straightforward and powerful concept that doesn't require a lot of set up: most CLI tools operate on a per-line basis, so it's a bliss to combine them.

The situation becomes more challenging when I need to work on JSONs, which are more natural in the JavaScript world, where I often work in. Usually, I opted for jq to parse JSON into line-based data, but I keep forgetting its syntax, which also can turn out complex and difficult to read.

Using the jsdom test environment

Recently, I started working on a new JavaScript codebase that uses the Jest test runner. After stumbling upon the following error when running some test cases in a file, I realized that I wasn't aware of the fact that Jest supports more than one test environment.

  ● Test suite failed to run

    The error below may be caused by using the wrong test environment, see https://jestjs.io/docs/configuration#testenvironment-string.
    Consider using the "jsdom" test environment.
    
    ReferenceError: window is not defined

    (...)

Using a proper pinentry remotely when running X

The application pinentry opens when you need to provide your password for decrypting your GnuPG key. You can install different interfaces for providing the password via pinentry. There are graphical and non-graphical variants e.g.,

$ dpkg -l | grep pinentry
pinentry-curses
pinentry-gnome3
pinentry-gtk2
pinentry-tty

Compiling Vim with modern features

I prefer the most updated version of vim these days. First, you must make sure that you have installed the required dependencies for building.

$ apt install \
    libx11-dev \
    libxt-dev