Skip to content

Instantly share code, notes, and snippets.

View renoirb's full-sized avatar
💭
Sitting

Renoir Boulanger renoirb

💭
Sitting
View GitHub Profile
@renoirb
renoirb / 0_RATIONALE.md
Last active October 22, 2025 16:00
Calculate and manage color contrast between text and its background color

Color Contrast

In Design Systems use, either created ad-hoc, and managed from within a web application, when we want to support flexibiilty in color management, one recurring theme is the color variation to use as the background for a given color. Tailwind CSS helps managing some of the coplexity by allowing class names, but we still end up with the same problem. A Text color might be better with a very specific level of luminosity of the background color.

@renoirb
renoirb / 0_RATIONALE.md
Created October 22, 2025 15:51
Managing NumberFormat in an abstract way with Proxies to support numbers, date, temperature, etc.

Rationale

To avoid having too many Intl.NumberFormat and Intl.<...> adjacent spreaded around the code base and considering that not all browsers supports it for sure, and that there's the possibility that the code base making assumption that asking for using a locale (e.g. fr-CA) from the code base will be handled gracefully from a browser that doesn't have the language installed.

Let's have a way to have formatting created by a predictable way. Allow flexibility to have almost complete data configuration object we can get and hints about what's missing if we use them directly as they're returned.

@renoirb
renoirb / date-tagged.mjs
Last active October 29, 2025 16:35
Small ECMAScript functions
/**
* Create an UTC date object based on an ISO yyyy-mm-dd string
*/
export const toUTC = (input) => {
const date = new Date(`${input}T00:00:00Z`);
if (Number.isNaN(date.getDate())) {
throw new Error(date);
}
return date;
// fully-introspectable-component.mjs
/**
* A component that implements the full introspection API
*/
export class FullyIntrospectableComponent extends HTMLElement {
/**
* Attributes to observe for changes
*/
static get observedAttributes() {
@renoirb
renoirb / 0_README.md
Last active April 23, 2025 14:34
Obsidian Desktop Client transpiled code and notes
@renoirb
renoirb / 0_README.md
Created April 23, 2025 14:25
Scavenging Obsidian Desktop Transpiled Code
@renoirb
renoirb / MyHeritage.md
Last active December 6, 2024 17:24
Genaology tree stuff

Extract siblings, daughters and sons

From a person's Profile page.

var siblings = {};
var family = {};
var parents = [];
    
[...document.querySelectorAll('.family_relative')].forEach(i => {
@renoirb
renoirb / 0README.md
Last active February 7, 2024 04:55
Université de Sherbrooke INF721 Théorie de Mesure

Ce qui suit a été du code qui a été écrit durant un examen et j'illustre comment j'ai pu utiliser ce qui est fourni.

Notez que j'inscrit ici (ce Gist sur GitHub aujourd'hui en Février 2024) ce qui était dans mes fichiers que je n'ai pas touché depuis plus de 2 ans (Mai 2021!).

Durant examen chapitre sur la Théorie de la Mesure

La question citait des points de données en liste que j'ai assigné dans DATA_KLOC, DATA_MOD, DATA_FD directement de l'exercice.

title source author
Lucilla’s last moments
Dune: Chapterhouse
Frank Herbert

Lucilla cautioned herself not to assume too familiar a feeling about this acidgreen room and the recurring presence of Great Honored Matre. This was junction, stronghold of the ones who sought extermination of the Rene Gesserit. This was the enemy. Day seventeen.

@renoirb
renoirb / 0_VIM.md
Last active January 30, 2024 06:58
Now that I no longer use computer full time every day. Linux, files and Vim notes, because I can't remember all commands by heart

Delete every lines containing "DS_Store"

:g/DS_Store/d

Delete every line NOT containing "DS_Store"

:v/DS_Store/d