Skip to content

Instantly share code, notes, and snippets.

View heracek's full-sized avatar

Tomáš Horáček heracek

View GitHub Profile
@wiesson
wiesson / migrate.sh
Last active February 7, 2026 13:21
Convex deployment migration script — exports data from one deployment and imports into another with --replace-all. Handles the .env.local precedence gotcha by swapping it temporarily, uses --prod on both export/import, and includes a full migration checklist (env vars, deploy, Stripe, Vercel).
#!/usr/bin/env bash
set -euo pipefail
# ─── Convex Deployment Migration ─────────────────────────────────────────────
# Exports data from one Convex deployment and imports into another with
# --replace-all. Handles the .env.local precedence gotcha by swapping it
# temporarily, uses --prod on both export/import, and includes a full
# migration checklist (env vars, deploy).
#
# Usage:
@danialhasan
danialhasan / claude-cli-experiments.md
Created January 9, 2026 07:29
Claude CLI Print Mode Experiments - Raw data from testing claude -p flag combinations (2026-01-08)

Claude CLI Print Mode Experiments

Date: 2026-01-08
CLI Version: 2.1.2
Total Experiments: 29

Raw experiment outputs from testing various claude -p flag combinations.


@robzolkos
robzolkos / interview.md
Created December 28, 2025 20:39
Claude Code Interview command by Thariq
description argument-hint model
Interview me about the plan
plan
opus

Read this plan file $1 and interview me in detail using the AskUserQuestionTool about literally anything: technical implementation, UI & UX, concerns, tradeoffs, etc. but make sure the questions are not obvious.

@alavkx
alavkx / migration-guide.md
Last active September 12, 2025 17:15
@tanstack/query --> @tanstack/db React Migration Guide

Migration Guide: React Query → TanStack DB

Migration Pattern

Replace React Query's server state management with TanStack DB's client-side database.

BEFORE: React Query

// api/posts.ts
export const postsApi = {
  getAll: async (): Promise<Post[]> => fetch('/api/posts').then(r => r.json()),
@t3dotgg
t3dotgg / try-catch.ts
Last active March 10, 2026 03:34
Theo's preferred way of handling try/catch in TypeScript
// Types for the result object with discriminated union
type Success<T> = {
data: T;
error: null;
};
type Failure<E> = {
data: null;
error: E;
};
@faustinoaq
faustinoaq / myAngular.html
Last active January 17, 2026 17:44
Front-end libraries (React, Vue, Angular) and the basic principles of how they work, all in a single file using pure JavaScript (VanillaJS).
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>My Angular from Scratch</title>
<style>
.my-component {
font-family: Arial, sans-serif;
#!/usr/bin/env bash
# Abort sign off on any error
set -e
# Start the benchmark timer
SECONDS=0
# Repository introspection
OWNER=$(gh repo view --json owner --jq .owner.login)
@xfournet
xfournet / pluginHttp2Proxy.ts
Last active June 27, 2025 21:38
Vite support for HTTP2 and proxy
import proxy from 'http2-proxy';
import type { Plugin, ProxyOptions } from 'vite';
export const pluginHttp2Proxy = (): Plugin => {
let routes: Record<string, string | ProxyOptions>;
return {
name: 'vite-plugin-http2-proxy',
config: (config) => {
const { server } = config;
routes = server?.proxy ?? {};
@gaearon
gaearon / 00-README-NEXT-SPA.md
Last active January 29, 2026 09:20
Next.js SPA example with dynamic client-only routing and static hosting

Next.js client-only SPA example

Made this example to show how to use Next.js router for a 100% SPA (no JS server) app.

You use Next.js router like normally, but don't define getStaticProps and such. Instead you do client-only fetching with swr, react-query, or similar methods.

You can generate HTML fallback for the page if there's something meaningful to show before you "know" the params. (Remember, HTML is static, so it can't respond to dynamic query. But it can be different per route.)

Don't like Next? Here's how to do the same in Gatsby.

@talkingmoose
talkingmoose / Download and Install Microsoft product.zsh
Last active January 21, 2026 04:19
Downloads and installs the latest available Microsoft product specified directly on the client. This avoids having to manually download and store an up-to-date installer on a distribution server every month.
#!/bin/zsh
:<<'ABOUT_THIS_SCRIPT'
-----------------------------------------------------------------------
Written by:William Smith
Partner Program Manager
Jamf
bill@talkingmoose.net
https://gist.github.com/b6637160b65b751824943ede022daa17