Encrypting a file in gpg without importing the key

The title of this post is a bit of a misnomer because it is always necessary to import a gpg key before it can be used to sign/encrypt/etc. anything. However we can create a temporary GPG home directory, use it for the encryption process and discard it afterwards. The example below is written in Python but can easily be ported to other languages.

Read More

A simple task queue in TypeScript

The task queue implementation below provides a simple, drop-in solution for ensuring dynamically generated asynchronous tasks are executed sequentially. A typical use case for this would be update-requests that need to be executed in the order they were created. It works by chaining the submitted promises and assumes that all promises are eventually fulfilled or rejected.

Read More

Exhaustive when-expressions in Kotlin

Per default Kotlin only requires when-expressions to be exhaustive if the result is assigned to a variable. However when the result is not assigned to a variable, no exhaustiveness checks are performed.

Read More