Skip to content

Instantly share code, notes, and snippets.

View ericboehs's full-sized avatar

Eric Boehs ericboehs

  • Oddball
  • Enid, OK
  • 02:15 (UTC -05:00)
View GitHub Profile
@ericboehs
ericboehs / devin
Created June 5, 2025 02:03
Lightweight Devin CLI in Bash with fzf session selection
#!/usr/bin/env bash
#
# Lightweight Devin CLI in Bash
#
# Usage:
# devin new "<prompt>"
# devin message <session_id> "<text>"
# devin list [--all]
#
@ericboehs
ericboehs / watch_and_pull.sh
Created June 4, 2025 22:14
Watch and pull script that monitors git repository for changes and opens localhost:3000 when updates are detected
#!/bin/bash
# Function to open localhost:3000
open_localhost() {
echo "Changes detected! Opening localhost:3000..."
if command -v open >/dev/null 2>&1; then
open http://localhost:3000
elif command -v xdg-open >/dev/null 2>&1; then
xdg-open http://localhost:3000
else
@ericboehs
ericboehs / ssm-param-archive
Last active May 13, 2025 16:32
A Zsh script (ssm-param-archive) to move AWS SSM parameters from a source prefix into an “archived” prefix.
#!/usr/bin/env zsh
set -euo pipefail
# ─── Defaults & ENV Override ────────────────────────────────────────────────────
SOURCE_PREFIX="${SOURCE_PREFIX:-/dsva-vagov/vets-api}"
ARCHIVE_PREFIX="${ARCHIVE_PREFIX:-/dsva-vagov/vets-api/archived}"
DRY_RUN=false
UNARCHIVE=false
usage() {
@ericboehs
ericboehs / gh-job-attempts
Last active April 26, 2025 15:17
🔎 Quickly list and inspect all attempts for a job in a GitHub Actions run, with options to output full links or job IDs. Handy for debugging retries.
#!/usr/bin/env bash
set -euo pipefail
usage() {
cat <<EOF
Usage: $(basename "$0") [options] <github-actions-run-url>
Options:
--only-links Only print the job links
--only-job-ids Only print the job IDs
@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."