319 private links
Create a CA locally and use it to generate certificates. So it's perfect for local network requests (https, etc...)
About ?page=1
that can become /?page=1 OR 1=1
KISS for maintainability: "Nothing in Rust forces us to get fancy. You can write straightforward code in Rust just like in any other language. But in code reviews, I often see people trying to outsmart themselves and stumble over their own shoelaces. They use all the advanced features at their disposal without thinking much about maintainability."
Here an real life example.
But if simplicity is so obviously “better,” why isn’t it the norm? Because achieving simplicity is hard!
Even in Rust: abstractions are never zero cost for developers.
Often, simple code can be optimized by the compiler more easily and runs faster on CPUs. That’s because CPUs are optimized for basic data structures and predictable access patterns. And parallelizing work is also easier when that is the case. All of that works in our favor when our code is simple.
Most of the code you’ll write for companies will be application code, not library code. That’s because most companies don’t make money writing libraries, but business logic. There’s no need to get fancy here. Application code should be straightforward to keep your fellow developers in mind.
Tips:
- start small
- avoid optimization early
- delay refactoring: we have limited information at the time of writing our first prototype.
- write code for humans
- The right abstractions guide you to do the right thing
Similar to tailwind, but somehow better?
em unit compound when value are greater or lower than 1.
Except that, they are awesome :)
Bound checking costs 0.3%
The table is available as PDF https://dr-knz.net/programming-levels/prog-skill-matrix.pdf
How CSS handles things already.
#todo what does CSS handle?
Put an id inside the <details> body
Raw match() is fine
interpolate-size
is a way to animate height: auto
or width
. It is only supported in Chrome for now.
A quick example:
@supports (interpolate-size: allow-keywords) {
:root {
interpolate-size: allow-keywords;
}
details {
transition: height 0.5s ease;
height: 2.5rem;
&[open] {
height: auto;
overflow: clip;
}
}
}
A more generic one:
:root {
interpolate-size: allow-keywords;
}
details {
--calculated-details-padding: var(--details-padding, 1em);
transition: height var(--details-transition-speed, 150ms) linear;
height: calc(1lh + (var(--calculated-details-padding) * 2));
padding: var(--calculated-details-padding);
background: var(--details-bg, white);
color: var(--details-color, currentColor);
}
details[open] {
height: auto;
overflow: clip;
}
Native libraries are hard in Rust; the compiler offers no guarantees about the memory representation of structs; or these structs needs to be FFI-Friendly with unsafe extern "C"
. There is no sandboxing, so a malicious code could promise the machine; or corrupt the memory silently.
Finally, dynamic library plugins are distributed as compiled code.It's easier to hide backdoors in compiled code. It's also harder to share the code than simple scripts.
There are two main ways to embed JavaScript in a Rust program. The first one is with bindings for the lightweight QuickJS engine, such as rquickjs. Take a look at AWS' LLRT (Low Latency Runtime) for an advanced integration of QuickJS in Rust.
Ho, and did I mention that QuickJS is lightweight? Around 210 KiB of code vs around 40 MiB of code for V8, all while being fast enough for most situations.
My vision of programming is to limit ourselves to two programming languages. A very powerful, secure and fast compiled language for the lower levels of the computing stack, Rust, and a less powerful and slower scripting language for high-level scripting and user interfaces, JavaScript.
Another alternative is WASM. The provided code is already compiled; and the author judges the ecosystem too immature.
The last method is the less powerful: expression engine. It allows to specify a language with some rules, even if it is not turing complete and the result always evaluate to an expression.
So to rank them:
- scripting language
- expression engine
- WASM
- at the end native libraries
The language can catch subtle errors for large codebases
If the maximum font size is less than or equal to 2.5 times the minimum font size, then the text will always pass WCAG SC 1.4.4, at least on all modern browsers.
The author also cites https://utopia.fyi/type/calculator/
How to load font the most efficient way in 2025 for nearly every cases.
To keep the code maintainable, keep the css specificity as low as possible.
BEM falls short: class names can get really long; reusability might not be prioritized; and things must be named.
Another case is to use utility classes (atomic css) to avoid css specificity.
A new approach is with cascade layers.
Anyways, Cascade Layers (@layers) groups styles and declares what order the groups should be, regardless of the specificity scores of those rules.
Each has a sweet spot:
- BEM for clear design system that needs to be consistent; team with different philosophies; styles are less likely to leak between components.
- utility classes: build fast, like prototypes or MVPs and component based JS framework
- cascade layers: legacy codebases where you need full specificity control; integrate third party libraries or styles from other sources; working on a large, complex application or projects with long-term maintenance
How they can work together?
The cascade layers can be seen as an orchestrator: one layer for components (BEM); one layer for utilities (utility classes)