Skip to content

Instantly share code, notes, and snippets.

View jordangarcia's full-sized avatar

Jordan Garcia jordangarcia

View GitHub Profile

Gemini Streaming Refactor Plan

Motivation

gemini.model.ts is 960 lines, mixes HTTP transport, SSE parsing, cumulative/fragmented dedup, S3 upload orchestration, backpressure handling, and business logic in one class. The raw fetch approach (bypassing the @google/genai SDK) is necessary for memory efficiency — the SDK buffers entire request bodies via JSON.stringify and parses full response objects per chunk — but the implementation can be decomposed into composable layers.

Streaming primitive: AsyncIterable<T> → AsyncGenerator<U>

All transforms are functions: (input: AsyncIterable<A>) → AsyncGenerator<B>.

categories project people resume date
[[Plans]]
[[Design Anything]]
claude --resume b9db3a88-ec96-4277-b3b1-f9e7339e4fdc
2026-03-04
#!/bin/bash
# Show processes spawned from wezterm, with detailed view of gamma dev stack
WEZTERM_PID=$(ps -eo pid,command | grep "[w]ezterm-gui" | awk '{print $1}')
if [[ -z "$WEZTERM_PID" ]]; then
echo "wezterm not running"
exit 1
fi
description
Break up a large branch into smaller stacked PRs using git-spice

Split a large branch into smaller, reviewable stacked PRs using git-spice (gs).

Workflow

Phase 1: Analyze the branch

import { z } from 'zod'
import {
s,
defineCollection,
createMockClients,
StorageConfig,
} from './index'
// === Primitives ===
import { z } from 'zod'
import {
s,
defineCollection,
createMockClients,
StorageConfig,
} from './index'
// === Primitives ===
version: '0.5'
log_level: info
log_location: /Users/jordan/.gamma/logs/process-compose.log
log_configuration:
disable_json: true
fields_order: ['level', 'time', 'message']
timestamp_format: '2006-01-02 15:04:05'
add_timestamp: true
flush_each_line: true
@jordangarcia
jordangarcia / claude-tools
Created January 6, 2026 18:40
Claude Code tool usage tracking hooks
#!/usr/bin/env python3
"""
CLI to query Claude Code tool usage stats.
Usage:
claude-tools # list repos
claude-tools <repo> # show tool counts
claude-tools <repo> --perms # show permission strings (for allowlisting)
claude-tools <repo> --raw # show recent raw entries
claude-tools <repo> --since 7 # last 7 days
This file has been truncated, but you can view the full file.
{
"chatId": "buddy-xctvfvk2gnf6so6-nrEUOblO",
"messagesVersion": "v5",
"messages": [
{
"id": "current-deck-GhNSqtiRH_h8Gas6o9lep",
"role": "user",
"parts": [
{
"type": "text",
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>EditCard2 Error Analysis</title>
<style>
* {
margin: 0;
padding: 0;