Sometimes, I solve programming problems by coding on paper. A few days ago, it looked like this:

I've started working on a code editor that is a mix of a text editor and a structured editor. It is all text, but parsers and pretty printers allow you to work with a tree structure and not think too much about syntax. It is a work in progress. Code is here.

We got some more snow. I like running in the winter. Especially when there is snow and the sun is shining.

I needed to submit some heic photos to a service that only accepted jpg. I didn't know about the heic format, but a little searching gave me a solution:
bash
$ heif-convert
bash: heif-convert: command not found...
Install package 'libheif' to provide command 'heif-convert'? [N/y] y
...
$ find . -iname '*.heic' -exec heif-convert -q 100 {} {}.jpg \;
Today was the first day of snow this season. Not much. I'm looking forward to many more runs on a white trail.

I was researching how to run Black (and possibly other formatters) from Vim and found Ergonomic mappings for code formatting in Vim. It was very helpful.
How would you improve this code?
python
def update_r_users(service)
r_users = []
for user in service.get_all_users():
if "r" in user:
r_users.append(user)
service.set_users_in_group("users_with_r_in_name", r_users)
Find out what I did it in my latest newsletter.
Today I learned about the Rison data serialization format. I wrote a function to convert a Python value to Rison format. It was an elegant recursive function with partial support for the format.
I've used testing without mocks quite extensively now. I've also used it in a work project for more than a year. My experience is that it's the best testing strategy that I've ever used. I've never felt more confident that my code works. I refactor code without fear of it breaking. It's so good.
What is Rickard working on and thinking about right now?
Every month I write a newsletter about just that. You will get updates about my current projects and thoughts about programming, and also get a chance to hit reply and interact with me. Subscribe to it below.