Skip to content

Instantly share code, notes, and snippets.

View ivan's full-sized avatar
🕸️

Ivan Kozik ivan

🕸️
View GitHub Profile
@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
@ivan
ivan / rstree.sh
Last active June 26, 2022 22:42
Print an outline of Rust code in the current directory
#!/usr/bin/env bash
# Print an outline of Rust code in the current directory
GRAY=$(tput setaf 7)
PURPLE=$(tput setaf 5)
BOLD=$(tput bold)
CLEAR=$(tput sgr0)
rg --sort path --heading --no-line-number --glob '*.rs' '\b(fn|struct|enum|trait|impl|mod|macro_rules)\b' |\
@ivan
ivan / README.md
Last active June 24, 2022 07:16
How to maximize all your vscode windows on startup despite whatever stupid mitigations (?) Windows 10 is applying to prevent too many windows from starting maximized at the same time

This is for people who find that

"window.newWindowDimensions": "maximized",

does not actually work on Windows. Symptoms: some or all vscode windows are not maximized on startup.

The first thing you'll want is

@gildas-lormeau
gildas-lormeau / README.MD
Last active January 15, 2026 03:10
CLI to transform a SingleFileZ page into a SingleFile page

Why I'll never use Affirm again

tldr: I'll never use Affirm again because when there are issues with their payment system that could severely impact your credit score for years, their customer support is unequipped to help and their underlying support infrastructure is poorly designed.

On Jan 3 2022, I purchase a product from a merchant for $271. As part of the purchase, I signed up for a 0% APR installment plan via Affirm to pay the balance in four equal payments over six weeks. The merchant ended up not shipping the product for over two months, by which time I had fully paid off the loan from Affirm, and they were unresponsive to my requests for a shipping date. Because of this, on Mar 10 2022 I initiated a chargeback with my bank (Chase) on the last loan payment, which I paid on Feb 15 2022. As soon as I initiated the chargeback, the merchant became responsive and shipped the product. On Mar 11 2022, I received the tracking number for the purchase and I called Chase to cancel the chargeback.

Since Ma

@hexium310
hexium310 / make-docs.rs-latest.user.js
Last active May 13, 2022 10:29
Make docs.rs latest on Google Search
// ==UserScript==
// @name Make docs.rs latest on Google Search
// @namespace hexium310
// @version 0.0.1
// @author Hexin
// @include /^(http|https):\/\/www\.google\..+\/search.*/
// @downloadUrl https://gist.github.com/hexium310/774465f10e34740849d653c277cf9ab6/raw/make-docs.rs-latest.user.js
// @updateUrl https://gist.github.com/hexium310/774465f10e34740849d653c277cf9ab6/raw/make-docs.rs-latest.user.js
// ==/UserScript==
@ivan
ivan / gist:cf2d7e53718e8f3a4489f3e66213136d
Last active July 13, 2022 05:04
uBlock Origin rules to hide useless stuff on Google Search results pages
! This is the most annoying one that Google optimizes for accidental clicks.
!
! Hide the 'People also search for' slide-in box when going back on Google Search.
! We require the other attributes here to reduce the risk of false positives.
www.google.com#$#div[id^="eob_"][jscontroller][jsdata][jsaction][data-ved] { display: none !important; }
! Hide the 'People also ask' box
www.google.com#$#div[data-initq][data-it][jscontroller][jsaction]:nth-ancestor(1) { display: none !important; }
! Hide the 'Related searches' box
@ivan
ivan / tutorial.sh
Last active May 28, 2023 05:40
Using single-file-cli on NixOS without Docker
# or properly via environment.systemPackages
nix-env -iA google-chrome-dev nodePackages.pnpm nodejs_latest
(cd ~/ && git clone https://github.com/gildas-lormeau/single-file-cli)
(cd ~/single-file-cli && pnpm import && pnpm install --ignore-scripts --no-optional --prod)
~/single-file-cli/single-file --browser-executable-path google-chrome-unstable --dump-content "https://twitter.com/"
@ivan
ivan / pg_prefaulter.nix
Last active January 4, 2022 14:08
NixOS configuration for deploying pg_prefaulter
{ pkgs, config, ... }:
let
pg_prefaulter_config = pkgs.writeTextFile {
name = "pg_prefaulter.toml";
text = ''
[log]
# level can be set to "DEBUG", "INFO", "WARN", "ERROR", or "FATAL"
level = "DEBUG"