Skip to content

Instantly share code, notes, and snippets.

View danielbodart's full-sized avatar

Daniel Worthington-Bodart danielbodart

View GitHub Profile
@danielbodart
danielbodart / TransducerChains.ts
Last active November 18, 2023 15:56
Experiment with TransducerChains
/**
* A transducer that can be applied synchronously
*/
export interface Transducer<A, B> {
/**
* Applies the transducer to the given iterable
*/
(iterable: Iterable<A>): Iterable<B>;
/**
// Function to fetch paginated GitHub API responses
async function fetchPaginatedGitHubData(url: string, headers: Headers): Promise<any[]> {
let results: any[] = [];
let nextPageUrl: string | null = url;
while (nextPageUrl) {
const response: Response = await fetch(nextPageUrl, { headers });
const data = await response.json();
results = results.concat(data);
@danielbodart
danielbodart / whisper.sh
Last active March 4, 2026 17:12
A simple script using whisper.cpp to dictate into any input box on X11
#!/bin/bash
# Whisper Push-to-Talk Dictation Tool
# Runs whisper.cpp continuously, only processes output when key is held
set -euo pipefail
# Get script directory
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"