222 private links
Display train/bus stops on a Kindle 😄
The author goes really in-depth 👍
1.
In HTML5,
content “must be quoted from another source”Heydon rightly makes the distinction between block quotes, which (supposedly) quote another source, and pull-quotes, which highlight excerpts from the article you’re reading.
- No
<cite>
in<blockquote>
Heydon suggests using a
<figure>
and<figcaption>
to invoke this grouping, which seems the most sensible option.The
<blockquote>
cite attribute is generally useless since it’s invisible and most screen readers also ignore it
For inline (or “text-level”) quotations, there is
<q>
instead.HTML is hard
But the developers have no consequences on that.
Similar to https://shaarli.lyokolux.space/shaare/xwiTHQ
Bit operators are the fastest, then static array, then dynamic arrays.
Objects are heavy in comparison.
PRAGMA journal_mode = WAL;
PRAGMA synchronous = NORMAL;
PRAGMA busy_timeout = 5000;
PRAGMA cache_size = -20000;
PRAGMA foreign_keys = ON;
PRAGMA auto_vacuum = INCREMENTAL;
PRAGMA temp_store = MEMORY;
PRAGMA mmap_size = 2147483648;
PRAGMA page_size = 8192;
TL;DR use fluid typography and now uses fluid sizes :)
Hashsets < Dynamic Array < Statis Array < Bit Mask
An experiment to replace Nginx with Axum.
HTML isn’t only for people working in the tech field. It’s for anybody, the way documents are for anybody. HTML is just another type of document. A very special one—the one the web is built on.
Resources and more about HTML for People: https://htmlforpeople.com/achievement-unlocked-hypertexter/#resources-from-this-book
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.