Skip to content

Instantly share code, notes, and snippets.

View ivan's full-sized avatar
🕸️

Ivan Kozik ivan

🕸️
View GitHub Profile
@ivan
ivan / README.md
Created December 24, 2023 06:29
I just need to find a good game to play

Game reviews of things I'm trying EOY 2023 - early 2024

@ivan
ivan / run.sh
Last active December 10, 2023 19:06
Merging the files in Stripe Press's audiobook of Poor Charlie's Almanack
wget -c -i urls
nix run github:sandreas/m4b-tool#m4b-tool-libfdk -- merge --no-conversion -o "Charlie Munger, Stripe Press - Poor Charlie's Almanack.m4b" *.m4a
@ivan
ivan / peanut gallery.md
Last active November 28, 2023 09:16
peanut gallery.md
@ivan
ivan / gist:feef5f0033a9d23e79bda22fe95d994a
Created November 26, 2023 23:15
setTimeout(..., Infinity)
> setTimeout(() => console.log("hi"), Infinity)
Timeout {
_idleTimeout: 1,
_idlePrev: [TimersList],
_idleNext: [TimersList],
_idleStart: 42302,
_onTimeout: [Function (anonymous)],
_timerArgs: undefined,
_repeat: null,
_destroyed: false,
@ivan
ivan / Anti-information.md
Created September 11, 2023 01:57
Anti-information

Not good information

@ivan
ivan / nix-serve-ng segfault.txt
Created September 8, 2023 05:26
nix-serve-ng segfault
Sep 08 05:18:38 ra nix-serve-start[1822]: 10.10.0.1 - - [08/Sep/2023:05:18:38 +0000] "GET /nix-cache-info HTTP/1.1" 200 - "" "curl/8.1.1 Nix/2.17.0"
Sep 08 05:18:38 ra kernel: nix-serve:w[831166]: segfault at f32 ip 00007ed18bb6c2a3 sp 00007ed182ff8540 error 4 in libnixutil.so[7ed18bb4b000+81000] likely on CPU 18 (core 18, socket 0)
Sep 08 05:18:38 ra kernel: Code: 00 74 04 ff 47 08 c3 f0 ff 47 08 c3 90 66 2e 0f 1f 84 00 00 00 00 00 41 54 55 53 48 8b 2f 48 39 fd 74 37 49 89 fc 90 48 89 eb <48> 8b 6d 00 48 8b 7b 10 48 8d 43 20 48 39 c7 74 0d 48 8b 43 20 48
Sep 08 05:18:38 ra systemd[1]: Created slice Slice /system/systemd-coredump.
Sep 08 05:18:38 ra systemd[1]: Started Process Core Dump (PID 831186/UID 0).
Sep 08 05:18:39 ra systemd-coredump[831187]: [🡕] Process 1822 (nix-serve) of user 62540 dumped core.
Module libattr.so.1 without build-id.
Module libkeyutils.so.1 without build-id.
@ivan
ivan / notify-yourself.sh
Created August 18, 2023 05:13
notify yourself using signal-cli
#!/usr/bin/env bash
set -eu -o pipefail
message=$1
sender=+SERVERPHONE
recipient=+YOURPHONE
sender_for_dbus=${sender//+/_}
@ivan
ivan / axum thing.rs
Created August 14, 2023 06:58
axum thing.rs
/// Error indicating failure to parse strictly a natural number
#[derive(thiserror::Error, Debug, Clone)]
#[error("could not parse as natural number without leading 0 or +")]
pub struct ParseNaturalNumberError;
/// Parse strictly, forbidding leading '0' or '+'
#[inline]
fn parse_natural_number<T: FromStr>(s: &str) -> Result<T, ParseNaturalNumberError> {
if s.starts_with('0') || s.starts_with('+') {
@ivan
ivan / data.csv
Created August 6, 2023 05:40
IRC messages with "twitter.com/" in the message, over time
Month IRC messages logged IRC messages logged with "twitter.com/" Percent mentioning Twitter
2015-02 17195404 8917 0.052%
2015-03 17749799 11017 0.062%
2015-04 16134253 15596 0.097%
2015-05 15123528 10197 0.067%
2015-06 15933871 12762 0.080%
2015-07 16113608 10884 0.068%
2015-08 16010748 7457 0.047%
2015-09 14542928 8772 0.060%
2015-10 14512795 9395 0.065%
@ivan
ivan / CSS light and dark mode.css
Last active August 11, 2023 23:04
CSS light and dark mode without JavaScript requirement and with a class-based override on <html>
html {
background-color:
var(--LIGHT, #eee)
var(--DARK, #111);
color:
var(--LIGHT, #000)
var(--DARK, #ccc);
}
html {