Snippets

Theme-aware code snippets highlighted at build time. Copy any snippet to your clipboard with one click.

Debounce a function
typescript
export function debounce<T extends (...args: unknown[]) => void>(
	fn: T,
	delay: number,
): (...args: Parameters<T>) => void {
	let timer: ReturnType<typeof setTimeout> | undefined;
	return (...args: Parameters<T>) => {
		clearTimeout(timer);
		timer = setTimeout(() => fn(...args), delay);
	};
}
Svelte 5 counter
svelte
<script lang="ts">
	let count = $state(0);
</script>

<button onclick={() => count++}>
	Clicked {count} times
</button>
Build and start (adapter-node)
shell
#!/usr/bin/env bash
# Install deps and run production build
npm ci
npm run build
PORT=3000 node build

© 2026 Startino — testing sandbox.

SvelteKit + Tailwind v4 + shadcn-svelte GitHub