Skip to content

Instantly share code, notes, and snippets.

View theTechGoose's full-sized avatar

Raphael theTechGoose

  • 03:26 (UTC -04:00)
View GitHub Profile
@theTechGoose
theTechGoose / assert.ts
Created March 7, 2026 02:03
Rune Assert — DTO + primitive validation for Deno (class-validator)
import { plainToInstance } from "npm:class-transformer@^0.5.1";
import { validateSync } from "npm:class-validator@^0.14.1";
interface Assert {
<T extends object>(cls: new (...args: unknown[]) => T, plain: unknown): T;
string(value: unknown): string;
number(value: unknown): number;
boolean(value: unknown): boolean;
}
@theTechGoose
theTechGoose / claude-bot.ts
Last active March 6, 2026 14:31
Claude Bot — Observable wrapper for claude-agent-sdk (Deno)
/**
* Claude Bot Observable wrapper for @anthropic-ai/claude-agent-sdk
*
* Import from gist:
* import { Bot, quickQuery } from "https://gist.githubusercontent.com/theTechGoose/68c8429d1564b36e02350df472a2bdd8/raw/claude-bot.ts";
*
* Usage:
* const bot = new Bot({ systemPrompt: "You are helpful.", model: "claude-sonnet-4-20250514" });
* bot.chat("hello").subscribe(msg => console.log(msg));
*
@theTechGoose
theTechGoose / get-durations.ts
Last active January 22, 2026 19:23
Get MP3 durations from ContractGenie Judge recordings
#!/usr/bin/env -S deno run --allow-net --allow-run --allow-write
/**
* Get MP3 Durations from ContractGenie Judge Recordings
*
* Prerequisites:
* - Deno installed (https://deno.land)
* - ffprobe installed (brew install ffmpeg)
*
* Usage:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>AI Interaction Report</title>
<script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0-beta3/css/all.min.css">
<style>
function generateName() {
const adjectives = [
"fast", "cool", "red", "blue", "happy", "lazy", "bright", "quiet",
"shiny", "fuzzy", "brave", "sneaky", "wild", "gentle", "loud", "calm",
"playful", "fierce", "stormy", "electric", "silent", "mighty", "tiny", "massive",
"vivid", "smooth", "swift", "jolly", "fearless", "mysterious", "daring", "cheerful",
"golden", "icy", "fiery", "graceful", "shadowy", "whimsical", "bold", "curious"
];