Skip to content

Instantly share code, notes, and snippets.

View icorbrey's full-sized avatar
🧬
who up tanglin they repos

Isaac Corbrey icorbrey

🧬
who up tanglin they repos
View GitHub Profile
{
"did": "did:plc:zviscnpwyvj6y32agi5davn5"
}
general:
# Commands to run when the WM has started. This is useful for running a
# script or launching another application.
# Example: The below command launches Zebar.
startup_commands: ['shell-exec zebar']
# Commands to run just before the WM is shutdown.
# Example: The below command kills Zebar.
shutdown_commands: ['shell-exec taskkill /IM zebar.exe /F']
@icorbrey
icorbrey / changelog.nu
Last active May 24, 2025 10:36
Generates nicely formatted changelogs from a Jujutsu revset. Requires nushell and semantic commits. Config: `aliases.changelog = ["util", "exec", "nu", "~/.config/jj/scripts/changelog.nu"]` (with whatever your script path is)
# ╔══════════════════════════════════════════════════════════════════════════╗
# β•‘ changelog.nu – produce collapsible-Markdown release notes from jj log β•‘
# β•‘ β•‘
# β•‘ Usage: nu changelog.nu [<revset>] β•‘
# β•‘ – <revset> always appends "~empty()" to drop empty commits. β•‘
# β•‘ Needs: Nushell 0.91+ β€’ jj 0.24+ β•‘
# β•šβ•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•
export def main [revset: string] {
; # Home Row Mods
;
; See: <https://precondition.github.io/home-row-mods>
;
; ## Layout
;
; This script uses the GASC ordering, or GUI - Alt - Ctrl - Shift.
;
; Key: Mod/Tap
;
@icorbrey
icorbrey / TicTacToe.cs
Created October 3, 2023 19:24
A playable game of Tic Tac Toe in the terminal. Written in C#.
#pragma warning disable CS8524
string[] TEMPLATES = {
"┏━━━┱───┬───┐\n┃ A ┃ B β”‚ C β”‚\n┑━━━╃───┼────\nβ”‚ D β”‚ E β”‚ F β”‚\nβ”œβ”€β”€β”€β”Όβ”€β”€β”€β”Όβ”€β”€β”€β”€\nβ”‚ G β”‚ H β”‚ I β”‚\nβ””β”€β”€β”€β”΄β”€β”€β”€β”΄β”€β”€β”€β”˜", // (1, 1) selectedTile
"β”Œβ”€β”€β”€β”²β”β”β”β”±β”€β”€β”€β”\nβ”‚ A ┃ B ┃ C β”‚\nβ”œβ”€β”€β”€β•„β”β”β”β•ƒβ”€β”€β”€β”€\nβ”‚ D β”‚ E β”‚ F β”‚\nβ”œβ”€β”€β”€β”Όβ”€β”€β”€β”Όβ”€β”€β”€β”€\nβ”‚ G β”‚ H β”‚ I β”‚\nβ””β”€β”€β”€β”΄β”€β”€β”€β”΄β”€β”€β”€β”˜", // (2, 1) selectedTile
"β”Œβ”€β”€β”€β”¬β”€β”€β”€β”²β”β”β”β”“\nβ”‚ A β”‚ B ┃ C ┃\nβ”œβ”€β”€β”€β”Όβ”€β”€β”€β•„β”β”β”β”©\nβ”‚ D β”‚ E β”‚ F β”‚\nβ”œβ”€β”€β”€β”Όβ”€β”€β”€β”Όβ”€β”€β”€β”€\nβ”‚ G β”‚ H β”‚ I β”‚\nβ””β”€β”€β”€β”΄β”€β”€β”€β”΄β”€β”€β”€β”˜", // (3, 1) selectedTile
"β”Œβ”€β”€β”€β”¬β”€β”€β”€β”¬β”€β”€β”€β”\nβ”‚ A β”‚ B β”‚ C β”‚\n┒━━━╅───┼────\n┃ D ┃ E β”‚ F β”‚\n┑━━━╃───┼────\nβ”‚ G β”‚ H β”‚ I β”‚\nβ””β”€β”€β”€β”΄β”€β”€β”€β”΄β”€β”€β”€β”˜", // (1, 2) selectedTile
"β”Œβ”€β”€β”€β”¬β”€β”€β”€β”¬β”€β”€β”€β”\nβ”‚ A β”‚ B β”‚ C β”‚\nβ”œβ”€β”€β”€β•†β”β”β”β•…β”€β”€β”€β”€\nβ”‚ D ┃ E ┃ F β”‚\nβ”œβ”€β”€β”€β•„β”β”β”β•ƒβ”€β”€β”€β”€\nβ”‚ G β”‚ H β”‚ I β”‚\nβ””β”€β”€β”€β”΄β”€β”€β”€β”΄β”€β”€β”€β”˜", // (2, 2) selectedTile
"β”Œβ”€β”€β”€β”¬β”€β”€β”€β”¬β”€β”€β”€β”\nβ”‚ A β”‚ B β”‚ C β”‚\nβ”œβ”€β”€β”€β”Όβ”€β”€β”€β•†β”β”β”β”ͺ\nβ”‚ D β”‚ E ┃ F ┃\nβ”œβ”€β”€β”€β”Όβ”€β”€β”€β•„β”β”β”β”©\nβ”‚ G β”‚ H β”‚ I β”‚\nβ””β”€β”€β”€β”΄β”€β”€β”€β”΄β”€β”€β”€β”˜", // (3, 2) selectedTile
"β”Œβ”€β”€β”€β”¬β”€β”€β”€β”¬β”€β”€β”€β”\nβ”‚ A β”‚ B β”‚ C β”‚\nβ”œβ”€β”€β”€β”Όβ”€β”€β”€β”Όβ”€β”€β”€β”€\nβ”‚ D β”‚ E β”‚ F β”‚\n┒━━━╅───┼────\n┃ G ┃ H β”‚ I β”‚\nβ”—β”β”β”β”Ήβ”€β”€β”€β”΄β”€β”€β”€β”˜", // (1, 3) selectedTile
export type Option<T> = {
unwrap: (message?: string) => T
match: <R>(matchers: OptionMatchers<T, R>) => R
}
type OptionMatchers<T, R> = {
onSome: (value: T) => R
onNone: () => R
}
/**
* Generates a hash code from the given string using the `cyrb53` hashing
* algorithm.
*
* @param {string} str
* @param {number=} seed
*/
export const hashCode = (str, seed = 0) => {
let h1 = 0xdeadbeef ^ seed;
#!/bin/bash
compare='dev'
min_commits_ahead=5
max_commits_behind=500
max_time_elapsed="$((30 * 24 * 60 * 60))"
git fetch origin 2> /dev/null
branches="$(\
git remote show origin \
@icorbrey
icorbrey / timer.cpp
Created September 2, 2021 13:08
High resolution timer for algorithm development
#include "timer.hpp"
using namespace std;
using namespace std::chrono;
timer::timer()
{
this->hasRun = false;
this->start = high_resolution_clock::now();
}
type LocaleStrings<K extends string> = {
[key in K]: string
}
type LocaleArea<A extends string, S extends string | number> = {
[K in `@${A}/${S}`]: string
}
const area = <A extends string, K extends string>(area: A, strings: LocaleStrings<K>): LocaleArea<A, K> =>
Object.keys(strings)