Skip to content

Instantly share code, notes, and snippets.

View ClumsyPenguin's full-sized avatar
🏠
Working from home

Seppe_Geerinckx ClumsyPenguin

🏠
Working from home
View GitHub Profile
@karenpayneoregon
karenpayneoregon / debugHelper.js
Created August 19, 2023 19:38
CSS debugging toggle
var $debugHelper = $debugHelper || {};
$debugHelper = function () {
var href = "lib/debugger.css";
var addCss = function () {
if (styleStyleIsLoaded(href) === true) {
return;
}
const head = document.head;
const link = document.createElement("link");
link.type = "text/css";
@ClickerMonkey
ClickerMonkey / types.ts
Last active February 6, 2024 07:21
Typescript Helper Types
// when T is any|unknown, Y is returned, otherwise N
type IsAnyUnknown<T, Y, N> = unknown extends T ? Y : N;
// when T is never, Y is returned, otherwise N
type IsNever<T, Y = true, N = false> = [T] extends [never] ? Y : N;
// when T is a tuple, Y is returned, otherwise N
// valid tuples = [string], [string, boolean],
// invalid tuples = [], string[], (string | number)[]