• Neovim plugin settings with Lua metatables

    A lot of new Neovim plugins come with a setup function which lets you specify the settings of the plugin. Users are expected to call that function with a table as arguments which contains the user's personal settings to override the defaults. This works, but Lua is all about tables, so let's look at an alternative.

    Continue reading…

  • Subservience to the algorithm

    Over the last couple of years I have been noticing two trends among internet videos, especially on YouTube: videos that could easily be three to four minutes long are stretched to over ten minutes in length, and thumbnails where people are making stupid faces. This comes from YouTube's recommendation algorithm favouring thumbnails with people's faces, and videos needing to be at least ten minutes long to be eligible for advertising revenue. At least those used to be the rules back then, they might have changed since, but the videos still follow the same pattern.

    Continue reading…

  • Managing Vim plugins without a plugin manager

    Recently I have switched my Neovim setup to using the new native Vim package system directly instead of relying on a plugin manager. I had to use Git submodules for another project anyway, so I figured I could combine them with Vim packages and see how that might work out. It is actually working pretty well, to the point where I don't think that I will be returning to plugin managers for the foreseeable future.

    Continue reading…

  • Getting Unity Hub 3 working on GNU/Linux

    Recently I had the misfortune of a data loss, so I had to re-instally my OS again. But even worse: I also had to re-install Unity on GNU/Linux, which has been an exercise in frustration and trial & error. In this post I will outline what I had to do, in the hope that it will be of use to other people.

    Continue reading…

  • Running MongoDB from Guix

    I have been watching a tutorial on GraphQL recently (YouTube link) where the lecturer uses MongoDB for persistent storage. He instructs viewers to sign up for a service that hosts a database, but I wanted to run a local instance on my machine instead. MongoDB is not available in the Void repos, but fortunately it is available in the Guix repos. However, running the Mongo deamon requires a little tweak first.

    Continue reading…

  • A pipe operator for Lua

    I have recently been getting into Elixir, and one nice feature it has is the pipe operator. It allows us to express a pipeline of function through which an object will be dragged. This got me thinking: with how flexible Lua is, would it be possible to add something similar to Lua as well?

    Continue reading…

  • Spreading tables in Lua

    Javascript has a spreading operator which lets us splice the contents of an object or array into another object or array. This makes it very easy to create an object based on another object and override or add entries. Since Lua and Javascript are quite similar, wouldn't it be nice to have this operator in Lua as well? Lua is a minimal language, so adding a new operator seems unlikely, but Lua is also very flexible, and we can add a spreading function instead.

    Continue reading…