Skip to content

Instantly share code, notes, and snippets.

View ivan's full-sized avatar
🕸️

Ivan Kozik ivan

🕸️
View GitHub Profile
@ivan
ivan / Untested nixpkgs patch to avoid filling up boot with too many generations.patch
Last active July 28, 2026 02:25
(Claude Fable 5 + ChatGPT 5.6 Sol (Pro)) Untested nixpkgs patch to avoid filling up /boot with too many generations
diff --git a/nixos/modules/system/boot/loader/grub/grub.nix b/nixos/modules/system/boot/loader/grub/grub.nix
index 042fd63cd254..6d319a3d3ca3 100644
--- a/nixos/modules/system/boot/loader/grub/grub.nix
+++ b/nixos/modules/system/boot/loader/grub/grub.nix
@@ -90,6 +90,9 @@ let
else
args.efiBootloaderId;
timeout = if config.boot.loader.timeout == null then -1 else config.boot.loader.timeout;
+ dynamicLimit = cfg.dynamicConfigurationLimit.enable;
+ dynamicLimitMarginMB = cfg.dynamicConfigurationLimit.marginMB;
@ivan
ivan / patch_witness_stair_speed_no_corruption_check.py
Last active July 12, 2026 20:45
Fix the walking speed in The Witness witness64_d3d11.exe (GOG, Patch 21.12.2017 from 06 March 2018) to not have sqrt(2) walking speed on stairs
#!/usr/bin/env python3
# Model-output: ChatGPT 5.6 Sol (High)
"""Patch The Witness stair movement and bypass its startup corruption guard.
The movement patch rescales a player-only walk-manifold request when traversal adds
vertical displacement. The startup patch removes the conditional jump that routes
a zero critical-asset sentinel to ``fatal_error_data_corruption``. The PE file size
and section count remain unchanged.
@ivan
ivan / rsync tips.txt
Created May 31, 2026 07:20
rsync tips
rsync -av -@-1 as the baseline thing
or with --delete to remove things from DEST, and probably
--delete-excluded when using --exclude
rsync -@-1 compares timestamps by nanoseconds instead of seconds, which is important for transferring e.g. PostgreSQL data; rsync doesn't read the data inside each file if the (mtime, size) matches on both ends, unless you:
rsync -c
rsync -X to also copy xattrs (slower)
rsync -H for hard link preservation (uses memory to track all the inodes)
rsync -S to preserve sparseness in sparse file
rsync --zc=zstd
rsync --zc=zstd --compress-level=6 or maybe 8 where the link is slow and extra compression is useful
@ivan
ivan / main.ahk
Last active May 29, 2026 15:29
AutoHotkey to remap a laptop numpad to three identical columns of Home/PgUp/PgDn/End keys
#persistent
#singleinstance Force
; The idea here is to remap the left edge of the numpad
; to a single column of Home/PgUp/PgDn/End keys.
Numlock::Home
NumpadHome::PgUp
NumpadLeft::PgDn
NumpadEnd::End
@ivan
ivan / main.ahk
Created May 29, 2026 15:22
AutoHotkey to remap a laptop numpad to the keys you'd find in the navigation cluster
#persistent
#SingleInstance Force
; The idea here is to remap the entire numpad (with Numlock off)
; to a scroll lock area with:
; Ins Home PgUp
; Del End PgDn
; Up Up
; Left [ Down ] Right
;
@ivan
ivan / Firefox patch to put the URL in the window title.patch
Created May 10, 2026 10:14
Firefox patch to put the URL in the window title
diff --git a/browser/components/tabbrowser/content/tabbrowser.js b/browser/components/tabbrowser/content/tabbrowser.js
index 37cbdd29fec4..ddebb1c0ef7a 100644
--- a/browser/components/tabbrowser/content/tabbrowser.js
+++ b/browser/components/tabbrowser/content/tabbrowser.js
@@ -206,9 +206,6 @@
"moz-src:///browser/components/tabbrowser/TabMetrics.sys.mjs",
TabStateFlusher:
"resource:///modules/sessionstore/TabStateFlusher.sys.mjs",
- TaskbarTabsUtils:
- "resource:///modules/taskbartabs/TaskbarTabsUtils.sys.mjs",
@ivan
ivan / zsh-history-archive.zsh
Last active July 26, 2026 05:33
Maybe a proper zsh history logger, via good requirements + ChatGPT 5.2 Thinking + 5.5 Pro + 5.5 Thinking
# This is slop authored by ChatGPT 5.5 Pro on 2026-05-03, using some earlier
# inputs from ChatGPT 5.2 Thinking.
# zsh JSONL history archive
# Install: source this near the end of ~/.zshrc.
#
# Records go to one unique JSONL file per interactive zsh session:
# ${ZSH_HISTORY_ARCHIVE_DIR:-${XDG_STATE_HOME:-$HOME/.local/state}/zsh-history-archive}/hist.<session>.jsonl
#
# Record types:
@ivan
ivan / 0001-In-the-window-title-include-the-name-of-the-person-f.patch
Created May 3, 2026 07:28
Signal-Desktop patch: In the window title, include the name of the person for the focused chat
From e608507fd776858211e7f28bc3e891c1aa81bdc4 Mon Sep 17 00:00:00 2001
From: Ivan Kozik <ivan@ludios.org>
Date: Sun, 3 May 2026 02:43:55 +0000
Subject: [PATCH] In the window title, include the name of the person for the
focused chat
Slop-provider: ChatGPT-5.5-Thinking
---
ts/ConversationController.preload.ts | 4 ++--
ts/state/initializeRedux.preload.ts | 14 ++++++++++++++
@ivan
ivan / Some Svelte info.md
Last active January 23, 2026 07:47
Some Svelte info

Svelte is a library that binds JavaScript data to HTML/SVG DOM, so that you don't need to write ad-hoc functions to update DOM. You change values in JavaScript variables marked for reactivity, and Svelte's compiled output implements the DOM mutations. Svelte solves this better than React, both performance-wise and syntax-wise. But not so much better as to make people migrate from React, especially now that LLMs can write either. React has more runtime code, and remains uglier to read for humans: there are paired setter functions, and often-confusing hook semantics.

SvelteKit runs your Svelte code on the server as well (using Node.js), hosting multiple routes (paths), which are first delivered by the server, then updated and navigated by the client. SvelteKit is a superset of Svelte; there's rarely a need to use Svelte without SvelteKit.

Svelte/SvelteKit isn't an all-in-one framework; it considers some things out of scope: data persistence, authentication, CSS framework (beyond the per-component

@ivan
ivan / Lights that I will be reviewing.md
Last active August 28, 2025 07:12
Lights that I will be reviewing