Skip to content

Instantly share code, notes, and snippets.

View KyleFontenot's full-sized avatar

KyleFontenot KyleFontenot

View GitHub Profile
@KyleFontenot
KyleFontenot / pageParamStore.ts
Created October 26, 2023 16:00
Svelte page param store
import { writable } from 'svelte/store';
import { onMount } from "svelte";
export default function paramStore(initial: any, key: string) {
const pageParamStore = writable(initial);
const {subscribe, set, update} = pageParamStore
onMount(() => {
pageParamStore.subscribe((input) => {
const url = new URL(window.location.toString());
@KyleFontenot
KyleFontenot / delayed.js
Last active February 4, 2023 17:22
Easy delayed action JS
let timer;
let timeout;
let interval;
// Could expand the delay to include time unit strings like '1m' or '2s' instead of just milliseconds
// interface delayedInputProps {
// callback: () => void;
// delay: number;
// steps?: number;
// }
@KyleFontenot
KyleFontenot / init.vim
Last active June 1, 2022 16:33
My Nvim configuration
"
"
" ,---,.
" ,' .' \ ,--,
",---.' .' | ,---. ,--.'| ,---,
"| | |: | ' ,'\ ,----._,. ,----._,. | |, ,-+-. / |
": : : / / / | / / ' / / / ' / `--'_ ,--.'|' |
": | ; . ; ,. : | : | | : | ,' ,'| | | ,"' |
"| : \ ' | |: : | | .\ . | | .\ . ' | | | | / | |
"| | . | ' | .; : . ; '; | . ; '; | | | : | | | | |