Skip to content

Instantly share code, notes, and snippets.

View Fordi's full-sized avatar

Bryan Elliott Fordi

View GitHub Profile
@Fordi
Fordi / revise
Last active March 12, 2026 20:30
Script to in-place modify any file using a pipe transform
#!/usr/bin/env bash
FILE="$1"; shift
SUB="${SUB:-{}}"
if [[ -z "$FILE" || $# -eq 0 || "$1" == "-h" || "$1" == "--help" ]]; then cat >&2 << EOF
Revise a file in-place. Basically, sed's \`-i\` flag, but for any command.
Usage:
revise 𝘧𝘪𝘭𝘦 ...𝘤𝘮𝘥
the content of 𝘧𝘪𝘭𝘦 will be passed to 𝘤𝘮𝘥 on stdin, or if \`${SUB}\` is present in the argument list,
the filename will be passed. The substitution string can be changed by setting the SUB
Chaotic Neutral Lawful
Evil Vecna Kay Brenner
Billy Mind Flayer Akers
———— ———— —————— ————
Neutral Erica Eleven Owens
Karen Jonathan
Argyle
———— ———— —————— ————
Good Max Steve Hop
@Fordi
Fordi / twitter-blocks.json
Last active June 14, 2024 14:26
So much better, but not near enough
[
"011B777",
"01sandyshook",
"0311mcp",
"0ctoberReignz",
"0foks",
"0ryuge",
"0xOliverWong31",
"10_03_23_ABC",
"10k__gold",
@Fordi
Fordi / arcade-layout.svg
Last active June 23, 2023 16:10
Arcade layout
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@Fordi
Fordi / git-ident-wrap.sh
Last active June 6, 2023 16:17
Identity config for git
# For easily managing your SSH identity for github.
#
# 1. Source this script in your .profile or .bashrc
# 2. Run `git config user.identity=/path/to/keyfile` in each repository you want to be using a non-default SSH identity
# 3. Git around as usual.
function git() {
local git="$(which git)"
local cmd=("$git" "${@}")
local ident="$("$git" config user.identity)"

Keybase proof

I hereby claim:

  • I am fordi on github.
  • I am fordiman (https://keybase.io/fordiman) on keybase.
  • I have a public key ASBlGL04vAv2m8ZfucjiLx4YD7hZmjqlgmY_2KJu_eY9BAo

To claim this, I am signing this object:

#include <Stepper.h>
#include <math.h>
#include <Servo.h>
#include <Wire.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>
#include <stdint.h>
#define SCREEN_WIDTH 128 // OLED display width, in pixels
#define SCREEN_HEIGHT 32 // OLED display height, in pixels
@Fordi
Fordi / build-spritesheet.js
Created October 20, 2021 19:54
node script to convert an image into a spritesheet C++ header suitable for picosystem
#!/usr/bin/env node
const getPixels = require('get-pixels');
const { basename } = require('path');
const { writeFile } = require('fs/promises');
const pixels = async src => new Promise((resolve, reject) => {
getPixels(src, (err, pixels) => {
if (err) return reject(err);
return resolve(pixels);
});