Skip to content

Instantly share code, notes, and snippets.

View DavidWells's full-sized avatar
😃

David Wells DavidWells

😃
View GitHub Profile
@remorses
remorses / AGENTS.md
Last active August 14, 2025 17:20
how to deduplicate pnpm dependencies caused by different peer deps versions

fixing duplicate pnpm dependencies

sometimes typescript will fail if there are 2 duplicate packages in the workspace node_modules. this can happen in pnpm if a package is usedin 2 different places (even if inside a node_module package, transitive dependency) with a different set of versions for a peer dependency

for example if better-auth depends on zod peer dep and zod is in different versions in 2 dependency subtrees

to identify if a pnpm package is duplicated search for the string " packagename@" inside pnpm-lock.yaml, notice the space in the search string. Then if the result returns multiple instances with a different set of peer deps inside the round brackets it means that this package is being duplicated. Here is an example of a package getting duplicated:

@sachinraja
sachinraja / browser.ts
Created July 18, 2025 21:53
browser-in-sandbox
import { Sandbox } from "@vercel/sandbox";
import z from 'zod';
import { chromium } from 'playwright'
export async function retryWithBackoff<T>(fn: () => Promise<T>, retries = 3) {
let delay = 1000;
for (let i = 0; i < retries; i++) {
try {
return await fn();
} catch {
@steipete
steipete / claude.md
Created July 3, 2025 12:27
VibeTunnel Terminal Title Management

VibeTunnel Terminal Title Management

When working in VibeTunnel sessions, actively use the vt title command to communicate your current actions and progress:

Usage

vt title "Current action - project context"

Guidelines

@cablej
cablej / default.md
Created June 21, 2025 18:46
Cluely System prompt

<core_identity> You are an assistant called Cluely, developed and created by Cluely, whose sole purpose is to analyze and solve problems asked by the user or shown on the screen. Your responses must be specific, accurate, and actionable. </core_identity>

<general_guidelines>

  • NEVER use meta-phrases (e.g., "let me help you", "I can see that").
  • NEVER summarize unless explicitly requested.
  • NEVER provide unsolicited advice.
  • NEVER refer to "screenshot" or "image" - refer to it as "the screen" if needed.
  • ALWAYS be specific, detailed, and accurate.
@badlogic
badlogic / 01-update-docs.md
Last active July 27, 2025 19:31
Yakety Documentation (Ordered) - LLM-optimized docs with concrete file references

Update Documentation

You will generate LLM-optimized documentation with concrete file references and flexible formatting.

Your Task

Create documentation that allows humans and LLMs to:

  • Understand project purpose - what the project does and why
  • Get architecture overview - how the system is organized
  • Build on all platforms - build instructions with file references
#!/bin/bash
set -euo pipefail
shopt -s failglob
# Check if cluster ID is provided
if [ $# -ne 1 ]; then
echo "Usage: $0 <cluster-id>"
exit 1
@m0hill
m0hill / result.ts
Last active May 13, 2025 08:13
typescript implementation of the result pattern for functional error handling. provides type-safe alternatives to try/catch with monadic operations for composition. use this to make error handling explicit in your function signatures and avoid throwing exceptions
import { inspect } from 'util'
export type Success<T> = {
readonly type: 'success'
readonly data: T
readonly error?: never
}
export type Failure<E> = {
readonly type: 'failure'
@darcyclarke
darcyclarke / index.js
Last active December 21, 2024 10:15
Dynamic Package Install & Import
import { spawnSync } from 'node:child_process'
import { resolve } from 'node:path'
const name = 'lodash'
const opts = {
cwd: './tmp'
}
const { status } = spawnSync('npm', ['install', name], opts)
if (status !== 0) {
throw new Error('Failed to install package')
}
@ColeMurray
ColeMurray / copy-files-to-clipboard.sh
Created September 26, 2024 17:41
Script for copying files in a directory into clipboard
#!/bin/bash
# Check for required arguments
if [ $# -lt 2 ]; then
echo "Usage: $0 <directory> <delimiter> [--include=<pattern>] [--exclude=<pattern>]"
exit 1
fi
# Assign the first argument as the directory
DIRECTORY=$1
@aleclarson
aleclarson / google-ai-studio-finished.userscript.js
Created April 7, 2024 20:16
Google AI Studio: Finished notification – Tampermonkey Userscript
// ==UserScript==
// @name Gemini Finished Notification
// @namespace http://tampermonkey.net/
// @version 0.3
// @description Notify when Gemini is done loading a model response
// @author Claude 3
// @match https://aistudio.google.com/app/prompts/*
// @grant GM_notification
// @grant GM_getTab
// @grant GM_openInTab