Skip to content

Instantly share code, notes, and snippets.

@remorses
remorses / changes.patch
Created November 26, 2025 20:37
Patch of current changes vs origin/main
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index ab53460..1265510 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -100,6 +100,11 @@ jobs:
node-version: "24"
registry-url: "https://registry.npmjs.org"
+ - name: Setup Bun
+ uses: oven-sh/setup-bun@v1
@remorses
remorses / drift.txt
Last active November 23, 2025 14:24
Cartesia websocket speech to text timestamps drift
Audio Stats:
- Sample Rate: 16000 Hz (Fixed)
- Duration: 192.783 s
- Samples: 3084534
[1/3] Running Batch API (Reference)...
stdout | website/src/lib/cartesia-stt.test.ts > Cartesia STT Timestamp Debugging > compares Batch API vs WebSocket API timestamps
Batch finished. Found 439 words.
@remorses
remorses / gemini-antigravity-browser-tools.yaml
Created November 18, 2025 21:57
Google Antigravity browser tools (browser subagent)
$schema: "http://json-schema.org/draft-07/schema#"
title: BrowserSubagentTools
type: object
properties:
capture_browser_screenshot:
type: object
description: >-
Capture a screenshot of the current viewport or specific element by index
of a browser page that is already open in Jetski Browser. This can be
used to understand the state of the page or to create a visual artifact
@remorses
remorses / zed-split-diff.jsonc
Created October 11, 2025 22:01
Add support for split diff view and word highlights to Zed
// ~/.config/zed/tasks.json
[
{
"label": "Critique",
"command": "bunx critique --watch",
"shell": {
"program": "sh"
},
"hide": "on_success",
@remorses
remorses / plan-to-build.ts
Created October 2, 2025 08:50
Opencode plugin to automatically implement GPT-5 agent plan with Opus build agent
// GPT-5 is very good at exploring a code base and creating plans but very bad at actually writing readable code
// Sonnet and Opus are the opposite: very bad at architecture but good at implementing readable and nice code
// this plugin automatically implements plan agent messages using Opus so that you can always use GPT5 Codex in plan mode and have Opus implement the plan autoamtically
import type { Plugin } from "@opencode-ai/plugin";
export const PlanToBuildPlugin: Plugin = async ({ client }) => {
const sessionsWithErrors = new Set<string>();
const processedSessions = new Set<string>();
@remorses
remorses / websearch.ts
Created September 19, 2025 11:45
Google web search for opencode
import { tool } from "@opencode-ai/plugin";
import { createGoogleGenerativeAI } from "@ai-sdk/google";
import { generateText } from "ai";
const google = createGoogleGenerativeAI({
apiKey: process.env.GEMINI_API_KEY!,
});
export default tool({
@remorses
remorses / ffmpeg.ts
Last active August 26, 2025 11:53
ffmpeg concatenating audio clips the good way. no frozen frames, no gaps
interface InputFile {
path: string
start?: number // Start time for trimming (in seconds)
end?: number // End time for trimming (in seconds)
fadeIn?: number // Fade in duration in seconds
fadeOut?: number // Fade out duration in seconds
}
interface ConcatenateOptions {
@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:

@remorses
remorses / .pnpmfile.cjs
Created February 5, 2025 18:59
How to prevent duplicate packages in pnpm
let enforceSingleVersion = [
'react-hot-toast', //
'react',
// '@types/react',
'react-dom',
'next-auth',
'next',
// 'date-fns',
// 'styled-jsx',
'next-themes',
@remorses
remorses / ink.tsx
Created December 29, 2024 11:58
scrolling with ink
import { useEffect, useState } from 'react';
import React from 'react';
import type { BoxProps, DOMElement } from 'ink';
async function main() {
const { render, Text, measureElement, Box } = await import('ink');
interface ScrollProps {
onUp?: () => void;