Weekly Shaarli

All links of one week in a single page.

Week 17 (April 24, 2023)

README - semantic-release

A tool similar to release-it

🍪💂🏻‍♂️ Évite une erreur courante grâce aux guard clauses

Basique mais efficace: le if qui vérifie que la donnée est correct

Une guard clause est un retour prématuré (ou early return) placé en haut de votre méthode, qui empêche votre code d’être exécuté si ce n'est pas nécessaire, en fonction de conditions que vous spécifiez. La plupart du temps ces conditions servent à vérifier le type de donnée reçu dans la méthode.

Another detailed article about it: https://anthonygharvey.com/guard-clauses-vs-nested-conditionals

The “const” Deception

const only ensures that the reference is not modified. The data referenced can be modified though.
Also, primitive data types are immutable. So a const a = 5 can not be updated as 5 as Number can not change.

When we use const, we create an indestructible link between a variable name and a piece of data. We're still allowed to modify the data itself though!

Open Source Guides | Learn how to launch and grow your project.
Clarifying the `satisfies` Operator | Total TypeScript

When you use satisfies, the value BEATS the type.

The value of the variables is taken into account instead of the type declared in semicolon.

Also colon annotations and satisfies are equally safe.
Also unlike satisfies and colon annotations, using ‘as’ annotations lets you lie to TypeScript.

To recap, we’ve got FOUR ways of assigning a type to a variable:

  • colon annotations
  • satisfies
  • as annotations
  • not annotating and letting TS infer it

The rule of thumb is that you should only use satisfies in two specific situations:

  • You want the EXACT type of the variable, not the WIDER type.
  • The type is complex enough that you want to make sure you didn’t mess it up
Tufte CSS

A minimalist CSS library with special work on sidenotes, figures, and epigraphs.

PostgREST Documentation — PostgREST 10.2.0 documentation

Convert a Postgres SQL database directly into an HTTP API

AI Spam Is Already Flooding the Internet and It Has an Obvious Tell

The content can be spotted online from time to time

Azimutt · Database explorer and analyzer

A great tool to generate an ERD. It can be generated from an SQL schema, a DB connection, JSON,

Building Future-Proof High-Performance Websites With Astro Islands And Headless CMS — Smashing Magazine

A case study for #Storyblok

Casse du siècle : 250 milliards passés du travail au capital, dans un silence assourdissant - L'insoumission

La comparaison vaut le détour: quelle est la part de production du travailleur par an dédié au rendement du capital?

La part revenant aux salariés a en effet chuté dans le pays. Elle était de 75% au début des années 80, elle stagne autour de 65% aujourd’hui (source : INSEE).

Dans le même temps, 157 milliard d'euros sont versés sans contrepartie aux grandes entreprises.

Voici ce qu’il se passe réellement avant et pendant une émission de “débat” - Frustration Magazine

Une critique acerbe mais qui semble, du point de vue extérieur, correspondre aux ressenties que j'ai.

leonfilser/KeePass-Icon-Pack: Collection of 50x50 px Icons for KeePass Password Manager

Tailor a project to register specific icons for KeepassXC

GPTZero

Detects if a content is written by an AI

50 Shades of Rust - HedgeDoc

A collection of rust libraries:

  • Dioxus for react-like interface architecture
  • Tauri to build desktop apps
  • Xilem is a data-first UI architecture
  • Sycamore is a reactive library for creating web apps in Rust and WebAssembly. It uses bind/signal semantics. TThere is also Perseus on top of it that adds State and template concepts.

And so much more!

Exploring The Potential Of Web Workers For Multithreading On The Web — Smashing Magazine

How to create a web worker?

  1. Create a script that imports another one with const worker = new Worker('worker.js'
  2. Bind events emitted by the worker with worker.onmessage = function(event) { ... }
  3. Do the same in the web worker with self.onmessage = function(event) { ... }
  4. Exchange messages with worker.postMessage(payload) or self.postMessage(payload)

One key difference between Web Workers and the main thread is that Web Workers have no access to the DOM or the UI. This means that they cannot directly manipulate the HTML elements on the page or interact with the user.