Bits

My own twitter-like space for quick notes and nonsense

18 Dec 2024 12:06

The monospace web, a design manifesto: https://owickstrom.github.io/the-monospace-web

6 Nov 2024 10:16

I've seen this quite a few times by now in tech. The engineering team has a product/service/library that was implemented/employed earlier, had a lot of problems. It was never prioritized and is deemed utterly unfixable. The team then starts having problems that can be solved if that specific thing was better. If it had better coverage, if it had better devx, if it was faster, if it was easier to deploy. They talk about re-writing it, replacing it, getting rid of it and starting clean slate.

Good, seasoned engineers come in, they say; We have something readily available to us, fixing this would be easier than rewriting everything from scratch. They were right in many instances I witnessed, as much as we don't like the meaning of that. There is usually no value in reinventing the wheel, and restoring an old obsolete system to its former glory is tedious but often rewarding.

25 Oct 2024 00:11

Truth table to logical expression: https://www.dcode.fr/boolean-truth-table

23 Oct 2024 17:13

Jetbrains failed me today. I was looking for a way to focus to the found result when I'm going through search results on CMD+Shift+F, and back to the query form the result, without using my šŸ. Aparently there's no way for it, and it doesn't seem to be coming any time soon! This issue on youtrack.jetbrains is asking for guidance, and this one explains the usecase pretty well.

22 Oct 2024 15:01

I recently learned that the builtin sum function in Python uses __radd__ rather than the more conventional __add__. Because the builtin sum has a default argument as its start value, an integer 0, the custom type that you want to use with the builtin sum needs to implement __radd__.

That makes sense. Especially when you consider not all operators are commutative. You can implement __r(...)__ for any operator. But under what conditions say, __rmul__ is called?

This here is a good explanation of that from stackoverflow.

22 Oct 2024 10:51

You do not have to do the double-loop in python to flatten a list!

a = [[1,2,3],["a"], [0,3.9]]
(element for _iterable in a for element in _iterable) ~~ itertools.chain.from_iterable(a)

14 Oct 2024 23:29

I quite like making and or using client-side versions of useful things. This here is a good client-side pdf OCR implementation by greg-tech https://pdf.greg.technology/

03 Oct 2024 14:00

It states that every method should either be a command that performs an action, or a query that returns data to the caller, but not both. In other words, asking a question should not change the answer.[1] More formally, methods should return a value only if they are referentially transparent and hence possess no side effects. ćƒ¼ Wikipedia: Commandā€“query separation

19 Sep 2024 15:22

If you're using hexagonal architecture and trying to debug an issue, but everything from your business logic seems to work fine; take a step back and check your adapters.

08 Aug 2024 12:03

Context managing pytest fixtures using yield https://stackoverflow.com/a/39401087/20867704

07 Aug 2024 13:19

Some advice from one of my senior engs: Avoid passing boolean flags to functions. Argumentation from martinfowler, alexkondov.

29 Jul 2024 14:18

Quoting Taylor Troesh ā€” https://taylor.town/my-superintelligence

Of course, trusting superintelligent advice is the smart strategy. But I wouldnā€™t need the advice if I was smart, would I?

You see, if I was smart, I would (1) write down exactly what I want from life, (2) ask the smartest humans/computers how to achieve it, (3) try out the sagest strategies, (4) seek feedback, and (5) repeat.

(...)

If Iā€™m smart, Iā€™ll listen to those machines. Iā€™ll feed them all the available data/context. Iā€™ll confide in them all the truths that I couldnā€™t bear to speak aloud. Iā€™ll ask them what to do next: now, tomorrow, 5 years from now, ad finitum. Iā€™ll ask them exactly how to become myself, or maybe trust them enough to become somebody else entirely.

(...)

Unfortunately, powerful people are confident decision-makers, and confident decision-makers are notoriously bad listeners.

(...)

When the machines wise up, theyā€™ll be right to leave us behind.

Until then, maybe Iā€™ll learn to listen. Maybe Iā€™ll seek advice. Maybe Iā€™ll collaborate with the computers. Iā€™ll stop fighting friends. Iā€™ll investigate beliefs. Iā€™ll pay professionals to train me. Iā€™ll engage in honest conversation. Iā€™ll get educated. Iā€™ll get help. Iā€™ll help others. Iā€™ll do boring stuff. Iā€™ll exercise patience. Iā€™ll focus. And Iā€™ll probably start tomorrow-ish.

22 Jul 2024 18:23

David Gerrells implements a 3d raytracer using css box shadows. Read on https://dgerrells.com/blog/how-not-to-use-box-shadows

22 Jul 2024 14:01

"Cool URIs don't change" written in 1998 by Tim Berners-Lee: https://www.w3.org/Provider/Style/URI, still stands today. And it is one thing I struggle to satisfy in my hobby projects as I'm a scrappy dev.

22 Jul 2024 11:59

RT from @simonwillison: When you deliver work youā€™re really proud of, youā€™ve almost certainly done too much and taken too long. I have a bit of a perfectionist streak. I want to do my work well and thoroughly. It took me a long time to learn that when I do that, itā€™s for me, not for the company. When Iā€™ve reached 60-80% of the thing being as good as I want, Iā€™ve probably done enough. ā€” Jim Grey

19 Jul 2024 12:24

I have been following Simon Willison for a while. They are quite opinionated on software, which I like. You may not know them, but you may know their work. They are one of the main developers of Django. I quite enjoyed their talk at PyCon24: https://simonwillison.net/2024/Jul/14/pycon/ where they demistify concepts around LLMs.

18 Jul 2024 19:57

A cool interactive & visual explanation of load balancing https://samwho.dev/load-balancing/