Skip to content

Instantly share code, notes, and snippets.

View ivan's full-sized avatar
🕸️

Ivan Kozik ivan

🕸️
View GitHub Profile
@ivan
ivan / Cults are patronage networks.md
Last active May 2, 2023 17:29
Cults are patronage networks

Cults are patronage networks. They distribute benefits. The benefits could be intangible, they don't have to be money. Belonging is a benefit, acceptance is a benefit, access to [partners] is a benefit, money is a benefit of course, but also power is a benefit; an internal hierarchy. It's a fantasy, it's what we call in psychology is a paracosm. A paracosm is an alternative cosmos; it's detached, it's a bubble. And so within this bubble you can create an entire universe with its own laws of physics of you wish, and then if you play by these rules, you're mightily rewarded, emotionally, materially, in other ways. And if you don't, of course, you're sanctioned, similarly. So it's what we call a reinforcement system. It's a reward-punishment system. Positive and negative. And it's fairly intermittently by the way, it's fairly intermittent in the sense that very often, the leader kind of punished you to remind you that you're still at his mercy. He demotes you, he criticizes you publicly, he does something to

@ivan
ivan / Python resources.md
Last active September 29, 2025 01:52
Python resources

For programming beginners who want to learn Python, these are some of the better resources I know about:

@ivan
ivan / Build CockroachDB on NixOS.md
Last active July 8, 2023 08:04
Build CockroachDB on NixOS (Cockroach Build Secrets Exposed)

Build CockroachDB on NixOS

(entirely serious, this is how you do it, last tested July 8, 2023)

Summary: you can use nixpkgs's bazel_6 to build and run CockroachDB's bazelbuilder Docker container, which will use the bazel version it really wants to use for building cockroach. You need to patchelf a few things along the way, and then patchelf the resulting cockroach binary.


  1. Add this to your NixOS configuration:
@ivan
ivan / 2023_reading.md
Last active June 24, 2025 08:15
2023 reading list

[This page is best viewed with https://github.com/ludios/expand-everything, which will load all the comnents below.]

Wherein I try to prioritize reading for the limited amount of time I have this year, and to remind myself to read more than just comments on the Internet. Because of problems of time and shifting interests, I will consider this a success if I read a third of the list. I'll reflect on the reading and deviations from the plan in Jan 2024.

{+} = added after initial planning

@ivan
ivan / cherry-pick-version-bumps.sh
Last active December 15, 2022 08:53
git cherry-pick version bumps from nixpkgs master onto your nixpkgs release branch
#!/usr/bin/env bash
# This is intended to be run in a git checkout of nixpkgs
set -eu -o pipefail
dirs=(
./pkgs/development/tools/esbuild
./pkgs/applications/misc/calibre
)
@ivan
ivan / saving your tweets with snscrape and SingleFile cli.md
Last active November 29, 2022 13:40
saving your tweets with snscrape and SingleFile cli

Another way to save your own tweets exactly as they are rendered on Twitter, with replies, using snscrape and SingleFile/cli:

  1. TWEETER=someusername
    snscrape twitter-user ${TWEETER} | grep -o -P '\d+$' | sed -r 's,^,https://twitter.com/i/status/,g' > ${TWEETER}-tweets # write a URL list
    
  2. Make sure the oldest tweet in this list is in fact your oldest tweet, and that snscrape did not stop early due to Twitter Search problems.
  3. Merge in all the tweet URLs from your Twitter data export, to include retweets and Circle tweets:
    cat data/tweets.js | sed -r 's/^window\.YTD\.tweets\.part0 = //' | jq -r '.[].tweet.id' | sed -r 's,^,https://twitter.com/i/status/,g' >> ${TWEETER}-tweets
    
@ivan
ivan / Twitter usernames exceeding 15 characters.txt
Last active January 13, 2023 08:40
Twitter usernames exceeding 15 characters
# cat twitter-usernames-archive.org-sample-stream.txt | rg '^.{16,}$' | awk '{ print length, $0 }' | sort -n -s | cut -d" " -f2-
richardrushfield
vittoriopasteris
Scottcoopersmith
The_Porter_House
thoughtlessbeast
TributetoJohnnyB
shannonerickson1
meinnameistbernd
shelbyunderwood1
@ivan
ivan / Tips for using Prisma on NixOS and with pnpm --ignore-scripts --no-optional.sh
Last active July 1, 2023 18:37
Tips for using Prisma on NixOS and with pnpm --ignore-scripts --no-optional
## in your NixOS config:
environment.systemPackages = [ prisma-engines ];
## in your ~/.zshrc:
# We use the prisma-engines in nixpkgs; Prisma's downloaded binaries don't work on NixOS
export PRISMA_QUERY_ENGINE_LIBRARY=/run/current-system/sw/lib/libquery_engine.node
@ivan
ivan / commaify.rs
Created October 12, 2022 06:58
Commaify an integer in Rust by the English rules without using a crate or traits or unsafe reads of the locale
// Based on https://github.com/Totobird-Creations/Lrinser-Laser-Etcher-Edition-2/blob/81efa5a7355ba3df38e756f62c177d391d8e9060/src/helper.rs
//
/// Commaify a number by the British English rules (not the American English
/// rules because we don't want the '1' in 1000 to align with a comma in 10,000).
pub fn commaify_i64(number: i64) -> String {
// Fast path
if number > -1000 && number < 1000 {
return number.to_string();
}
let string = number.abs().to_string();
@ivan
ivan / keybindings.json
Last active September 24, 2022 05:24
vscode keybindings.json
{
{"key": "alt+x", "command": "workbench.action.showCommands"},
{"key": "ctrl+shift+p", "command": "-workbench.action.showCommands"},
{"key": "alt+q", "command": "workbench.action.quickOpen"},
{"key": "ctrl+e", "command": "-workbench.action.quickOpen"},
{"key": "ctrl+shift+l", "command": "editor.action.insertCursorAtEndOfEachLineSelected", "when": "editorTextFocus"},
{"key": "shift+alt+i", "command": "-editor.action.insertCursorAtEndOfEachLineSelected", "when": "editorTextFocus"},
{"key": "alt+left", "command": "workbench.action.navigateBack"},
{"key": "ctrl+alt+-", "command": "-workbench.action.navigateBack"},
{"key": "alt+\\", "command": "workbench.action.navigateToLastEditLocation"},