Background I’ve been using the excellent lazy.nvim package manager for more than three years now, and I’ve been super happy with it. But with Neovim v0.12.0, vim.pack was shipped: a built-in (but still experimental) plugin manager that manages plugins using Git, with no third-party dependencies required, implemented by Evgeni Chasnovski (see neovim/neovim#34009 ), known for his work on…
If you’re experiencing sluggishness or stuttering in Neovim, there’s a straightforward way to measure exactly what’s going on using profile.nvim . This plugin instruments your Lua code and autocommands, and exports a JSON trace you can visualize in Perfetto (successor of the deprecated chrome://tracing ).
Inside a Neovim terminal, the $NVIM environment variable points to the parent Neovim’s Unix socket. This means you can query editor state, inspect buffers, check LSP diagnostics, and even send commands — all through Neovim’s msgpack-RPC API . What’s quite neat here is that since I run Claude Code inside a Neovim terminal window, I can make Claude use this API to query and hook…
When working with complex Terraform expressions, such as string manipulation using regular expressions, it is often useful to test them in isolation without needing to connect to a remote backend or authenticate with a cloud provider. Isolated testing using a plan To test an expression, you can create a temporary configuration file, for example /tmp/tf-test/main.tf , with your variables and…
If you’re using GitHub Pages with the official actions/upload-pages-artifact action and need to serve files from a file/folder prefixed with a period ( . ) sign, like the .well-known directory (e.g., for a custom Bluesky handle), you’ll hit a problem: v4 of the action excludes all dotfiles by default .
Go is peculiar in the sense that there’s a very tight social contract between the community and the standard library . Seemingly universally, the community agrees to use these specific, small interfaces, as glue between unrelated libraries. In fact, I think there’s even an expectation that implementations should, whenever possible, snap nicely together with standard library interfaces,…
Here is how you can create a pointer to a boolean in Go 1.26 : // New way in Go 1.26 b := new ( true ) This is equivalent to the older, more verbose method:
Inbetween eggnog and christmas carols, I figured I’d bring a short update about things that have been on my mind that I wish to share before the new year. LLMs Gemini 3 Pro Preview was released, but I prefer Claude Opus 4.5 in Claude Code over Gemini for anything coding related, most of the time. Claude is more consistent in my opinion. Recently, with Opus, I do hit the rate limits much…
I’m a passionate and enthusiastic software developer with 15+ years of professional software engineering experience. I’m part of a platform engineering team, developing a Google Cloud-hosted and event-based SaaS platform using technologies such as Go, Protobuf, gRPC, Pub/Sub, Spanner, BigQuery, Postgres, Vertex AI, OpenFGA and Terraform. This is my personal blog, where I scribble down…
Spring is coming, and the sun has been out a lot more. This weekend I’m meeting up with childhood friends, without the logistics and responsibilities which normally is part of my daily family life with young kids. I think sometimes young adults, or just people who doesn’t have kids, would think I’m exaggerating. I’m a simple man (and it’s fine if you call me “old” 😅) but I’m…
I did end up dusting off my gravelbike and biked to work twice this week, which translates into biking 11 km in ~35 minutes x2 (roundtrip). It ended up taking the same time as commuting by bus/tram and was a great opportunity to not only get excercise but to also listen in to some interesting Podcasts. I’m so happy about the Razer Kishi Ultra in combination with my iPad Mini (USB-C) .…
I’m fortunate to work at a company which allows the use of AI, and in this case Google Gemini Advanced. It’s really, really fast but I still feel Claude (Sonnet 3.5) is a lot more accurate and has better overall taste. But it’s still extremely helpful to have “AI chat” at your disposal. A colleague of mine took a third-party API spec and asked Gemini to write the Go…
Thorsten Ball has a great blog series called “Joy and Curiosity” over at Register Spill which celebrates the interesting and joyful parts of the week that passed by. I initially heard about this on the Cup o’ Go podcast and his ideas resonates incredibly well on how I have come to view life as a software engineer. I really encourage you to listen in to that Cup o’ Go…
TV network pings There are situations where the TV loses a packet every 20-30 pings. On each packet loss, Remote Play hangs for a second. Disconnecting the HDMI cable between the TV and the PS5 is a workaround for the problem. This prevents any potential interference between the TV’s HDMI-CEC control signals and the PS5’s network communication. On Sony BRAVIA TVs, you can permanently…
I got private beta access (quite late), and Ghostty is probably going to be out in its first public release any day now (update: it was released on 2024-12-26). Here are my initial impressions, having used it for a couple of weeks on macOS. Amendments 2025-01-02 This post has been amended with the following details since it was originally posted:
There are some exciting news in the Go community as of recently on how to manage tools in Go projects. With the next release of Go ( Go 1.24 , expected to be released in February 2025), it seems we’ll finally have a way to natively define per-project tools! 🎉
I’ve been using Neovim as my daily IDE/editor for a bit more than a year now. I’ve also been using tmux to manage sessions, first using t-smart-tmux-session-manager and later sesh , which supersedes the former project. What’s great about this is that it doesn’t matter which terminal emulator you use, you can still fall back to this kind of session management.
Turns out that if you publish a blog (like I do) on GitHub pages , and you want the site to be indexed by Google, it’s not so easy. I’m not sure entirely what the root cause is, but you have to manually add your site in the Google Search Console and then manually add each URL individually for indexing. This discussion outlines the problem perfectly.
This is a quickie, using the GitHub CLI and optionally some Python. Replace YOUR_ORG with your organization and export all your organization’s repo data to repos.json : gh api \ -H 'Accept: application/vnd.github+json' \ -H 'X-GitHub-Api-Version: 2022-11-28' \ /orgs/YOUR_ORG/repos \ --paginate > repos.json Expand to see what data is exported At the time of writing this post, this is the kind…
I’m working on a rather large project where we would want to replace a WSGI ORM with an ASGI ORM, but it’s tangled up into everything and ORM queries are executed from all over the business logic. If the ORM would’ve been decoupled from the objects tossed around in the business logic, it would’ve been much easier to replace the ORM. This blog post outlines an example of how…
Recently, an addition to Python 3.12 might be reverted in cpython#105948 , where a new json.AttrDict class could enable accessing a dict using dot notation using a json.load hook.
This is a short post on how you can publish wheels onto PyPi , using hatchling’s custom metadata hook, that seamlessly targets different Python interpreter versions. Let’s say you want to distribute some generated contents, which is intended to be consumed by the same Python interpreter version which generated the contents. This could be solved in a few different ways, but here…
Mobile sync with Apple Calendar Most of the time when adding a new calendar to Google Calendar, and you don’t see it showing up on your Apple calendar (iOS/iPadOS/macOS), the reason might be that the calendar is not selected for “syncing”. Visit this arcane page to fix it. Webcal URLs doesn’t sync events If you want to subscribe to a calendar which URL starts with webcal://…
Good morning, project! $ gh pr list #1626 chore(deps-dev): bump black from 23.1.0 t... dependabot/pip/black-23.3.0 about 7 hours ago #1625 chore(deps-dev): bump types-requests from... dependabot/pip/types-requests-2.28.11.17 about 7 hours ago #1624 chore(deps-dev): bump mkdocs-include-mark... dependabot/pip/mkdocs-include-markdown-p... about 7 hours ago #1623 chore(deps-dev): bump types-redis from…
SSH access Make your SSH keys visible to the SSH agent: # Linux ssh-add -K # macOS ssh-add --apple-use-keychain Verify your keys are visible to the SSH agent:
Load an .env file into the environment prior to running something which requires the environment variables: Contents of the .env file MY_SUPER_SECRET_TOKEN = 'foo' set -a source .env set +a You can now use the variables from the .env file in scripts:
When using Datadog for monitoring, Datadog will only record a trace if there is an incoming request. If there is no incoming request, such as if a cronjob is running, then Datadog will not record a trace and you might not be alerted by an error. To solve this, you can use the ddtrace-py library and create a custom trace/span whenever tag and tag a span with exception information. This will…
Sane git pull configuration The git pull command is a shorthand for git fetch followed by git merge . I like to avoid getting local merge commits on git pull . Therefore I’ve add the following to my ~/.gitconfig : [ pull ] ff = only This will cause git pull to only do a fast-forward merge, which is what I want 99% of the time. It’s the same as running git pull --ff-only .
No double quotes Warning Never use double quotes inside ${{ ... }} as it is simply not supported. Tertiary GHA has a really funky tertiary: ${{ x && 'ifTrue' || 'ifFalse' }} This only works if <ifTrue> isn’t the empty string. If <ifTrue> == '' then '' is considered as false , which then evaluates the right hand side of the || .
Combos Pull down default branch, remove merged branches gt repo sync -fr Add gt ss to restack all current stacks onto the newly pulled down default branch:
Good practice when running SQL query in prod Have a rollback strategy For example, create a query which creates a temporary table which holds a list of ids so that this list can later be used to “roll back” changes made to other tables. Run both the main query and the rollback query in staging first Run the queries with a transaction without commit first, to see that it completes without errors (…
Exceptions Custom exception class MyError ( Exception ): def __init__ ( self , message : str | None = None ) -> None : self . message = message super () . __init__ ( self . message ) Was something raised? def exception_was_raised (): return None not in sys . exc_info () Exception hooks You can register custom exception hooks , which can run code whenever an exception is raised, and just before the…
In software development, certain software were not designed to run on the ARM-based Apple Silicon. Thankfully, there are workarounds to install and run the Intel version of these applications. Like for the rest of this blog, this post aims to serve as a personal notebook and also for sharing this knowledge. When I started looking into solutions to my Macbook Pro M1 challenges, a huge chunk was…
I recently got some feedback (thank you @simmel , much appreciated!) on a previous post on debugging Poetry . I then realized it was a bit hard to follow if all you wanted to do was to install Poetry globally, with some added control from the default installation method .
This was just a fun experiment. Base62 vs base64 In the very common base64 encoding scheme, 64 characters are used for binary-to-text encoding: 0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz+/ Sometimes, the + and / characters can be undesired in the encoded string. An example could be a base64-encoded universally unique id to be used in a URL.
Basically, how to set this up. Remote development over SSH First make sure the following commands are executed from C:\System32\OpenSSH : ssh , ssh-keygen , scp . If they are located in e.g. Chocolatey’s bin folder, keys will be searched for in weird places. This can be verifed by installing which : choco install which which ssh Create key pair in Windows 10 client cd ~ mkdir .ssh cd ssh…
The new Windows Terminal (codenamed “Cascadia”) was revealed at this year’s Microsoft Build conference and quickly received a lot of attention, as it addresses the decades-old terminal experience in Windows. This is me jotting down notes on how to get up and running with the new Terminal before it gets officially released in the Windows store, using Visual Studio 2019. This is…
In episode 196 of the (Python) Podcast. init a very commonly discussed topic among open source programmers is covered, which I wanted to share here. The big takeaway is that just because you put your code publicly visible online, it doesn’t mean that it’s “free” for anyone to use. At least not until you slap a license on top of it, and depending on what your goals are with…
This is a short note on how to make a container access and control another container on the same host. The trick is to have the “controller” container map the host’s docker.sock into the container. On the host, query the uid and gid of the user which is executing containers: $ id fredrik uid = 1026 ( fredrik ) gid = 100 ( users ) groups = 100 ( users ) ,10 ( wheel ) The…
Recursively replace all gizmos in Nuke script with a group. The only exception is the Cryptomatte nodes, which will be maintained as gizmos. Copy-paste the below code into the Nuke script editor and run. import uuid import nuke def is_gizmo ( node ): '''Return True if given node is a gizmo (and not allowed gizmo type)''' allowed_gizmo_classes = ( 'Cryptomatte' ) for knob in node . knobs (): if…
A recent discussion on 3DPRO sparked me to scribble down some ideas on how to somewhat painlessly distribute a Python package to be run in DCC applications such as Maya or Nuke as simply as possible. So this is an alternative to building a wheel and mucking around with virtual environments. You can make Python import your modules or packages even when zipped. Example, where b is our package and…
The official docs on setting up an incoming webhook uses the third-party httplib2 , which is not part of the Python 3.6 standard library. Here’s a quick snippet using only the standard library instead:
A cartesian product operation can return a set of “combinations” based on given values. For example I could have the following values: a b c 1 1 1 2 2 3 I would then expect the cartesian product operation to return something like a1b1c1, a1b1c2, a1b1c3, a1b2c1 and so on… Many, many times have had to solve this problem over and over in Python… it’s time to jot down…
As outlined here , Docker for Windows requires Hyper-V. This needs to be disabled before you can run VirtualBox. # Run from elevated prompt (admin privileges) bcdedit / set hypervisorlaunchtype off And to start using Docker for Windows again, re-enable Hyper-V:
The Qt Company has released official and pip-installable PySide2 wheel snapshots! Simo posted the details today on the PySide mailing list, but in a nutshell: pip install --index-url = https://download.qt.io/snapshots/ci/pyside/5.9/latest/ pyside2 --trusted-host download.qt.io Update 2018-04-05 official docs are now also online at https://doc-snapshots.qt.io/qtforpython/
The Qt Company has yet to release official, standalone and pip-installable PySide2 wheels. However, since they made it possible to build standalone wheels successfully, I’m now building such unofficial, standalone wheels here using free CI services (thanks Travis and AppVeyor !): fredrikaverpil/pyside2-windows fredrikaverpil/pyside2-macos fredrikaverpil/pyside2-linux Update 2018-03-09 The Qt…
It’s a bit tricky to deal with dates, timezones and daylight savings when you need to store dates in e.g. a database for later reading. To me, it’s a bit perplexing that all tools required to deal with this doesn’t come with the Python standard library (meaning; batteries are not included). Instead we need to use three different modules: datetime , pytz and tzlocal where the two…
This tickles the funny bone. >>> import maya.mel as mel >>> fps = mel . eval ( 'float $fps = `currentTimeUnitToFPS`' ) >>> print ( fps ) 24.0 Let me know in the comments below if this can be improved…
A very annoying bug came to light in mid-October which makes Maya 2018 binary scene files (*.mb) unreadable if they are larger than ~2 GB in size. To be exact, the bug is hit when the file size is larger than 2147483647 bytes, the maximum positive value for a 32-bit signed binary integer. A workaround is to instead save your scenes in Maya ASCII format (*.ma), since they are not affected by this…