326 private links
Attribute creep and excessive use of foreign keys shows me is that in order to use ORMs effectively, you still need to know SQL. My contention with ORMs is that, if you need to know SQL, just use SQL since it prevents the need to know how non-SQL gets translated to SQL.
I’ve found myself thinking about the database as just another data type that has an API: the queries. The queries return values of some type, which are represented as some object in the program. By moving away from thinking of the objects in my application as something to be stored in a database (the raison d’être for ORMs) and instead thinking of the database as a (large and complex) data type, I’ve found working with a database from an application to be much simpler. And wondering why I didn’t see it earlier.
A utility for running arbitrary commands when files change. Uses kqueue(2) or inotify(7) to avoid polling. entr was written to facilitate rapid feedback on the command line.
headingoffset is a new HTML attribute to increase the upcoming heading levels. It's definitely not there yet https://caniuse.com/?search=headingoffset
How can I style an H3 when there's no H3 tag?
With the selector :heading(3).
But be aware of the browser support: inexistant (https://caniuse.com/mdn-css_selectors_heading)
In this post, I’ll walk through a set of common misconceptions that drive teams to introduce new infrastructure when they don’t need to. All of these can be solved with vanilla PostgreSQL 18 using standard extensions available on RDS, with no special infrastructure and no distributed-systems cosplay.
TL;DR
Use shortand when it's obvious (padding-block and padding-inline have a great padding shorthand);
When each value is a distinct type (an animation for example)
When the syntax has its own rules until it stops carrying its weight (background)
That's a way
Note: In SQLite rowid tables are implemented as B+-Trees where all content is stored in the leaves of the tree, whereas WITHOUT ROWID tables are implemented using ordinary B-Trees with content stored on both leaves and intermediate nodes.
UUIDs take 5 to 16x times slower to insert. UUID without row id in SQLite are only 2 to 3 times slower.
Not random insertion is also useful to write in a database efficiently.
- choose fonts wisely
- optimize the font display:
body { text-rendering: optimizeLegibility; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; } - golden ratio for line-height
- keep the amount of characters per line to 90
- prefer SVG and WEBP formats
A guide to display: grid-lanes
instead of letting the call stack implicitly control what happens next (as recursion does), store the pending work in an explicit data structure such as a stack, queue, or heap. This turns control flow into ordinary data that can be inspected, paused, modified, or resumed.
Explicit stacks makes interruptions, limits, cancellation or interleaving work easier to work with. It's more adaptable to real-world constraints and test.
A stack (LIFO) produces depth-first search behavior.
A queue (FIFO) produces breadth-first search behavior.
- giving every integer a shared helper method: define a trait with two required methods and one default method,
- Making class AnimatedServo still count as a Servo: require a trait in another trait
- adding a method to a type you don't own: implement a new trait for the primitive type
- giving a tiny Enum a full set of standard behaviors: the standard traits already exist and
derive - making a wrapper feel like the thing inside it: the wrapper can implement the thing and implement
DerefandDerefMut - adding union to any collection of range sets: mock a wrapper around a BTreeSet for example
- treating fifteen integer-link types the same way: to avoid writing the same method bodies 15 times, write a
macro_rules - Giving Only OutputArray<8> (8 bits) a Byte-Oriented Method: implement a general methods in the general impl block. It's named Constraint-Gated Methods.
- How would you make some methods available only when the method’s type parameter has the required capabilities? Use
serdeandpostcardwith aHashMapstanding in for flash memory.
I learned the content property has an alt (similar to images) if needed.
The snippet:
[href^="http"]:not(.btn, :has(svg)):not([href^="https://gomakethings.com"], [href^="http://localhost"])::after {
background-color: currentColor;
content: "" / "(external link)";
display: inline-block;
mask: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" fill="currentColor" viewBox="0 0 16 16"><path fill-rule="evenodd" d="M8.636 3.5a.5.5 0 0 0-.5-.5H1.5A1.5 1.5 0 0 0 0 4.5v10A1.5 1.5 0 0 0 1.5 16h10a1.5 1.5 0 0 0 1.5-1.5V7.864a.5.5 0 0 0-1 0V14.5a.5.5 0 0 1-.5.5h-10a.5.5 0 0 1-.5-.5v-10a.5.5 0 0 1 .5-.5h6.636a.5.5 0 0 0 .5-.5"/><path fill-rule="evenodd" d="M16 .5a.5.5 0 0 0-.5-.5h-5a.5.5 0 0 0 0 1h3.793L6.146 9.146a.5.5 0 1 0 .708.708L15 1.707V5.5a.5.5 0 0 0 1 0z"/></svg>');
mask-size: cover;
}There is an @page to set the property of a page. There is also rules to break the page at desired.
The navigation can be hidden.
Links and <abbr> content must be placed in the view with content: attr(href).
Check the forms.
It can be worth checking for a black and white version while printing it.
safe-area-insert is useful to provide some padding to avoid cameras and virtual buttons. This is not needed because the browser handles it for you already.
It's still needed for elements with position: absolute or position: fixed
Browsers by default will prevent your site from being obscured by the notch or home indicator, so your content will be safe without any special handling.
Ideally we want the content to stretch edge-to-edge, but we want to make sure they're not obscured by system UI. To get that, you need to opt in to the full viewport and handle safe areas yourself.
Maybe useful for later, but I see some advantages.
wcag2(aa) seems to be a good and self explanatory function.
It has limitations though:
- it doesn't guarantee perceptual or AAA compliance
- transition snaps because
contrast-colorreturns a discrete value and - tie goes to white
- gradients and images are out
- transparent colors are composited first
- windows high contrast mode takes over. It is defined in https://www.w3.org/TR/css-color-adjust-1/#forced-colors-mode
The generated colors can be combined with other color functions.
I am still concerned more and more computation will be put on simple webpages.
You might think that the JS version is slower [than CSS, but it's not for the right reason]
But there’s one significant difference: the JavaScript version runs on the main thread, along with everything else happening in our application. CSS transitions and keyframe animations run on a separate thread, so they aren’t disrupted when stuff happens in JavaScript.
Motion can create more smooth APIs but GSAP is more powerful.