Skip to content

Instantly share code, notes, and snippets.

View YuriyGuts's full-sized avatar

Yuriy Guts YuriyGuts

View GitHub Profile
@YuriyGuts
YuriyGuts / README.md
Last active March 13, 2026 11:59
Logs the inputs and outputs of all tool calls Claude Code makes. Provides a friendly browser-based interface for reviewing the tool call logs. One static HTML file, no frameworks, no build process.

Claude Code Tool Call Log Viewer

Logs the inputs and outputs of all tool calls Claude Code makes. Provides a friendly browser-based interface for reviewing the tool call logs. One static HTML file, no frameworks, no build process.

Installation

Configure the PostToolUse hook in your ~/.claude/settings.json to record all tool calls to ~/.claude/tool-calls.log:

{
@YuriyGuts
YuriyGuts / ballmer_guessing_game.py
Last active February 13, 2026 20:44
Optimal randomized binary search strategy for Steve Ballmer's guessing game (https://www.youtube.com/watch?v=svCYbkS0Sjk)
#!/usr/bin/env python3
"""
Optimal randomized binary search strategy for Steve Ballmer's guessing game.
Game: opponent picks `x` in `[1, 100]`, you guess with higher/lower feedback.
Payoff = $6 - (number of guesses). Profit if you find it in 5 guesses or fewer.
Solves the minimax LP over a pool of deterministic BST strategies to find
the optimal randomized mixture. Verifies via Monte Carlo.
@YuriyGuts
YuriyGuts / bondinfo.py
Last active June 26, 2025 19:57
Extracts information about Ukrainian treasury bonds from the NBU API / Minfin website and presents it as CSV/TSV.
"""
Extracts information about Ukrainian treasury bonds from the NBU API / Minfin
and presents it as CSV/TSV.
usage: bondinfo.py [-h] [--format {tsv,csv}] isin [isin ...]
positional arguments:
isin The ISIN to process. Multiple space-separated values are also accepted.
options:
@YuriyGuts
YuriyGuts / link-ollama-models-to-lm-studio.py
Last active March 4, 2026 16:02
Expose Ollama models to LM Studio by symlinking its model files. Just run `python3 link-ollama-models-to-lm-studio.py`. On Windows, run it as admin.
@YuriyGuts
YuriyGuts / blackout-daily-stats.py
Last active February 2, 2023 10:38
Given a dataset of blackout events, generate daily downtime stats and calendar visualizations
#!/usr/bin/env python3
"""
Given a dataset of blackout events, generate daily downtime stats and calendar visualizations.
-------------------
Prerequisites
-------------------
python3 -m venv ~/.virtualenvs/blackout-stats
source ~/.virtualenvs/blackout-stats/bin/activate
pip install pandas==1.5.2 matplotlib==3.6.2 july==0.1.3
@YuriyGuts
YuriyGuts / dashcam-encode.py
Last active June 21, 2025 17:16
Merge and encode dashcam videos stored on an SD card
#!/usr/bin/env python3
r"""
Concatenate and encode dashcam videos stored on an SD card.
Assumes the videos are stored as *xxxx.avi / *xxxx.mp4 / *xxxx.mov, where xxxx is a
sequential index. This should be compatible with most dashcam SoC manufacturers.
System requirements and dependencies:
-------------------------------------
@YuriyGuts
YuriyGuts / russian_casualty_parser.py
Last active September 22, 2023 14:04
Parse the numbers of Russian casualties in Ukraine from a news website, save them to CSV files, and plot them
# -*- coding: utf-8 -*-
# Parse the numbers of Russian casualties in Ukraine from a news website, save them to CSV files, and plot them.
#
# Prerequisites:
# $ pip install beautifulsoup4==4.10.0 matplotlib==3.4.3 requests==2.26.0 pandas==1.3.4
#
# Usage:
# $ python3 russian_casualty_parser.py
#
# Output:
@YuriyGuts
YuriyGuts / install-persistent-touch-id-sudo.sh
Last active February 2, 2022 13:04
Installs a PAM configuration script as a macOS launch daemon so that Touch ID for sudo is always available and persists across OS updates
#!/usr/bin/env bash
# This script installs a PAM configuration script as a macOS launch daemon
# so that Touch ID for sudo is always available and persists across OS updates.
# NOTE: You might need to allow /usr/bin/env in Security & Privacy > Full Disk Access.
set -euo pipefail
PACKAGE_NAME="com.yuriyguts.persistent-touch-id-sudo"
CONFIG_SCRIPT_INSTALL_PATH="/usr/local/bin/${PACKAGE_NAME}.sh"
@YuriyGuts
YuriyGuts / convert-subtitles.py
Created January 1, 2020 16:48
Converts subtitles in a video from any format to plain text using ffmpeg
"""
Converts subtitles in a video from any format to plain text using ffmpeg.
Reads all files that match a glob pattern.
Writes output to current directory unless specified otherwise.
Usage: convert-subtitles.py <input_pattern> [output_folder]
Example: convert-subtitles.py ~/Videos/*.mkv
"""
import glob
@YuriyGuts
YuriyGuts / dou_salaries_translate_eng.py
Created August 19, 2018 18:43
Translate the DOU salary survey dataset (https://github.com/devua/csv/tree/master/salaries) into English
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import pandas as pd
input_filename = 'https://raw.githubusercontent.com/devua/csv/master/salaries/2018_june_final.csv'
output_filename = '2018_june_final_eng.csv'
df = pd.read_csv(input_filename)