Skip to content

Instantly share code, notes, and snippets.

filc overhead rough tests:
- mg /usr/share/dict/words
- yolo: 10MB maxrss / 101m insn / 54m cycle
- filc: 30MB maxrss / 370m insn / 176m cycle
- filc/yolo: 3x mem / 3.66x insn
- xzcat optfil-0.674-linux-x86_64.tar.xz >/dev/null
- yolo: 9.7MB maxrss / 40.4bn insn / 32.7bn cycle / 9.42s real / 9.32s user / 0.09s sys
- filc: 33.2MB maxrss / 77.5bn insn / 42.8bn cycle / 12.29s real / 12.16s user / 0.14s sys
@havenwood
havenwood / each.rb
Created July 5, 2022 18:44
An example of why we use `each` rather than `for` and what semicolon block args do for #ruby IRC
foo = :untouched
bar = :untouched
[:touched].each do |foo|
bar = :touched
end
foo #=> :untouched
bar #=> :touched
@siraben
siraben / projects-leaving-freenode.md
Last active March 31, 2023 18:13
List of projects and channels that have left or stayed on Freenode

Note: due to volume, this has been moved to https://github.com/siraben/freenode-exodus

Projects and channels that have left Freenode

This is a (necessarily incomplete) list of projects and channels that have decided to permanently move out of Freenode to https://libera.chat (unless stated otherwise). Please reach out below or on IRC if there's additions or corrections.

Sources are mostly comments I've seen on HN, various IRC channels and web searches.

/* So how does this work?
I'm using ANSI escape sequences to control the behavior of the terminal while
cat is outputting the text. I deliberately place these control sequences inside
comments so the C++ compiler doesn't try to treat them as code.*/
//
/*The commands in the fake code comment move the cursor to the left edge and
clear out the line, allowing the fake code to take the place of the real code.
And this explanation uses similar commands to wipe itself out too. */
//
#include <cstdio>
@CRTified
CRTified / README.md
Last active November 27, 2025 01:11
VFIO Passthrough on NixOS

VFIO Setup on NixOS

Disclaimer: Nobody else tested my setup so far, so this is a "works on my machine" scenario. I am not responsible for anything you break on your machine (although I'd not expect much harm).

Hardware

My system has the following hardware:

  • Board: ASRock X570 Pro4
@wybiral
wybiral / sri-profile.go
Created May 7, 2019 20:46
Experiment to get average time of SRI hash calculation from visiting browsers
package main
import (
"crypto/sha512"
"encoding/base64"
"fmt"
"log"
"math/rand"
"net/http"
"strings"
@wybiral
wybiral / noscript-tracking.go
Last active October 28, 2024 23:01
Tracking cursor position in real-time with remote monitoring (without JavaScript)
// Tracking cursor position in real-time without JavaScript
// Demo: https://twitter.com/davywtf/status/1124146339259002881
package main
import (
"fmt"
"net/http"
"strings"
)
@rxwei
rxwei / ad-manifesto.md
Last active December 6, 2024 16:54
First-Class Automatic Differentiation in Swift: A Manifesto
@johnhw
johnhw / umap_sparse.py
Last active May 11, 2025 07:18
1 million prime UMAP layout
### JHW 2018
import numpy as np
import umap
# This code from the excellent module at:
# https://stackoverflow.com/questions/4643647/fast-prime-factorization-module
import random
@plembo
plembo / RPIwithQEMU.md
Last active October 9, 2025 02:52
Emulating a Raspberry Pi with QEMU

Emulating a Raspberry Pi with QEMU

Goal: Emulate a Raspberry Pi with QEMU in order to run the Raspbian O/S (based on Debian Linux).

The current setup is not ideal. For one thing, the maximum RAM allowed using the "versatile-pb" firmware is 256 Mb. In addition, only the most basic peripherals, a keyboard and mouse, are supported.

A number of articles have been written on this topic. Most are outdated, and the few recent ones are missing key information.