Skip to content

Instantly share code, notes, and snippets.


Renoir Boulanger renoirb

View GitHub Profile
renoirb / components.ts
Created Nov 5, 2021
Lit.Dev with @lit-labs/context
View components.ts
import { LitElement, html, TemplateResult } from 'lit'
import { property } from 'lit/decorators/property.js'
import { state } from 'lit/decorators/state.js'
import { assert } from '@esm-bundle/chai'
import { ContextProvider, createContext } from '../context.js'
import { ContextConsumer } from '../lib/controllers/context-consumer.js'
renoirb / svg-loader.ts
Created Sep 27, 2021
Vite SVG loader
View svg-loader.ts
import { html } from 'lit'
import { unsafeSVG } from 'lit/directives/unsafe-svg.js'
import { dirname } from 'path'
import { readFile } from 'fs/promises'
import { Plugin } from 'vite'
import { URL } from 'url' // in Browser, the URL in native accessible on window
export const svgLoader = (): Plugin => {
const svgRegex = /\.svg(\?(raw|url|component))?$/
renoirb /
Created Aug 16, 2021
Jenkinsfile when using and releasing only on CI

Example of a Jenkinsfile when publish on Nexus and use with

renoirb /
Last active Aug 25, 2021
Context API WebComponent state communication protocol prototype w/
renoirb /
Last active Jul 15, 2021
DOM Coercion helpers

DOM Cœrcion utils

Utilities to drill down and manipulate back to the DOM

renoirb /
Created Jul 15, 2021
Stateful purgatory

Stateful purgatory

Keep track of strings or numbers, and tell me whenever they are no longer needed.

Make something we want to keep track of to be self-purging. i.e. keep track of keys, by telling you've used them, if after a time isn't used, fill a list

Based on debounce-with-map.

renoirb /
Last active Jun 10, 2021
Input and button clicking event without framework

Input type checkbox activated by button

This is common pattern, a "prettier" button showing a checkbox when checked

renoirb /
Last active Jun 5, 2021
Poor man's "reactivity" state mutation management

Poor man's "reactivity" state manager

Instead of using RxJS we could have a state manager that knows how to handle all state transitions.

renoirb / .gitignore
Last active Apr 30, 2021
WeakMap and Class private fields transpiled for different runtimes
View .gitignore