Skip to content

Instantly share code, notes, and snippets.

@amacgillivray
amacgillivray / fast-perfect-solving-haskell.md
Last active January 12, 2025 05:50
Fast Perfect Number Solving with Euclid-Euler and Miller-Rabin

Solving Perfect Numbers Quickly with Haskell

Walking through the stages of optimizing a perfect-number algorithm; starting with a naive approach, rewriting to use the Euclid-Euler theorem, and then leveraging the Miller-Rabin primality test.

A Frustratingly Naive Solution

On a dark and stormy night in Kansas, many years ago, I sat in front of my laptop - face lit only by the screen.

A homework assignment had tasked us with writing a basic haskell function to find every perfect number between 1 and 9000. We weren't studying numbers, nor did we discuss perfect numbers in class. The number "9000" was chosen as the upper limit due to the complexity associated with finding perfects using typical methods.

@storopoli
storopoli / keymap.json
Last active June 6, 2025 10:24
Zed Configs
// Zed keymap
//
// For information on binding keys, see the Zed
// documentation: https://zed.dev/docs/key-bindings
//
// To see the default key bindings run `zed: open default keymap`
// from the command palette.
[
{
"context": "Pane",

DHCP setup of a single node

TL;DR Set up your sole node Proxmox VE install as any other server - with DHCP assigned IP address. Useful when IPs are managed as static reservations or dynamic environments. No pesky scripting involved.


ORIGINAL POST DHCP setup of a single node

@ziqiq
ziqiq / com.sparrowwallet.Sparrow.md
Last active November 18, 2024 19:03
Sparrow wallet flatpak manifest

Installation for End User

  1. Install flatpak builder
flatpak install --user org.flatpak.Builder
  1. Build and install the Sparrow manifest
@storopoli
storopoli / object_safety.rs
Created July 8, 2024 12:38
Rust: Object Safe Traits
// In general there are two properties for traits to satisfy
// in order them to be object-safe:
//
// 1. The return type isn’t Self.
// 2. There are no generic type parameters.
// Here's an example of a non-object-safe Trait
trait MyTrait {
fn f(&self) -> Self;

Crippling Facebook

Facebook works with advertisers to target you. These instructions are one of the many ways to begin crippling that relationship. When AI targeting is crippled, your psychosecurity improves :)

  1. On your desktop machine, goto https://accountscenter.facebook.com/ads/audience_based_advertising
  2. Maximize the browser window
  3. Press F12 and click on the Console tab
  4. Select the code below, copy it, paste it upon the Console line (The area next to the > character in the Console window), and press enter:
@nikolovlazar
nikolovlazar / keybindings.json
Last active June 18, 2025 12:45
VSCode key bindings to navigate like Neovim
[
// Navigation
{
"key": "ctrl-h",
"command": "workbench.action.navigateLeft"
},
{
"key": "ctrl-l",
"command": "workbench.action.navigateRight"
},
@lavafroth
lavafroth / config.toml
Created March 27, 2024 03:10
Helix config for lazygit integration
[keys.normal]
C-g = [":new", ":insert-output lazygit", ":buffer-close!", ":redraw"]
@storopoli
storopoli / .gitignore
Last active March 18, 2025 22:44
Minimal Neovim config
lazy-lock.json
@storopoli
storopoli / alpine.json
Last active November 16, 2024 11:34
Devcontainers Configs
{
"name": "Alpine",
"image": "mcr.microsoft.com/devcontainers/base:alpine",
"postCreateCommand": "sudo apk update && sudo apk add <PKGS>"
}