Skip to content

Instantly share code, notes, and snippets.

View romac's full-sized avatar
🔮
λ

Romain Ruetschi romac

🔮
λ
View GitHub Profile
@arianvp
arianvp / SSH_MACOS_SECURE_ENCLAVES.md
Last active December 11, 2025 16:27
Native Secure Enclaved backed ssh keys on MacOS

Native Secure Enclave backed ssh keys on MacOS

It turns out that MacOS Tahoe can generate and use secure-enclave backed SSH keys! This replaces projects like https://github.com/maxgoedjen/secretive

There is a shared library /usr/lib/ssh-keychain.dylib that traditionally has been used to add smartcard support to ssh by implementing PKCS11Provider interface. However since recently it also implements SecurityKeyProivder which supports loading keys directly from the secure enclave! SecurityKeyProvider is what is normally used to talk to FIDO2 devices (e.g. libfido2 can be used to talk to your Yubikey). However you can now use it to talk to your Secure Enclave instead!

@ptman
ptman / heroku-alternatives.md
Last active November 17, 2025 23:18
Heroku alternatives
Tool / Project Type / Architecture UI / Dashboard CLI / API Multi‑node / Clustering Auto TLS / SSL / ACME Zero‑downtime / Rolling Deploy Preview / PR Environments Team / Permissions Volume / Backup Support Open Source / License Heroku‑style Compatibility Pros / Strengths Cons / Caveats / Weaknesses
Dokku Single‑server (extensions for multi) Minimal (no central UI, though plugins exist) CLI, plugin APIs Via community / plugin / custom setups Yes (Let’s Encrypt plugin) Via Docker techniques / plugin Limited, requires extra setup Basic (single admin; community plugins) Plugin / manual (e.g. volume backups) MIT (fully open source) Good: git push, buildpack style, plugins add DB, etc. Very stable, mature, lots of community extensions Scaling / multi‑node is manual; UI is weak; managing many apps / teams is harder
Dokploy Multi‑node / cluster (Docker Swarm) Yes (built‑in UI) CLI + AP
@sainoe
sainoe / local-testnet-permissionless-equivocation.sh
Last active September 20, 2024 08:02
ICS Permissionless testnet
#!/bin/bash
set -eux
## Prerequisites:
# * ICS v6.x
# * Hermes v1.10.3+45a29cc00
# User balance of stake tokens
USER_COINS="100000000000stake"
# Amount of stake tokens staked
@kubukoz
kubukoz / .scalafmt.conf
Last active December 5, 2025 20:00
How to disable significant indentation in Scala
runner.dialect = scala3
runner.dialectOverride.allowSignificantIndentation = false
# allows `if x then y`
runner.dialectOverride.allowQuietSyntax = true
@heaths
heaths / workspace-dependencies.rs
Last active February 27, 2024 09:27
Rust script to verify that package dependencies are inherited from single workspace.
#!/usr/bin/env -S cargo +nightly -Zscript
---
[package]
edition = "2021"
[dependencies]
cargo-util-schemas = "0.1.0"
serde = { version = "1.0.197", features = ["derive"] }
serde_json = "1.0.114"
toml = "0.8.10"
@o11c
o11c / every-vm-tutorial-you-ever-studied-is-wrong.md
Last active December 9, 2025 22:55
Every VM tutorial you ever studied is wrong (and other compiler/interpreter-related knowledge)

Note: this was originally several Reddit posts, chained and linked. But now that Reddit is dying I've finally moved them out. Sorry about the mess.


URL: https://www.reddit.com/r/ProgrammingLanguages/comments/up206c/stack_machines_for_compilers/i8ikupw/ Summary: stack-based vs register-based in general.

There are a wide variety of machines that can be described as "stack-based" or "register-based", but not all of them are practical. And there are a lot of other decisions that affect that practicality (do variables have names or only address/indexes? fixed-width or variable-width instructions? are you interpreting the bytecode (and if so, are you using machine stack frames?) or turning it into machine code? how many registers are there, and how many are special? how do you represent multiple types of variable? how many scopes are there(various kinds of global, local, member, ...)? how much effort/complexity can you afford to put into your machine? etc.)

  • a pure stack VM can only access the top elemen
@gelisam
gelisam / MutuCheckInfer.hs
Last active September 4, 2024 21:32
A recursion scheme for mutually-recursive types
-- Defining a custom recursion scheme to manipulate two mutually-recursive
-- types, in the context of a toy bidirectional type checker.
{-# LANGUAGE DerivingStrategies, GeneralizedNewtypeDeriving, ScopedTypeVariables #-}
module Main where
import Test.DocTest
import Control.Monad (when)
import Data.Bifunctor (Bifunctor(bimap))
import Data.Bifoldable (Bifoldable(bifoldMap), bitraverse_)
@sainoe
sainoe / change_voting_period
Last active October 17, 2022 15:59
testnet-scripts
#!/bin/bash
set -eux
```
tee ${PROV_NODE_DIR}/change-voting-period.json<<EOF
{
"title": "Change voting period",
"description": "Voting period",
"changes": [
@HipHopHuman
HipHopHuman / incremental-game-loop.md
Last active November 25, 2025 00:55
How to make a game loop for your idle game

How do I make a game loop for my Idle Game?

Interval-Based Resource Generators

So, you want to build an idle/incremental game in JavaScript and you’ve read on the internet that setInterval is the way to go when it comes to handling resources that automatically generate over time.

You get started, you write down your setInterval function, you set it to trigger once every 1000 milliseconds, and every time it triggers, you add 1 to the player’s total resource count. Perfect. It works.

Uh-oh.

@piperswe
piperswe / build_push_and_run.sh
Created April 17, 2021 01:53
Build multi-architecture Docker images with Nix
#!/bin/sh
# Required on macOS because cctools is marked as broken
export NIXPKGS_ALLOW_BROKEN=1
nix run -f image.nix -c push
docker run ghcr.io/piperswe/hello