› gerlach.coffee

Hi, I’m Maximilian Gerlach. Every once in a while I do or find something that seems worth sharing and then I put it here!
I’ve been annoyed by my company’s sign-in workflow for a while. A few times a day (depending on what computers I use) I have to open Authy, wait until it loads (thanks Electron), click on Okta, click on the copy icon, and then paste it into the screen. A few days ago I finally got annoyed enough to do something about it. Extracting the Password Seed You may not know that time-based one time passwords are basically just a simple algorithm based on an initial seed: https://en.
What is Datahike? Datahike can be described as a Datomic lite. It uses most of the excellent Datascript, ports it to the JVM, and persists the datoms to the local disk. It has very modest requirements and should run even on very small EC2 instances. Why Datahike? I am working on a small web app with a seemingly very simple data model that turned out to be very hard to model in SQL due to to a number of many-to-many relationships.
For work I recently needed to implement scenario: The web app should be freely acessible within the office (which has a static IP address to the world) OR from home using HTTP basic auth. This wasn’t super straightfoward, so here is my implementation: I used two ring libraries: ring-ip-whitelist ring-basic-authentication with these deps.edn coordinates: net.danielcompton/ring-ip-whitelist {:mvn/version "0.2.1"} ring-basic-authentication {:mvn/version "1.0.5"} To implement my specific scheme, I pulled out the pieces I needed and wrapped them up in a new ring middleware:
I recently bought a few Leviton Decora Smart smart home switches. I specifically bought them for their Apple HomeKit integration, which is usually the most choosy protocol. I had assumed that this would also work with Alexa (which I prefer to Siri because it understands me a lot better), but those specific switches work only with Homekit. So I had to find a way of somehow bridging them to Alexa. This is how:
I love lumo. It’s a wonderful way to hack together quick scripts using Clojurescript. But as of now (version 1.6.0) it only supports 1.5GB of heap space. This is generally enough for most things, but if you work with really big files (and you can’t or won’t rewrite your whole program to use a better approach like streaming) then you have a problem. This is a default setting of nodejs that can be fixed by invoking the node command with the --max_old_space_size=8192 flag (to allow for 8GB of heap space).
At the beginning of the month, Dropbox deprecated their public folders. In case you didn’t know, public folders allowed you to put things into the public folder of your Dropbox, and then you could right-click on it, select copy public link and you’d be able to share whatever you put there right away. It was super convenient, but I assume too many people used it to host their website, and now Dropbox only provides links to the Dropbox website, that let you view or download the content.
« Older posts Newer posts »