Skip to content

Instantly share code, notes, and snippets.

View ivan's full-sized avatar
🕸️

Ivan Kozik ivan

🕸️
View GitHub Profile
@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"},
@MartinEesmaa
MartinEesmaa / youtube_formats.md
Last active September 8, 2026 04:48 — forked from AgentOak/youtube_formats.md
Youtube Format IDs

Note: This is all almost full YouTube ID informations. Original owner goes to AgentOak, modified version by Martin Eesmaa.

See the credits and also special thanks in below.

Before this gist has been forked, AgentOak made original gist on November 13 2019 and it was last updated on May 5 2021.

From now on, this forked gist is maintained by Martin Eesmaa since 17 September 2022. I joined to yt-dlp Discord server on 3rd April 2026 with my Discord username: martineesmaa.

Last updated: 20 August 2026

@ivan
ivan / inoreader_subscribe.js
Last active September 9, 2022 14:04
A userscript to replace the incorrect "follow" language on inoreader with "subscribe"
// ==UserScript==
// @name inoreader: we subscribe to RSS feeds; we do not follow them
// @namespace inoreader_subscribe
// @include https://www.inoreader.com/*
// @version 1
// ==/UserScript==
// Based on https://dev.to/kevin940726/one-fun-trick-to-observe-elements-in-realtime-without-mutationobserver-22kj
function queryElements(selector, callback) {