Conservative rendering and liberal parsing of ISO 8601 timestamps in Python

You’ll see in Python bug 37962 that datetime.isoformat() and datetime.fromisoformat() use a restricted subset of the ISO 8601 timestamp formatting standards. This is similar to the subset followed by W3C. Recently, we ran into the specific issue that fromisoformat() rejects inputs where the timezone is specified as +hhmm instead of +hh:mm. Both are allowed by ISO 8601, but only the latter is part of the restricted subset. Following the Robustness principle (also known as Postel’s law) in the design of our APIs, we would prefer to

TypeScript development with Emacs, tree-sitter and LSP in 2022

In this post, I show how to setup Emacs for TypeScript and React (tsx) development, with tree-sitter for syntax highlighting and indentation, and LSP with the TypeScript compiler (including a plugin for faster eslint), via eglot, for code intelligence. First some background on tree-sitter Tree-sitter is a surprising and slightly revolutionary recent development (2017) in the world of code editors. It is both a parser generator tool and an incremental parsing library that works for multiple programming languages.

Connecting the Shelly 1 to an ET Systems gate motor for Apple HomeKit control

This post shows how you can connect a Shelly 1 unit to an ET Systems gate motor so that you can open your driveway gate via internet. In my case I opted to flash the Shelly 1 with the brilliant shelly-homekit firmware so that my whole family can control the gate via Apple’s HomeKit, but you could just as easily make use of the Google Assistant or the Home Assistant integrations.

Using Kubernetes for development containers

In this post I show how you can setup a Kubernetes pod for reproducible development purposes on a single-node Kubernetes cluster using Rancher Desktop on Linux or Docker Desktop for Windows. What are devcontainers? At my quasi-hypothetical workplace, we are fans of Visual Studio Code’s development containers idea, or devcontainers for short. In short, you add a specially crafted devcontainer.json file (and some docker yamls) to your repo, and the next time a new dev opens the project, they will be prompted by their VSCode whether they would like to have the whole development environment setup automatically.

Developer experience setting up a minimal API in Go, C# and Python

Imagine the following possibly hypothetical situation: You work in an organization or team that is heavily Python-focused, primarily due to operating in application domains where scientific computing is important. The Scientific Python ecosystem, of which machine learning is just one admittedly major theme, is brilliant for this. However, you would like to evaluate development stacks outside of the Python world for the implementation of small and higher-performance services, which don’t need SciPy, to augment your architecture.

Convert Org Mode files to docx with CMake and Pandoc for mobile accessibility

The wonderful Emacs Org mode is the basis for the largest part of my personal knowledge management system. However, as I’ve mentioned before, mobile accessibility is its weakest point. In this post, I’m going to explain my possibly unconventional new solution to the important requirement I mentioned in that note-taking post: Ideally, I would have easy access to my complete org database and any related files. As you can easily deduce from the title of this post, the solution involves converting all of my org database into docx files, with the main motivation that the Dropbox mobile app has excellent support both for the fast previewing and searching through the contents of docx files, while it has none of that sort of support for .

Configure org-roam v2 to update database only when idle

This post is reproduced here with permission from The OrgMode ExoCortex. org-roam v2, which was recently released, removed the update database on idle functionality (which I coincidentally contributed) as part of its simplification. I agree with this removal, as I think it makes the most sense to keep the org-roam core as simple as possible. That being said, being able to have the org-roam database update only when Emacs is idle can be helpful for some folks, like me, who C-x C-s quite often and notice a few hundred millisecond blocking delay on files of a thousand or more lines.