Skip to content

Instantly share code, notes, and snippets.

@ikouchiha47
ikouchiha47 / coding_agent.md
Created October 24, 2025 10:41
coding agent

AI Agent Development & Debugging Guide

1. Development Cycle

Test-Driven Development (TDD) Workflow

Phase 1: Write Tests First

Write a failing test that defines the expected behavior before implementing any code.

from fontTools.ttLib import TTFont
import os
def rename_font_family(input_path, output_path, old_family="M+1", new_family="M+11"):
font = TTFont(input_path)
name_table = font["name"]
print(name_table)
@ikouchiha47
ikouchiha47 / threadpoolglobal.py
Last active January 2, 2025 05:39
Python synchronise work between threads
import threading
from concurrent.futures import ThreadPoolExecutor, as_completed
from functools import wraps
# Global thread pool
thread_pool = ThreadPoolExecutor(max_workers=10)
workernames = list("abcdefghijklmnopqrstuvwxyz")
def submit_to_thread_pool(func):
@ikouchiha47
ikouchiha47 / fiber.zig
Last active November 12, 2024 11:09
WIP fiber
// Implements:
// fibers as lightweight concurrency control
//
// Source:
// https://cyp.sh/blog/coroutines-in-c
// https://agraphicsguynotes.com/posts/fiber_in_cpp_understanding_the_basics/
// https://github.com/SuperAuguste/oatz/blob/main/impls/aarch64.zig
// https://raw.githubusercontent.com/wiki/hjl-tools/x86-psABI/x86-64-psABI-1.0.pdf
const std = @import("std");
@ikouchiha47
ikouchiha47 / wezterm.lua
Last active October 17, 2024 02:29
wezterm
local wezterm = require("wezterm")
local act = wezterm.action
-- This will hold the configuration.
local config = wezterm.config_builder()
-- load my other fonts
-- config.font_dirs = { "/home/darksied/.local/share/fonts/" }
-- config.color_scheme = "rose-pine"
@ikouchiha47
ikouchiha47 / what-forces-layout.md
Created September 14, 2024 15:24 — forked from paulirish/what-forces-layout.md
What forces layout/reflow. The comprehensive list.

What forces layout / reflow

All of the below properties or methods, when requested/called in JavaScript, will trigger the browser to synchronously calculate the style and layout*. This is also called reflow or layout thrashing, and is common performance bottleneck.

Generally, all APIs that synchronously provide layout metrics will trigger forced reflow / layout. Read on for additional cases and details.

Element APIs

Getting box metrics
  • elem.offsetLeft, elem.offsetTop, elem.offsetWidth, elem.offsetHeight, elem.offsetParent
@ikouchiha47
ikouchiha47 / Makefile
Last active August 1, 2024 20:35
LLM (llama3) powered test generator in neovim
gen.model.tester:
ollama create llama3-coder -f Modelfile
ollama run llama3-coder < /dev/null
cache.model.tester:
ollama run llama3-coder < /dev/null
@ikouchiha47
ikouchiha47 / cli.js
Last active July 10, 2024 09:41
Suck'em ratings
const { GoogleResults, BingResults, DDGResults } = require('./sniffratings');
function parseArguments(args) {
const argsMap = {};
let currentKey = null;
for (let i = 2; i < args.length; i++) {
const arg = args[i];
if (arg.startsWith('-')) {
@ikouchiha47
ikouchiha47 / debug.zig
Created July 7, 2024 19:55
zig, add println to std.debug
// file present in std/debug.zig
pub fn println(comptime fmt: []const u8, args: anytype) void {
lockStdErr();
defer unlockStdErr();
const stderr = io.getStdErr().writer();
nosuspend stderr.print(fmt ++ "\n", args) catch return;
}
Internet Engineering Task Force (IETF) Amitava Ghosh
Internet-Draft Example Inc.
Intended status: Standards Track June 3, 2024
Expires: December 3, 2024
A New Date Format for ISO Compatibility and Reduced Ambiguity
draft-iso-date-extended-date-format-00
Abstract