A tale of two artisans

Let me tell you about what alcoholics refer to as a moment of clarity I had last night.

It was Friday night and I went out to a little seafood bar with two friends. A small bar with nice food and good prices, nothing fancy.

At around 22:00 pm the place was packed, \approx 20 customers and three staff members behind the bar. We arrived early so we managed to secure a place at the end of the place with stools, which happens to be the part of the bar with the “kitchen” (just a griddle).

Working at that griddle there was a waiter. And what fascinated me was that she was able to not only run the griddle, but also take care of the orders of we customers sitting on that segment of the bar. As if her time was magically orcherstrated by an invisible process manager, she would spend some time moving the seafood when needed, then turning to check on customers to see if another “botellín” (a small 20cl beer glass bottle, IMHO the best beer serving size since it never gets warm) was required, taking new orders and moving to the POS to register them, back to the griddle, etc. I’m sure you all know this kind of people, you don’t notice them at all and that’s what make them superb at their job.

I was marveled at how good she was at her craft. And then I had that moment.

I currently work as a frontend dev at a company that runs a video AI SaaS; our typical customer is a TV channel that uploads content and our site generates a transcription, subtitles, translations, highlights, short reels for social media, etc.

Yesterday I was working on an issue to allow users to upload an image overlay (which tipically is the channel logo) and position / resize it for all our available aspect ratios (9:16, 3:4, 4:5, 1:1, 4:3, 16:9). It would then automatically generate a PNG for each ratio and upload it as a new overlay.

My backend pals are quite busy at the moment, and they had already done what management required from them: API CRUD endpoints for overlay images. Nothing more and nothing else.

So, without any proper way of creating what we would call “overlay collections”, I realized that when creating these overlays they all had the same name structure, something like Summer logo - 9:16, Summer logo - 3:4, Summer logo - 16:9, etc.

And I used that to detect this pattern in the overlay names and, in the branding form where users can select overlays for each aspect ratio, create a “X overlay collections detected” button that allows users to click on one “collection” and automagically fill all aspect ratio overlay combos with the proper overlay.

Now ok, this may not seem a big deal, but I think it is a great way to improve user experience without backend support (which of course I have requested, but may take a long time). Just by analyzing data on the frontend side.

And I felt as if that was the right thing to do at that moment for that feature. And I felt a bit like that waiter.

I felt a bit proud.

Asignar icono en la barra de tareas a una aplicación AppImage

Estoy usando Todoist como aplicación de escritorio, y aunque le había creado un fichero de configuración para el menú en ~/.local/share/applications/todoist-appimage.desktop asignando un icono no me lo estaba mostrando en la barra de tareas, mostraba un icono genérico de una rueda tipo “cog”.

La solución es añadir la clase de ventana a ese fichero .desktop. Obtenemos la clase de ventana ejecutando

xprop WM_CLASS

y pulsando sobre la aplicación abierta de Todoist. Nos devuelve dos valores:

WM_CLASS(STRING) = "todoist", "Todoist"

Nos interesa el primero. Añadimos una línea en el fichero .desktop que sea

StartupWMClass=todoist

Y ya nos mostrará el icono en la barra de tareas al abrir la aplicación.

Como referencia, este es el fichero .desktop completo:

[Desktop Entry]
Name=Todoist AppImage
Exec=/media/koas/Ext4Bucket/AppImageApps/Todoist-linux-9.26.4-x86_64-latest.App>
Type=Application
Terminal=false
MimeType=x-scheme-handler/todoist;text/html;x-scheme-handler/com.todoist;
Icon=/usr/share/icons/hicolor/512x512/apps/todoist.png
Comment=
PrefersNonDefaultGPU=false
StartupWMClass=todoist

Notas del curso de Claude Code

/init estudia el código y genera el fichero CLAUDE.md

– Se puede añadir información a la memoria con # xxx para que se incluya en el Claude.md y lo tenga en cuenta en todas las operaciones futuras.

– Para proporcionar contexto usamos @ para seleccionar ficheros relacionados con la tarea que hemos pedido.

– Pulsando Esc dos veces podemos eliminar contexto no relevante para la tarea que estamos ejecutando.

/compact nos permite vaciar la conversación pero manteniendo todo el contexto. /clear vacía la conversación y el contexto.

Problemas con xorg consumiendo mucha CPU

Estoy recolocando el ordenador en otra mesa y estoy continuamente cacharreando con los cables para ordenarlos y que estorben lo menos posible. Después de hacer uno de estos cambios vi que el teclado y el ratón iban con bastante lag y el proceso xorg estaba consumiendo muchos recursos de CPU

El problema era que el cable HDMI de uno de los monitores no estaba bien conectado, lo que hacía que se estuviera conectando / desconectando continuamente y eso era lo que provocaba el alto consumo de recursos. Después de apretarlo bien el problema desapareció.

Error de MokManager al instalar Linux Mint

Ha sido una pequeña odisea instalar Linux Mint en un portátil que ya traía Windows 11 instalado. Después de desactivar la opción Secure Boot de la BIOS y la de Fast Start en Windows al arrancar desde el lápiz USB de Linux Mint aparecía este error:

Failed to open \EFI\mmx64.efi - Not Found
Failed to load image : Not Found
Failed to start MokManager: Not Found
Something has gone seriously wrong: import_mok_state() failed: Not Found

La solución es descargar la versión más reciente de Ubuntu a un USB y arrancar desde ella. Ubuntu iniciará MokManager y nos presentará un menú donde debemos seleccionar la opción Continue boot. Tras hacer esto aparecerá el menú de GRUB de Ubuntu.

Ahora podemos apagar el equipo y volver a poner el USB de Linux Mint, y ya arrancará sin problema.

A motto for programming

Yesterday, while walking down the street, I saw some words written in Latin on a terrace: “Primum non nocere”. I looked them up on Google and found that they mean “First, do no harm”. It’s a motto for health-related professions that emphasizes their main objective: the well-being of the patient and avoiding any harm.

I liked the idea, and after doing some research, I found that there’s nothing similar for programmers. So I started thinking and came up with a possible motto for our profession: “Tuere usorem, data, veritatem”.

Tuere: protect
usorem: the user
data: the data
veritatem: the truth

The user: as programmers, our main objective should be the user, making their experience as pleasant as possible and ensuring our program makes their life easier or more comfortable. In the case of open-source code, it can also help them learn.

The data: after the user, data is the most important thing because it’s almost always irreplaceable. It’s our responsibility to do everything possible to keep it safe and accessible.

The truth: today’s technology can be used to falsify information and spread lies, and the pace of change only makes this worse. As creators of much of this technology, we have a moral commitment to the truth.

What do you think? Does it make sense? Is there already a similar slogan that I haven’t found? I’d love to hear your thoughts!

PS: I don’t know any Latin, ChatGPT did the translation for me, so there may be some mistakes.