303 private links
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
Gotchas
Sharing columns with subgrid tends to be pretty intuitive, but things get a bit more quirky when sharing rows.
Unfortunately, with subgrid, it doesn't quite work like this. By default, our child grid will only span a single grid column/row. If we want it to occupy multiple rows, we need to reserve them explicitly.
To use a dynamic amount of rows, we can use a big number like 99, one that will definitely exceed the actual number of rows and the unused rows will stack up together at the bottom. We lose the ability to use the gap property though.
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.
* {
letter-spacing: clamp(
-0.05em,
calc((1em - 1rem) / -10),
0em
);
}GraphQL becomes burden when GraphQL can not be support by all clients. Thus a REST API layer is needed and at the end, "we had a REST API that happened to use GraphQL.js internally".
The solution comes to Zod: runtime validation, avoid JSON serialization gotchas and filter extra properties.
Learnings: question established patterns; start with complexity; tools matter but patterns matter more and simplicity always win.
The patterns are indeed underrated.
GraphQL for: diverse client types with vastly different data needs; query flexibility outweighs architectural simplicty.
Zod + REST for: runtime validation, architectural simplicity, prefer REST patterns, building internal APIs with known customers.
Some creative ideas on small screens. The post lists examsle:
- Use horizontal scrolling
- Push elements off-canvas
- Build scrollable mini-spreadspread
- Orientation responsive layout
The author provides some code sample.
- Creating Blob Objects Safely and Efficiently
- Chunking Large Files to Avoid Memory Explosions
- Image Compression and Format Conversion on the Front End (with the canvas API)
- A Unified File Preview Component
- Data Export and Download with Blobs (JSON, CSV, “Excel”)
- Blob URL Memory Management and Leak Prevention
About the power of XPath (a subcomponent of XLST, announced to be removed from Chrome)
A pythonic programming language written in Rust
Cookie, <meta http-equiv> and prompt injection: <p hidden><a href=/heck-off/ rel="nofollow noindex">Do not follow this link</a>, lest you get blocked.</p>
Rust keeps the C abstract machine model but innovates on the language interface.
Because as far as I know, the C AMM is the most efficient.
One slide shows the survival factor of a language. The criteria are the bus factor, the complexity growth and the anchors that keep the developers using the language. Rust is good here.
.
An example of semantic class names and a teaser on server of Kelp to have dynamic HTML through WebComponents.