Skip to content

Instantly share code, notes, and snippets.

View PuruVJ's full-sized avatar
๐Ÿ 
I'm just a simple man trying to quit Vim

Puru Vijay PuruVJ

๐Ÿ 
I'm just a simple man trying to quit Vim
View GitHub Profile
@PuruVJ
PuruVJ / svelte-compiler-sizes.json
Created June 8, 2024 15:07
All the svelte compiler sizes from v3 onwards, fully bundled with rollup and esbuild
{
"3.0.0": "784.72kb",
"3.0.0-alpha1": "763.83kb",
"3.0.0-alpha10": "789.48kb",
"3.0.0-alpha11": "789.48kb",
"3.0.0-alpha12": "789.48kb",
"3.0.0-alpha13": "788.25kb",
"3.0.0-alpha14": "787.04kb",
"3.0.0-alpha15": "787.04kb",
"3.0.0-alpha16": "787.03kb",
import { parse, type Literal } from 'acorn';
import { type Node } from 'estree-walker';
import { walk } from 'zimmerframe';
const ast = parse(output, {
ecmaVersion: 2022,
sourceType: 'module',
sourceFile: full_path,
});
export class EventEmitter {
#events: Map<string, Set<Function>> = new Map();
on(event: string, callback: Function): void {
let callbacks = this.#events.get(event);
if (!callbacks) {
callbacks = new Set();
this.#events.set(event, callbacks);
}
callbacks.add(callback);
import { replaceState } from '$app/navigation';
import { page } from '$app/state';
import { tick } from 'svelte';
export function box<T>(getter: () => T, setter?: (value: T) => void) {
let derived_val = $derived(getter());
$effect(() => {
setter?.($state.snapshot(derived_val) as T);
});
<script lang="ts">
import { draggable, ghost } from '@neodrag/svelte';
import { droppable } from '@neodrag/svelte/drop';
let tasks = $state([
{ id: '1', title: 'Task 1', column: 'todo' },
{ id: '2', title: 'Task 2', column: 'todo' },
{ id: '3', title: 'Task 3', column: 'done' },
]);
const createFieldProxy = (remote, path = []) =>
new Proxy({}, {
get: (target, prop) => {
if (typeof prop === 'symbol') return undefined
if (prop === 'value' || prop === 'set' || prop === 'as' || prop === 'issues') {
let remoteField = remote.fields
for (const key of path) {
remoteField = remoteField?.[key]
if (!remoteField) return undefined
did:plc:5iqboysibcto44njndtbakjl
@PuruVJ
PuruVJ / __passport__.md
Last active June 16, 2026 11:53
๐Ÿ”’ Auto-generated by Passport โ€” do not edit or delete. Proof that this GitHub account controls an AT Protocol identity.

AT Protocol Passport

This GitHub account is linked to an AT Protocol (atproto) identity. Passport generated this gist automatically to prove that link โ€” do not edit or delete it.

did=did:plc:5iqboysibcto44njndtbakjl

http://127.0.0.1:5173

@PuruVJ
PuruVJ / __passport__.md
Created June 16, 2026 12:36
๐Ÿ”’ Auto-generated by Passport โ€” do not edit or delete. Proof that this GitHub account controls an AT Protocol identity.

AT Protocol Passport

This GitHub account is linked to an AT Protocol (atproto) identity. Passport generated this gist automatically to prove that link โ€” do not edit or delete it.

did=did:plc:5iqboysibcto44njndtbakjl
nonce=passport-3e21a0f3-6f12-498a-b197-07a646b54b2a
@PuruVJ
PuruVJ / __passport__.md
Created June 16, 2026 12:53
๐Ÿ”’ Auto-generated by Passport โ€” do not edit or delete. Proof that this GitHub account controls an AT Protocol identity.

AT Protocol Passport

This GitHub account is linked to an AT Protocol (atproto) identity. Passport generated this gist automatically to prove that link โ€” do not edit or delete it.

did=did:plc:5iqboysibcto44njndtbakjl
nonce=passport-a3a6ebb9-d4f6-4cd7-88c3-7a88bda0ddbd