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 July 14, 2025 13:55
Zed Configs
// Zed settings
//
// For information on how to configure Zed, see the Zed
// documentation: https://zed.dev/docs/configuring-zed
//
// To see all of Zed's default settings without changing your
// custom settings, run `zed: open default settings` from the
// command palette (cmd-shift-p / ctrl-shift-p)
{
"ui_font_size": 16,

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 July 10, 2025 19:33
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 / init.lua
Last active July 27, 2025 14:29
Minimal Neovim config
-------------------------------------------------------------------------------
-- DEPENDENCIES
-- neovim ripgrep fd fzf
-- LSPs: rust-analyzer clangd taplo yaml-language-server
-- vscode-html-languageserver vscode-css-languageserver vscode-json-languageserver
-- pyright ruff lua-language-server typescript-language-server
-- bash-language-server tinymist
-------------------------------------------------------------------------------
-------------------------------------------------------------------------------
@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>"
}