Skip to content

Instantly share code, notes, and snippets.

View FlyingFathead's full-sized avatar
💭
Just flyin' around

Harry Horsperg FlyingFathead

💭
Just flyin' around
View GitHub Profile
@FlyingFathead
FlyingFathead / llm_letter_counter_fi.py
Last active November 15, 2024 18:06
LLM letter counter (Finnish GPT model)
#!/usr/bin/env python3
# finnish_word_letter_counter.py
"""
A training set generator to assist a Finnish GPT-2 model in counting letters in a given word,
including reasoning steps. The script generates data in a specific format suitable for training
the model to perform letter counting tasks with explanations.
(c) FlyingFathead 2024
"""
@FlyingFathead
FlyingFathead / ffmpeg_encodetotarget_mp3_strict.sh
Last active January 22, 2025 04:43
Encode `.mp3` files to target size using `ffmpeg`
#!/usr/bin/env bash
#
# ffmpeg_encodetotarget_mp3_strict: Encode input to MP3, never exceed the specified target MB.
# Uses a binary search on bitrate to get as close as possible to the limit without going over.
#
# Usage: ffmpeg_encodetotarget_mp3_strict <inputfile> <target_MB> [<max_iterations>]
#
# Example:
# ffmpeg_encodetotarget_mp3_strict myaudio.wav 5
# => tries to produce an MP3 no bigger than 5 MB
#!/usr/bin/env python3
# this is a simple script that allows you to use yt-dlp to get an audio file
# and recode it (if necessary) to fit within target size limitations.
import sys
import os
import subprocess
# ----------------------
# CONFIG
@FlyingFathead
FlyingFathead / vix_ticker.py
Last active March 27, 2026 21:54
VIX (CBOE Volatility Index) ticker-tracker
#!/usr/bin/env python3
#
# vix_ticker.py
#
# A simple Python program to monitor the Chicago Board Options Exchange's
# CBOE Volatility Index (^VIX) via Yahoo Finance.
#
# The purpose of this small program is to trigger warnings via Yahoo Finance
# in case of market panic or other volatility; useful knowledge for many.
#