203 private links
Red/Blue functions allegory of async and sync functions.
The author that if one function is red, all functions using it should be red too.
This is where the “red functions can only be called by red functions” rule comes from. You have to closurify the entire callstack all the way back to main() or the event handler.
One solution could be more generators.
Another is the use of green threads.
[...] Go has eliminated the distinction between synchronous and asynchronous code.
Visualizing and understanding PostgreSQL EXPLAIN plans made easy.
There is also a dedicated section for JS https://shaarli.lyokolux.space/shaare/DhH-Zw
- Copy and Clone can diverge
- Really long place expression (if)
- krate vs crate_
- Rust has reference variables! kinda..
- &* is actually useful
HTML carry the semantic, so the bdi element indicates how to read its content: left to right or right to left.
Great website design BTW https://heydonworks.com/latest/
One approach for achieving compile-time checks, might be having two different structs for alive and dead player, and have the necessary methods implemented for them respectively.
why it’s bad:
- the API is not clean. We are storing the same fields in both Dead and Alive player, while they are both just Players.
- the end-user has to know when to create an instance of Alive player and Dead player. It might be simple to guess in this example, but imagine much more complex/abstract types. If possible, our API should be responsible for when to use which type, not the end user.
Solution 3 is better with an struct that uses a state! The state determines how is the player and different functions are implemented for a player state.
Note it is similar to typescript with an interface or type such as Player<'alive'>
of type Player<T> = { state: T, ...}
The idea is to set sensible typographic defaults for use on prose (a column of text), making particular use of the font features provided by OpenType.
Using monospace fonts to design based on the ch unit.
Background: https://wickstrom.tech/2024-09-26-how-i-built-the-monospace-web.html
A (somewhat opinionated) list of SQL tips and tricks that I've picked up over the years in my job as a data analyst.
A lot of Rust lectures lately. See https://video.infosec.exchange/w/p/aUTyZA8bp5b8EDeT8VaV6M
how to compile and run JS code in rust through V8
La nouvelle API Temporal, successeur de Date pour la manipulation de date.
An idea to put URL query parameters in the body pf the request.
It is useful to avoid the limitations of the URL length. Another use case is a custom DSL inside the request body.
At the end, it's a less readable than GET but more powerful.
How to Choose
- If the closure only reads from the environment: Use Fn.
- If the closure needs to mutate the environment: Use FnMut.
- If the closure needs to consume ownership of values from the environment: Use FnOnce.
Different definition of a UI component, from the minimalistic css one to the SSR full page.