298 private links
A great tool to generate an ERD. It can be generated from an SQL schema, a DB connection, JSON,
Detects if a content is written by an AI
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!
A case study for #Storyblok
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!
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.
How to create a web worker?
- Create a script that imports another one with
const worker = new Worker('worker.js' - Bind events emitted by the worker with
worker.onmessage = function(event) { ... } - Do the same in the web worker with
self.onmessage = function(event) { ... } - Exchange messages with
worker.postMessage(payload)orself.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.
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
satisfiesasannotations- 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
The project does not seem to be maintained anymore though :/
An image map is a normal image on a website which has different clickable regions which take you to different pages. Image map functionality allowed polygons of an image to be defined as independent hyperlinks.
<!-- References an image map -->
<img src="image.png" usemap="#map1" />
<map id="map1" name="Map 1">
<!-- An example of a rectangular area over an image -->
<area shape="rect" coords="10,10,100,100"
href="/foo"
alt="Go to the Foo page"/>
<!-- An example of a circular area over an image -->
<area shape="circle" coords="50,50,200"
href="/bar"
alt="Go to the Bar page"/>
<!-- An example of an arbitrary polygon over an image -->
<area shape="poly" coords="10,10,100,10,100,100,10,100"
href="/baz"
alt="Go to the Baz page"/>
<!-- Fallback if no other area matches -->
<area shape="default"
href="/default"
alt="Go to the Default page"/>
</map>Some generative art in black and white. It generates fancy images :D
How to recognize a state machine pattern?
- a
stateorstatusboolean flag - boolean fields such as
publishedorpaid. Also timestamps that can have aNULLvalue likepublished_at - a record that is valid for a given period in time
Then the transition history has to be kept. At some point the transition history will be an invaluable source of information. The simplest way to keep track of the transitions is to add a timestamp field for every possible state. However, it is often possible to revisit the same state multiple times. In that case, simply adding fields to your model won’t do the trick because you will be overwriting them. Instead, add a log table in which all the state transitions will be logged. Fields that you probably want to include are the timestamp, the old state, the new state, and the event that caused the transition.
Instead of removing an object, add an error state for any reason you would have wanted to delete a record. A spam account? Don’t delete it, set it to the spam state. A fraudulent order? Don’t delete it, set it to the fraud state.
Why?
-
We don't need one until we do
- you almost never create an object fully formed with all the behavior it is ever going to need
- when it is complex enough, it costs too much time to replace it with something that has equivalent functionality
-
the state machine is a fluffy bunny
- there is the belief that state machines are more complex than they actually are
- it is therefore nothing but pragmatism that makes us consider a “full-blown” state machine overkill.
BUT most state machines you’re likely to need in your day-to-day development have nothing in common with their computing theory counterparts
- Adding a state machine library has a learning curve. It is rather small.
So moving to a state machine:
- Integration is painless but moving all the code around to be inline with state machine is a big pain
- Using it from the start is a breeze, as such as future changes.
- We’re now able to easily introduce more states to give our users extra information as well as allow us to track things to a finer grain.
- Return values from state transitions are 100% consistent. There are no strange objects, arrays, nil, boolean depending of the developers.
- It is easy to log
- Refactoring lead to greater code quality with state machines
We seem to shy away from state machines due to misunderstanding of their complexity and/or an inability to quantify the benefits
Cette nouvelle décision à rebours de la précédente rappelle que la permanence des contenus tant décriée sur le web repose sur la volonté des grandes plateformes. Or, aucune loi ne leur impose de conserver les données stockées sur le web, qui constituent aussi une partie de notre culture collective.
Les grandes plateformes ne durent qu'un temps. Les données qu'elles possèdent disparaissent toujours car ce sont des systèmes fermées. Voilà un autre example.
Another conversational assistant
Selon une étude inédite de l’Insee, réalisée sur 16 années, l’échelle des revenus des Français évolue très peu. Ce qui signifie que les plus riches le restent très souvent, et que les moins aisés ont peu de chances de changer de catégorie.
Voilà
À la place de "genre", dîtes
- environ
- au bas mot
- en d'autres termes
- par exemple
- approximativement
À la place de "du coup", dîtes
- de ce fait
- en conséquence
- subséquemment
- dès lors
- donc
À la place de "en mode", dîtes
- comme
- à la manière de
- de façon
À la place de "en vrai", dîtes
- en réalité
- réellement
- véritablement
- à vrai dire
- franchement
- concrètement
À la place de "en fait", dîtes
- réellement
- contrairement aux apparences
- en effet
- en toute honnêteté
- finalement
Un idée de Bluetouff sur les prochaines actions de Twitter après l'ouverture du code
Terminé le modèle publicitaire dont tous les bagdes bleus qui chouinent nous alimentaient depuis des années. Vous ne voulez pas de pub, vous payez.