Skip to content

Instantly share code, notes, and snippets.

View aakash14goplani's full-sized avatar
🎯
Focusing

Aakash Goplani aakash14goplani

🎯
Focusing
View GitHub Profile
@sdekna
sdekna / gist:beb66027a2b75af3b97942a7f2b99363
Created August 19, 2023 08:26
Alternate Svelte Store
// REPL: https://svelte.dev/repl/2c56758fb2ca4de9bf842e3dfb61ed36
function customStore<T>(initialValue: T, mutationFunction: (value: T)=>T, validationFunction: (value: T)=>boolean) {
let currentValue = initialValue
let previousValue: T | null = null;
const subscribers = new Set<(value: T, previousValue: T | null) => void>();
const set = (value: T): void => {
@magicznyleszek
magicznyleszek / css-selectors.md
Last active January 27, 2025 14:19
CSS Selectors Cheatsheet

CSS Selectors Cheatsheet

Hi! If you see an error or something is missing (like :focus-within for few years :P) please let me know ❤️

Element selectors

Element -- selects all h2 elements on the page

h2 {