Skip to content

Instantly share code, notes, and snippets.

@floehopper
floehopper / fix-pdf.sh
Created July 12, 2026 09:29
Fix Nest Pensions annual statement PDF on MacOS
gs -sDEVICE=pdfwrite -dNOPAUSE -dBATCH -o repaired.pdf broken.pdf
@floehopper
floehopper / git-rebase-exec.sh
Created June 9, 2026 08:11
Add Co-authored-by trailer to a series of commits
git rebase <parent-branch> --exec 'git commit --amend --no-edit --trailer "Co-authored-by=Joe Bloggs <joe.bloggs@example.com>"'
@floehopper
floehopper / ovni-info.md
Last active February 4, 2026 13:36
Most important things when buying a used Ovni from the mid-1980s

What are the most important things to look at when buying a used OVNI from the mid-eighties? I am thinking of damages, corrosion and wear. Are there other things to keep in mind as well?

  1. Hull & Structure (Aluminium-specific)
    • Electrolytic / galvanic corrosion – especially around:
    • Through-hulls
    • Keel / centreboard pivots and bearings
    • Rudder stocks and skeg
    • Engine beds and saildrive apertures (if fitted)
    • Pitting under paint or insulation – water trapped behind foam or lining can hide corrosion.
  • Welds and frames – look for cracking around high-load areas (chainplates, keel box, mast step).
#!/usr/bin/env zsh
SRC_ROOT="???"
DST_ROOT="???"
find "$SRC_ROOT" \
\( -type d -name node_modules -prune \) -o \
\( -mindepth 4 -maxdepth 4 -type f -name "master.key" \
-print \) | while read -r file; do
#!/usr/bin/env zsh
SRC_ROOT="???"
DST_ROOT="???"
find "$SRC_ROOT" \
\( -type d -name node_modules -prune \) -o \
\( -mindepth 3 -maxdepth 3 -type f \( \
-name ".env" -o \
-name "mise.toml" -o \
@floehopper
floehopper / erb-lint-formatter
Created March 2, 2025 12:50
Formatter suitable for zed editor using erb_lint gem
#!/usr/bin/env sh
bundle exec erb_lint --autocorrect --stdin $1 2>/dev/null | sed '1,/^================/d'
@floehopper
floehopper / last-quarter-using-liquid-template.rb
Last active January 19, 2025 13:51
Liquid template to generate a string representation of the last quarter, e.g. Q4 2024
require 'bundler/inline'
gemfile do
source 'https://rubygems.org'
gem 'liquid'
gem 'base64'
end
require 'date'
require 'liquid'
@floehopper
floehopper / download
Created November 16, 2024 10:52
Download file using multiple parallel Range requests
#!/usr/bin/env ruby
require "bundler/inline"
gemfile do
source "https://rubygems.org"
gem "typhoeus"
end
require "uri"
@floehopper
floehopper / liquid-templates-and-date-formats.rb
Created July 24, 2024 12:36 — forked from chrisroos/liquid-templates-and-date-formats.rb
Playing with date formatting in liquid templates - Useful in Harmonia task titles
require 'bundler/inline'
gemfile do
source 'https://rubygems.org'
gem 'liquid'
end
require 'date'
require 'liquid'
@floehopper
floehopper / inspect-retrying-jobs-in-sidekiq.rb
Created June 14, 2023 11:13
Inspect retrying jobs in Sidekiq
require 'sidekiq/monitor'
Sidekiq::RetrySet.new.each do |job|
p [job.display_class, job.display_args]
end