869 private links
I always wanted to write an article about how to write readable code. This article did it for me!
The core idea is that our brain has a small working memory. We are able to hold 4-6 things simultaneously, but no more. So to make the code more digestible, we need to abstract related things together into a bigger chunk if there are more than a handful of things to be dealt with.
Another thing the article didn't mention is that we can use symmetry to reduce the amount of memory needed. Symmetrical things require fewer places in working memory. "match cases" and "pipelining operators" are useful to construct symmetrical structures. The structures hints the brain on what to expect and we know the sub-expressions are equal in rank. This is why I am against using pipeline operator in places where there is no pipeline semantics (each step should be an endofunction).
Various bitrate control methods are suitable for different purposes. This article gives a clear description on how to use them in ffmpeg and when to use them.
Inspect mp4 box structure.
Rust Higher-Rank Trait Bound (HRTB) explained beautifully!
A short summary of the book.
A short introduction to the idea behind the LSM tree.
This trick has greatly increased the browser usability on my phone.
You may also be interested in:
- how to enforce on desktop mode: https://old.reddit.com/r/firefox/comments/p38p6t/guide_how_to_always_use_desktop_view_in_firefox/
- you can use any UA switchers, which can come in handy by providing per-domain settings
- how to force allow pinch to zoom: https://old.reddit.com/r/firefox/comments/igijal/pinch_to_zoom_broken_in_latest_firefox_android/
Explore composable geometry shapes, shaders, transformations with a lisp-like language called Janet. The rendering by compiling the code to glsl, running a raymarching engine (that why it's easy to define composite shapes).
For more (fancy) raymarching demo, check out https://iquilezles.org/articles/raymarchingdf/.
This article explains the various mix xref
usages to analyze dependency-induced slow compilation issue.
Wondered how fly.io works? Or how to use Firecracker?
The article explains how MicroVM works and how to use it via command line tools.
Emacs has a lot of little known built-in features that can cover a lot of use cases provided by packages. This article presented some of them. Really nice to learn about them.
Also read the sequel, "More batteries included with emacs" (https://karthinks.com/software/more-batteries-included-with-emacs/).
ImageOptim equivalent on Linux.
Command line version: https://rubenerd.com/losslessly-optimise-images/
Stable Diffusion is an open source text-to-image model with performance comparable to DALL-E. I'm surprised to learn that its model size is only 4.2 GiB.
Peek inside everyday electronic parts!
A bunch of quite useful tricks. Some I already used and other's are new. Here are the headings:
- Forward Yubikey Agent
- Reuse connections
- SSH straight into tmux
- Alias commonly used hosts
- Do not add testing stuff to ~/.ssh/known_hosts
- Make connections last longer
- Canonicalize hostnames
- Yubikey and GitHub, without touching it every time
I find it quite helpful to create a persistent connection to github. It greatly reduces my connection latency for pushing and pulling.
A Preprocessor Iceberg Meme on C preprocessor magic. Similar to "The Cursed Computer Iceberg Meme".
The basilisk collection (also known as the basilisk file or basilisk.txt) is a collection of over 125 million partial hash inversions of the SHA-256 cryptographic hash function. Assuming state-of-the art methods were used to compute the inversions, the entries in the collection collectively represent a proof-of-work far exceeding the computational capacity of the human race.
This is a grand work of fiction.
The author has another fiction on the concept named "Clairvoyant Computing": https://suricrasia.online/unfiction/CSC218-Software-Precognance.pdf
TCP slow start algorithm starts by sending a small amount of data, usually 10 TCP packets. A webpage of 14kB will fit in these 10 packets (MTU - len(headers)). Doing so can deliver the content to the users in one round-trip.
The zip format encrypts using AES based on the user's password as the key. If the user's password is too long for the AES key, then it uses the hashed password instead. After hashing, there is no way to distinguish whether or not the key is a hash. This means both the original password or the hash can be used as the correct password.
I don't think it's a security vulnerability. Also, technically, these zip files may have more valid passwords, because by fixing the output of a hash function, there may be many inputs that produces the same output, although you can only find them if you know how to reverse a hash function.
An article about a fundamental philosophical question: why is there anything, instead of nothing?
Following deep down the rabbit hole, we can see that nothingness is actually not that trivial. Something naturally arise easily from nothingness. Logic, math, conciousness all have their root from nothing and yet are no nothing. A quite inspiring read.