Skip to content

Instantly share code, notes, and snippets.

View nickyonge's full-sized avatar
♥️
🦆

Nick Yonge nickyonge

♥️
🦆
View GitHub Profile
@nickyonge
nickyonge / recolorer.js
Last active March 13, 2026 00:35
JS script that fuzzy recolors images based on target color. WIP
// @ts-check
// gist: https://gist.github.com/nickyonge/1988b42e7a30b5019c47125a0009bd81
// current major issue is that color replcaement doesn't work, see RecolorImage func
import {
clampGamut,
converter,
differenceCiede2000
@nickyonge
nickyonge / decapCharWidget.js
Last active April 4, 2026 06:30
A custom Decap widget like "string", that only allows a single character
/** DECAP CHAR WIDGET
*
* A custom Decap widget like "string", that only allows a single character
*
* INSTALLATION
*
* 1.) Drop/load this script the directory with Decap's index.html, and add:
<script src="decapServerWarning.js"></script>
@nickyonge
nickyonge / textFitter.js
Last active March 16, 2026 06:20
JS script that matches an element's text to fill the inline width of its containing element
/** TEXT FITTER
*
* A script that automatically matches an element's text
* to perfectly fill the inline width of its containing element.
*
* (At least, perfectly to the glyph level. If a glyph has a lot
* of leading or trailing space, that space will still be respected)
*
* Presented as-is under The Unlicense, see below for license info.
*/
@nickyonge
nickyonge / inputHandler.js
Last active March 24, 2026 04:18
Input handler that unifies element input states (hover, active, focus, etc) into callbacks and attributes, built with 100% vanilla JS [WIP]
/** INPUT HANDLER
*
* A script that Input handler that unifies element input states
* (hover, active, focus, etc) into callbacks and attributes.
* Built with 100% vanilla JS
*
* Presented as-is under The Unlicense, see below for license info.
*/
// @ts-check
@nickyonge
nickyonge / VSCode find regexes
Created April 10, 2026 01:12
just some handy dandy regexeroonis for vscode find / find+replace
REGEX TO REPLACE ALL hyphen-split-text with camelCaseText (eg CSS to JS)
find:
-([a-z])
replace:
\u$1
REGEX TO REPLACE ALL camelCaseText with hyphen-split-text with (eg JS to CSS)
find WITH [Aa] case-sensitivity enabled:
([a-z0-9])([A-Z])
replace: