Skip to content

Instantly share code, notes, and snippets.

View fionn's full-sized avatar
🦨
wars are waged by technicians

Fionn fionn

🦨
wars are waged by technicians
View GitHub Profile
@fionn
fionn / ibl_clone.lua
Created December 24, 2025 13:15
YAML indent guides in Neovim
vim.api.nvim_create_autocmd("FileType", {
desc = "Meta-level YAML indent guides",
pattern = "yaml",
group = vim.api.nvim_create_augroup("indent_guides", {clear = true}),
callback = function()
vim.api.nvim_create_autocmd('BufWinEnter', {
group = "indent_guides",
callback = function(args)
local char = "" .. (" "):rep(vim.bo[args.buf].shiftwidth - 1)
vim.opt_local.listchars:append({ leadmultispace = char })
rw [four_eq_succ_three]
rw [three_eq_succ_two]
repeat rw [two_eq_succ_one]
repeat rw [one_eq_succ_zero]
repeat rw [add_succ]
repeat rw [add_succ]
rw [add_zero]
rfl
@fionn
fionn / kagi.nvim.lua
Created September 27, 2025 09:46
Search Kagi from Neovim
-- Very simple way to search Kagi from Neovim.
-- Saving as a gist because I don't actually use it.
vim.api.nvim_create_user_command("Kagi", function(q)
vim.ui.open("https://kagi.com/search?q=" .. vim.uri_encode(q.args))
end, {nargs = 1, desc = "Search Kagi"})
#!/usr/bin/env bash
set -eo pipefail
function main {
local threshold="${1:-2}"
local -r pattern="${2:-*}"
((threshold++))
@fionn
fionn / nuphy_air75_v2.remapped.json
Created October 6, 2024 10:59
Nuphy Air75 V2 function keys and menu for print area
{
"name": "NuPhy Air75 V2",
"vendorProductId": 435499590,
"macros": ["", "", "", "", "", "", "", "", "", "", "", "", "", "", "", ""],
"layers": [
[
"KC_ESC",
"KC_F1",
"KC_F2",
"KC_F3",
#!/usr/bin/env python
from dataclasses import dataclass
@dataclass
class Map:
code_point: str
character: str
command: str
alt_command: str
@fionn
fionn / .gitignore
Last active June 23, 2024 17:25
Find metadata of images embedded in PDFs
venv/
__pycache__/
.mypy_cache/
@fionn
fionn / aws-sso-list-accounts
Created June 7, 2024 12:43
List AWS SSO accounts
#!/bin/bash
set -euo pipefail
access_token="$(jq -r .accessToken < $(ls -1U ~/.aws/sso/cache/*.json | head -n 1))"
aws sso list-accounts --access-token "$access_token" --output table
@fionn
fionn / pem.regex
Created September 1, 2023 15:44
Hyperscan-compatible regex patterns for private keys
(-----BEGIN ([A-Z0-9]+ )?PRIVATE KEY-----)(\s*[A-Za-z0-9+/\r\n]+={0,2})(\s*-----END ([A-Z0-9]+ )?PRIVATE KEY-----)
@fionn
fionn / stdin.sh
Created June 27, 2023 14:38
Flexible inputs for Bash scripts
#!/bin/bash
set -euo pipefail
function process {
return 0
}
function main {
mapfile -t inputs < <(echo "${1:-$(</dev/stdin)}")