Skip to content

Instantly share code, notes, and snippets.

View ericboehs's full-sized avatar

Eric Boehs ericboehs

  • Oddball
  • Enid, OK
  • 00:50 (UTC -05:00)
View GitHub Profile
@ericboehs
ericboehs / post-checkout
Created April 22, 2025 13:48
Git hook for Rails projects that ensures dependencies are up-to-date and reminds devs to run pending migrations after switching branches
#!/usr/bin/env bash
set -euo pipefail
# Exit during rebases, merges, or detached HEADs
if [ -d .git/rebase-merge ] || [ -d .git/rebase-apply ] || [ -f .git/MERGE_HEAD ] || ! git symbolic-ref -q HEAD >/dev/null; then
echo "🔁 Skipping post-checkout hook (rebase/merge or detached HEAD)"
exit 0
fi
@ericboehs
ericboehs / ssm-param-envs
Created April 17, 2025 17:32
Check existence and access of SSM parameters in multiple AWS environments
#!/usr/bin/env bash
# Usage: ssm-param-envs /path/one /path/two ...
# Define the environments to iterate over
environments=("dev" "staging" "sandbox" "prod")
# Create a dynamic regex for sed substitution, escaping slashes
env_pattern="$(IFS='|'; echo "${environments[*]}")"
escaped_env_pattern="\\/(${env_pattern})\\/" # Example: \/(dev|staging|sandbox|prod)\/
@ericboehs
ericboehs / ssm-param-history
Created April 15, 2025 22:18
🔍 ssm-param-history – View Recently Updated AWS SSM Parameters
#!/usr/bin/env zsh
###############################################################################
# ssm-param-history
#
# Description:
# Inspect recently updated AWS SSM parameters under a given base path. Uses a
# local twenty-minute cache to avoid redundant API calls. Parameters can be
# selected interactively via fzf or printed directly in a clean, sorted list.
# (Using --no-fzf won't fetch additional metadata, just the parameter names.)
@ericboehs
ericboehs / youtube-vim-navigation.user.js
Last active April 2, 2025 13:06
YouTube Vim-style Keyboard Navigation UserScript
// ==UserScript==
// @name YouTube Keyboard Navigation
// @namespace http://tampermonkey.net/
// @version 1.1
// @description Navigate YouTube videos with Vim-style keys and open with Enter or Cmd+Enter
// @match https://www.youtube.com/*
// @match https://www.youtube.com/feed/*
// @grant none
// ==/UserScript==
@ericboehs
ericboehs / github-to-zenhub-link-v2.js
Created November 20, 2024 20:58
Adds a button to GitHub issues to redirect you to ZenHub
@ericboehs
ericboehs / generate_video_with_voice.rb
Last active September 13, 2024 02:13
Generates a video for my daughters to use to study for their vocab tests. Use OpenAI for TTS.
require 'json'
require 'fileutils'
require 'net/http'
require 'uri'
require 'digest'
OPENAI_API_KEY = ENV['OPENAI_API_KEY']
if OPENAI_API_KEY.nil? || OPENAI_API_KEY.empty?
puts "Error: OPENAI_API_KEY environment variable is not set."
@ericboehs
ericboehs / gh_pr_userscript.js
Last active August 26, 2024 20:07
GitHub PR Review Helpers
// ==UserScript==
// @name GitHub PR Review Actions
// @namespace http://tampermonkey.net/
// @version 1.0
// @description Adds buttons to help review
// @author Eric Boehs
// @match https://github.com/*/*/pull/*
// @run-at document-ready
// @inject-into content
// ==/UserScript==
@ericboehs
ericboehs / va-docs-userscript.js
Created July 17, 2024 20:57
Focus VA Platform Docs Search results
// ==UserScript==
// @name Tab Focus through VA Platform Documentation Search Results
// @description Use the tab key to navigate through VA Platform Documentation Search Results
// @version 1.0.0
// @match *://depo-platform-documentation.scrollhelp.site/search.html*
// @include *://depo-platform-documentation.scrollhelp.site/search.html*
// @grant none
// @author ericboehs [email protected]
// @namespace ericboehs
// ==/UserScript==
@ericboehs
ericboehs / kiwix-add.sh
Last active April 2, 2024 20:03
Sync with Kiwix.org and update zim files
#!/bin/bash
xml="/volume1/kiwix-share/"
library="/volume1/kiwix-share/"
log=($(find $library -name '*.zim' | sort))
if [ -f "$xml/library.log" ]; then
IFS=$'\n' read -d '' -r -a oldlog < "$xml/library.log"
fi
if [[ "${log[@]}" == "${oldlog[@]}" ]]; then
@ericboehs
ericboehs / ghmpr
Last active February 14, 2024 16:50
#! /usr/bin/env bash
# Ensure GitHub CLI and jq are installed
if ! command -v gh &> /dev/null || ! command -v jq &> /dev/null; then
echo "Error: This script requires the GitHub CLI (gh) and jq to be installed."
exit 1
fi
# Optional: Define GIT_DEFAULT_BRANCH if not set in the environment
if [ -z "$GIT_DEFAULT_BRANCH" ]; then