387 private links
Folders and files to build the wiki.
concurrency with Semaphore, async and Arc data structures to retrieve as fast as possible files stored on S3
The website author is available in different format than HTMLz
The contrary of HTMLHell, a page full of tips: HTML Heaven.
Make RSS from multiple sources that does not support them.
The first game written and played entirely in Rust's type system. Not just do you play by writing Rust code, the rules of the game are enforced by the Rust compiler! If you can write the program so it compiles and doesn't panic, you win!
An experiment to add capabilities to sudo
A cross platform UI library to build to apple, android, web.
The project is available under https://github.com/water-rs/waterui
- They split the code into crates that are independent of the rust of the system.
- Start with src/main.rs or src/lib.rs to get a high level overview then go down into the things you need to understand in more detail.
- The trick to be productive in a large codebase is thus simple: focus, one step at a time.
Tips for the documentation:
Here's advice I figured out a while ago: if you'd doing something user-facing, write the documentation. When someone asks a question, point to the place in the documentation that answers it and ask if that clarifies. If they are still confused, instead of answering them, improve the documentation, and ask them if that helped. Very quickly you get to the point where the documentation is accurate even for people who don't know the answers already.
Colors:
how do we decide where to use custom properties? There are really two cases:
1) whenever we need to use the same value in more than one place (DRY)
2) when we know a value is going to be changed.
Custom Properties:
I already use the css variables methods. They are great. Note we can inline them and avoid a verbose default: var(--btn-color, var(--color-text))
You can think of :has() as a way to query an element about what’s inside it.
This makes our button class very flexible. You can throw about any combination of things inside it, and it will adjust accordingly. Text only, image and text, image only, inputs (like radio buttons), or multiple images with text.
The post of 37signals takes also the sidebar into account. The trigger button can be pure CSS even if the icon in it changes. :has() allow to verify if a button inside an element is disabled too.
Responsive design:
They use one @media breakpoint (max-width: 100ch) for a two column layout.
Using characters as the unit of measure ensures that we get the right behavior no matter which device you’re using and in a number of other scenarios such as multitasking on iPad or even if you simply enlarge the font size past a certain point. Type is the heart of web pages so it makes sense for the layout to respond to it.
Feature enhancements such as hover or touch effects with media queries: @media (any-hover: hover) in combination with (pointer: fine) or (pointer: coarse)
Great stuff and kudos to them 👏
with currently 90% support, this feature can render or hide the content (without taking space in the layout). Note the auto value can optimize the rendering
In comparison with the display: none trick, developers don't need to specify the layout display: flex | grid | block anymore.
About Oauth2
Are they useful? I think not. It might be useful, but overall, it's better to read the specifications.
Following https://dev.37signals.com/modern-css-patterns-and-techniques-in-campfire/
More thoughts about utility classes (only utilities and not a core use anymore), :has(),
What fascinated me most was watching the architecture evolve across releases.
Campfire: OKLCH colors, Custom properties for everything, character-based spacing, flat file oranization, View Transitions API
Writebook (2nd): COntainer queries for component-level responsiveness, @starting-style for entrance animations
Fizzy (3rd release): CSS Layers, color-mix() and complex :has() to replace JS.
37Signals share their product codes in Open Source. That's awesome because we can learn from it:
/* Fizzy's layer architecture */
@layer reset, base, components, modules, utilities;
@layer components {
.btn { /* Always lower specificity than utilities */ }
}
@layer utilities {
.hide { /* Always wins over components */ }
}
A CSS only spinner under 30 lines of CSS code. "Pure creativity".
A better <mark> that draws a hand-drawn circle around matched terms.
They also created dialog animations in CSS only.
How to serve typescript file?
Using a proxy mounted on a route that did a passthrough to a vite front-end app And in production we switched out that proxy for a StaticDir.
I use vite. In development vite dev server proxies requests to (axum) backend, for production vite compiles the frontend bits into a bundle that can be served by axum in a specific route. I'm sure ServeDir would work with this setup, but I actually include the bundle in my executable with a small macro which makes deployments stupid simple.
How to optimize a rust program to squeeze maximum performance and as little RAM as possible
They are CSS "cascading" variables, and they can also be custom properties with @property.
Rust compiled with LLVM is resistant against timing attack.
It requires LLVM though.
So it's not possible to verify 100% that the file is correctly written after calling close on the file handler.