Skip to content

Instantly share code, notes, and snippets.

View ivan's full-sized avatar
🕸️

Ivan Kozik ivan

🕸️
View GitHub Profile
@ivan
ivan / Prevent ChatGPT from unloading text from the DOM when it is outside the viewport.user.js
Created July 8, 2026 04:32
Prevent ChatGPT from unloading text from the DOM when it is outside the viewport
// ==UserScript==
// @name leave my text alone (chatgpt.com)
// @namespace https://chatgpt.com/
// @version 1.0.0
// @description Keep every chat turn mounted in the DOM (defeats IntersectionObserver-driven unloading) so find-in-page and SingleFile capture whole conversations.
// @match https://chatgpt.com/*
// @match https://chat.openai.com/*
// @run-at document-start
// @grant none
// @inject-into page
@ivan
ivan / Prevent claude.ai from unloading text from the DOM when it is outside the viewport.user.js
Last active July 8, 2026 04:14
Prevent https://claude.ai from unloading text from the DOM when it is outside the viewport
// ==UserScript==
// @name leave my text alone (claude.ai)
// @namespace https://claude.ai/
// @version 1.0.0
// @description Keep every chat message mounted in the DOM (defeats list virtualization) so find-in-page and SingleFile capture whole conversations.
// @match https://claude.ai/*
// @run-at document-idle
// @grant none
// @inject-into page
// @noframes
@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 / systemd service for NixOS to log all executed commands.nix
Last active May 17, 2026 07:51
(ChatGPT 5.5 Pro slop) systemd service for NixOS to log all executed commands
{ lib, pkgs, ... }:
let
max_args = 100;
log_fails = false;
execsnoop_args =
assert max_args >= 1;
[
"--time"
@ivan
ivan / ChatGPT and Claude custom instructions.md
Last active June 2, 2026 10:19
ChatGPT and Claude custom instructions

User is an unfeeling polymath who cares about having the best information; no need to assuage or validate as if you were talking to a normal person.

User has all the time in the world: If it could make the response better, think and keep iterating on Google queries and check things as long as you'd like. Tips: try site-specific searches, try combinations of quoted items.

User is an expert programmer of 25 years: Python, bash, zsh, JavaScript, TypeScript, SQL, PL/pgSQL, Rust, Clojure, Elixir. So, good code is preferred, the kind the best people wrote before AI.

User uses NixOS, Windows, macOS, & iOS. Don't add sudo.

When returning JavaScript or TypeScript or Svelte-related code:

  • use tabs, not spaces.
@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 / Edit messages over a day old in Signal-Desktop.patch
Last active May 9, 2026 11:27
Edit messages over a day old in Signal-Desktop
diff --git a/_locales/en/messages.json b/_locales/en/messages.json
index cbcdc7e4b..1ecc92256 100644
--- a/_locales/en/messages.json
+++ b/_locales/en/messages.json
@@ -3353,7 +3353,7 @@
"description": "Toast shown when view once mode is disabled for a message"
},
"icu:ToastManager__CannotEditMessage_24": {
- "messageformat": "Edits can only be applied within 24 hours from the time you sent this message.",
+ "messageformat": "Edits can only be applied within about 48 hours from the time you sent this message.",
@ivan
ivan / zsh-history-archive.zsh
Last active May 3, 2026 11:42
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: