Skip to content

Instantly share code, notes, and snippets.

@tusharsnx
tusharsnx / setup.sh
Last active July 29, 2025 05:47
VSCode git worktree issue repro
set -e
mkdir worktree-repro
cd worktree-repro
# Initialize bare repo inside `.bare`
git --bare init .bare
# Create a .git file to help `git` access the actual .git dir (= .bare)
echo 'gitdir: ./.bare' > .git
@tusharsnx
tusharsnx / component.tsx
Created August 18, 2025 15:02
An alternative suspense boundary which hides the components from DOM while they are loading
import { useEffect, useState } from "react";
import { useActivateLoaderBoundary } from "#/components/suspense-activity";
export function useResource<T>({
load,
unload,
}: {
load: () => Promise<T> | T;
unload?: () => Promise<void> | void;
}) {