Skip to content

Instantly share code, notes, and snippets.

View ivan's full-sized avatar
🕸️

Ivan Kozik ivan

🕸️
View GitHub Profile
@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 July 6, 2025 09:34 — 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.

Last updated: 30 June 2025

Also known as itag or format codes and way back they could be specified with the fmt parameter (e.g. &fmt=22). Depending on the age and/or popularity of the video, not all formats will be available.

DASH video

@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) {
@ivan
ivan / uBlock Origin filter to unjustify all justified text.txt
Created August 29, 2022 01:24
uBlock Origin filter to unjustify all justified text
! Generic rule to unjustify all justified text. Yes, you really need both rules.
! Test page: https://www.addameer.org/israeli_military_judicial_system/administrative_detention
! Test page: https://en.wikipedia.org/wiki/Typographic_alignment (needs !important)
! Test page: https://www.gwern.net/Screwfly (needs !important)
*#$#*:matches-css(text-align: justify) { text-align: left !important; }
*#$#*:matches-css(text-align: left) { text-align: left !important; }
@ivan
ivan / zshrc.sh
Created August 10, 2022 23:53
cygwin .zshrc to make mintty change background color after each time you start zsh
# This goes in ~/.zshrc
typeset -A bgcolor_to_next_color
bgcolor_to_next_color=(
# The darkest IBM Carbon colors from https://huetone.ardov.me/
22,22,22 7,25,8
7,25,8 8,26,28
8,26,28 6,23,39
6,23,39 0,17,65
0,17,65 28,15,48