Skip to main content

This Week I've Learned - 2024-W42

Trying to restart this blog, one thing at a time. For quite some time I wanted to start publishing some smaller blobs I find interesting, but giving each and everyone a post seemed wasteful. That’s why I’ve decided to publish my weekly learnings and findings - some links, some thoughts from development, some API methods I haven’t used before. Without further ado, here it is for the first time.

This week I’ve learned:

CODING

  • Using AI to assist when writing API integration is, in my humble opinion, one of the best use cases for it. Asking Claude for help with Slack integration was almost painless and straightforward until it wasn’t. Biggest problem was with updating messages in Slack - Claude invalidly suggested using user slack id as channel name, while it should be a direct message channel. It also got confused on obtaining this channel id - it turned out it’s sufficient to parse response of first message and get the channel value.

  • I’ve been working on optimising Humadroid’s landing page to be as fast as possible (in terms of lighthouse benchmark). One of the suggestions is to use modern image file formats - ideally webp. This can be easily done via picture_tag in Rails - migration is as easy as changing image_tag to picture_tag. But then I’ve bumped into a suggestion that images should have alt tag. What was strange, as picture clearly had it. What I’ve learned is that it has to be on the <img> tag within picture and can be done by passing it differently to picture_tag - alt option should be wrapped within image. It’s not documented, but it can be found in the source: rails/actionview/lib/action_view/helpers/asset_tag_helper.rb.

  • Having that in mind I still haven’t figured out how to deal with iubenda cookie, which is lowering our score significantly by initializing during page load.

  • This post by thoughtbot - Build a (better) search form in Rails with Active Model is really good. But tiny blobs I’ve also taken from it are following methods: compact_blank, resolve_for and then - TIL.

SEO

On fiverr.com we’ve ordered backlink-building service - yes, we’ve got what we’ve ordered, but we forgot to ensure those links will match Humadroid contextually. In the end we’ve received bunch of backlinks, but from random places. Lesson learned here, we definitely need to be more cautious with that.

PRODUCT

When developing time off feature, we’ve made a bold assumption that people can take only full days off - not an hour, not a half a day, but only whole days. Well, this is gonna backfire badly, as i.e. in Switzerland there are public holidays lasting for half a day: Public holidays in Switzerland - Wikipedia