403 private links
Another post about semantic HTML, or the UX of HTML with <button>
A way to document a web component (an element manifest per web component).
If JS fails to load, a keyframe remove the effect provided by JS in 2 seconds.
The return value is unclear:
- The old API treats zero as false (parameter not handled)
- The new API expects an error code (zero is success).
- To add some fun, any non-zero result is passed to ERR_PTR() and used as a pointer for further parsing. Well, (char*)1 is neither IS_ERR_OR_NULL() nor a valid pointer…
:root {
--w: calc(100vw/1px); /* screen width */
--h: calc(100vh/1px); /* screen height */
/* The result is an integer without a unit! */
}
A version with better support:
:root {
--w: calc(100vw/1px); /* screen width */
--h: calc(100vh/1px); /* screen height */
/* The result is an integer without a unit! */
}Wrapping every string to a newtype ensure the string can be extended as wished and at least differenciated from normal strings without meaning
::selection ans ::backdrop does not inherit from root. So :root does not guarantee the CSS variable. The html selector does not solve this.
There is currently no global context in CSS, but root is the best workaround currently.
This is going to catch a lot of people off-guard because I, like many others, expect CSS Custom properties defined on :root to just be available everywhere.
The following discussion is there https://github.com/w3c/csswg-drafts/issues/6641
To prevent a custom behavior on Safari Mobile
Another well written guide for Zod.
These four ways are footguns, but they can be easily spotted in the codebase.
But over time, I think I discovered a better way: a script in my $PATH.
Benefits of scripts over aliases:
- No reloading; changes are picked up immediatly
- Choice of programming language
- Complex logic can be implemented
- More portable between shells
Aliases have certain benefits:
- special syntax (
cd..forcd ..with space) - completion
- conditional definition
- easier to bypass with
unalias - brevity: it's a one liner
- performance: alias are 100x faster.
getsong make sense and so many useful scripts.
- copy and pasta
- mkcd
- tempe
- trash
- mksh
- serveit starts a static file server
- getsong
- getpod to download something from a podcast player
- getsubs
- wifi off, wifi on and wifi toggle
url "my_url"parses a URL into its parts.- markdownquote to add
>before every line u+ 2025to get the unicode caracter associated- snippets to run some snippets
- some REPL launchers for Clojure, Deno, Php, Python and SQLite
- hoy prints the current date in ISO format
- timer
ocrto extract text from an imageremoveexifto delete EXIF data from imagesemojifuzzy finder helper https://codeberg.org/EvanHahn/dotfiles/src/commit/843b9ee13d949d346a4a73ccee2a99351aed285b/home/bin/bin/emoji
and more Process management scripts
The heap is a performance killer in Rust. One woraround is to swap to a more efficient memory allocator such as jemalloc.
In Cargo.toml:
[dependencies]
mimalloc = "0.1"
In main.rs:
#[global_allocator]
static GLOBAL: mimalloc::MiMalloc = mimalloc::MiMalloc;
The best performance optimisation is to avoid the heap. There is the heapless create for that. "The only thing to know is that the size of heapless types and collections needs to be known at compile-time."
Lifetime annotations are needed to tell the compiler that we are manipulating some kind of long-lived reference and let it assert that we are not going to screw ourselves
The only downside is that smart pointers, in Rust, are a little bit verbose (but still way less ugly than lifetime annotations). [They add some runtime overhead.]
When to use lifetimes annotations?
When performance really matters or when your code will be used in no_std environments.
I don't know. It seems to be overkill for the use. Instead of words, some functions get a capital letter.
It is currently experimental, but could be amazing because it parse a string of HTML safely and then insert it into the DOM
It uses GSAP
For MacOS only
-webkit-font-smoothing: antialiased;