Skip to content

Instantly share code, notes, and snippets.

View renoirb's full-sized avatar

Renoir Boulanger renoirb

View GitHub Profile
@renoirb
renoirb / 0_MAKEFILE_WORTHWILE_BOOKMARKS.md
Last active November 27, 2022 16:13
List of publicly available Bash & Makefile black magic I can't get to remember by heart
@renoirb
renoirb / components.ts
Created November 5, 2021 01:41
Lit.Dev with @lit-labs/context
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
renoirb / svg-loader.ts
Created September 27, 2021 22:02
Vite Lit.dev SVG loader
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
renoirb / 0README.md
Created August 16, 2021 22:40
Jenkinsfile when using RushJS.io and releasing only on CI

Example of a Jenkinsfile when publish on Nexus and use with RushJS.io

@renoirb
renoirb / 0README.md
Last active July 6, 2023 04:32
Example of a Page rendered within an application layout customElement and rendered client-side from raw markdown hosted on a GitHub Gist
@renoirb
renoirb / 0README.md
Last active July 15, 2021 01:14
DOM Coercion helpers

DOM Cœrcion utils

Utilities to drill down and manipulate back to the DOM

@renoirb
renoirb / 0README.md
Created July 15, 2021 00:33
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
renoirb / 0README_Input_Checkbox_Event.md
Last active June 10, 2021 20:54
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
renoirb / 0POOR_MAN_REACTIVITY.md
Last active June 5, 2021 01:01
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
renoirb / .gitignore
Last active April 30, 2021 21:33
WeakMap and Class private fields transpiled for different runtimes
node_modules/
dist/
package-lock.json