Skip to content

Instantly share code, notes, and snippets.

View prateek's full-sized avatar

Prateek Rungta prateek

View GitHub Profile
@prateek
prateek / orca-terminal-tearing-harness.js
Created July 4, 2026 00:27
Orca terminal tearing reproduction harness
#!/usr/bin/env node
'use strict';
/*
* Single-file reproduction for Orca remote-session terminal tearing.
*
* Run:
* node orca-terminal-tearing-harness.js
*
* The script installs the pinned xterm packages into a temp cache if they are
@prateek
prateek / 01-live-ui-query.sql
Last active July 1, 2026 02:12
meta consumption UI Spanner read latency — live SPANNER_SYS stats + PROFILE trace (2026-06-30)
@{OPTIMIZER_VERSION=default_version
}
WITH
@prateek
prateek / tropes.md
Created April 9, 2026 20:08 — forked from ossa-ma/tropes.md
AI Writing Tropes to Avoid — tropes.fyi by ossama.is

AI Writing Tropes to Avoid

Add this file to your AI assistant's system prompt or context to help it avoid common AI writing patterns. Source: tropes.fyi by ossama.is


Word Choice

"Quietly" and Other Magic Adverbs

@prateek
prateek / README.md
Last active February 23, 2026 05:33
Using Ralph: AFK Codex loop + PRD/progress workflow

Using Ralph (AFK loop)

This gist contains:

  • ralph-loop.sh: runs Codex in an autonomous loop that repeatedly:
    1. picks the highest-priority task from PRD.md + progress.txt
    2. implements only that task
    3. runs tests/typechecks
    4. updates PRD.md and appends to progress.txt
    5. commits
  1. stops when a “promise” file is created
@prateek
prateek / getOpenTabs.sh
Created December 28, 2022 04:33 — forked from NoahCardoza/getOpenTabs.sh
[OSX] Lists the URLs of all the open tabs in a specified browser.
#!/bin/bash
# args: browser
# example: ./getOpenTabs.sh "Brave Browser"
# credits:
# https://gist.github.com/samyk/65c12468686707b388ec43710430a421
# TODO:
# validate args
# don't open app if not already open
@prateek
prateek / keysdistribution_test.go
Created December 17, 2022 01:37
TestKeysDistribution demonstrates why you have to be careful when picking hash functions while double hashing.
package main
import (
"fmt"
"hash/crc32"
"math"
"testing"
)
/*
@prateek
prateek / collective-claims-data-extraction.md
Last active June 21, 2019 19:13
Extract Claims Data from Collective Health.

Free your Collective Claim Data(!)

Found it much easier to hijack their APIs using Chrome (as opposed to browser scraping).

Broke the process into two parts:

  1. Getting a list of all relevant claims
  2. Retrieving PDFs for said claims

(1) Getting a list of all relevant claims

@prateek
prateek / diff-glide-dep.sh
Last active September 29, 2018 04:06
Generate diff-able summaries for glide.{yaml|lock} and Gopkg.{toml|lock} file
#!/bin/bash
# requires https://github.com/dbohdan/remarshal
# generate diff summary for .lock file
cat <(cat glide.lock| yaml2json -i - -o - | jq -r '.imports[] | .name + " " + .version') \
<(cat glide.lock| yaml2json -i - -o - | jq -r '.testImports[] | .name + " " + .version') \
| sort | uniq > glide.lock.summary
@prateek
prateek / pilosa_vs_upstream_roaring.md
Last active May 13, 2018 14:52
upstream roaring v pilosa simple perf benchmarks

For sure. So using some tests I had while testing mem <-> fst segment serialization, as a poor man's benchmark:

# pilosa 
❯ time go test ./index/segment/tests -count=10
ok  	github.com/m3db/m3ninx/index/segment/tests 2.192s
/Users/prungta/code/go1.10.2/bin/go test ./index/segment/tests -count=10  3.81s user 0.47s system 131% cpu 3.266 total

# roaring binary 
❯ time go test ./index/segment/tests -count=10
@prateek
prateek / vellum_example_usage.go
Last active May 14, 2018 18:31
vellum example usage
package main
import (
"bytes"
"github.com/couchbaselabs/vellum"
vregex "github.com/couchbaselabs/vellum/regexp"
)
func main() {