Skip to content

Instantly share code, notes, and snippets.

@RoseSecurity
Created April 21, 2026 20:40
Show Gist options
  • Select an option

  • Save RoseSecurity/6265a6373f44138a5c9d86a4d84b4a38 to your computer and use it in GitHub Desktop.

Select an option

Save RoseSecurity/6265a6373f44138a5c9d86a4d84b4a38 to your computer and use it in GitHub Desktop.
A compilation of handy utilities for everyday developer tasks.
#!/bin/bash
# Create Git branches from Jira tickets
# Ensure gum is installed
if ! command -v gum &> /dev/null; then
echo "gum could not be found, please install it first."
exit 1
fi
if ! command -v jira &> /dev/null; then
echo "jira could not be found, please install it first."
exit 1
fi
# Accept argv[1] as the Jira ticket ID or prompt the user for input
TICKET_ID=$1
if [ -z "$TICKET_ID" ]; then
TICKET_ID=$(gum input --placeholder "Enter Jira Ticket ID" | xargs -L1 echo)
if [ -z "$TICKET_ID" ]; then
echo "No Jira Ticket ID provided. Exiting."
exit 1
fi
fi
# Fetch Jira ticket details
ISSUE_DETAILS=$(gum spin --spinner dot --title "Fetching Jira Ticket Details..." \
-- bash -c "jira issue view '$TICKET_ID' --plain")
if [ -z "$ISSUE_DETAILS" ]; then
echo "No matching Jira ticket found for ID: $TICKET_ID"
exit 1
fi
TITLE=$(
echo "$ISSUE_DETAILS" \
| grep -E '^[[:space:]]*#[[:space:]]' \
| head -n 1 \
| sed 's/^[[:space:]]*#[[:space:]]*//'
)
# Create a lowercase slug from the title
TITLE_SLUG=$(
echo "$TITLE" \
| tr '[:upper:]' '[:lower:]' \
| xargs \
| tr ' ' '-' \
| tr -cd '[:alnum:]-'
)
# Convert TICKET_ID to uppercase (so MSSCI, ABC, etc. are capitalized)
TICKET_ID_UPPER=$(echo "$TICKET_ID" | tr '[:lower:]' '[:upper:]')
# Create final branch name like "MSSCI-6416-some-description"
BRANCH_NAME="${TICKET_ID_UPPER}-${TITLE_SLUG}"
echo "Creating branch: $BRANCH_NAME"
git checkout -b "$BRANCH_NAME"
#!/usr/bin/env bash
# Utility for starting the day with my apps
APPS=("Firefox" "Microsoft Teams" "Microsoft Outlook" "Slack" "Leapp")
for app in "${APPS[@]}"; do
# If the app is open, don't open it again
if ! pgrep "$app" &> /dev/null; then
open -a "$app"
fi
# Hide Teams and Outlook on the dock
if [ "$app" == "Microsoft Teams" ] || [ "$app" == "Microsoft Outlook" ]; then
osascript -e "tell application \"System Events\" to set visible of processes where name is \"$app\" to false"
fi
done
#!/usr/bin/env bash
set -euo pipefail
# A utility for getting up and running with a clean Library cache, updating brew packages, and pruning Docker resources
# Check dependencies
for cmd in gum brew docker; do
if ! command -v "$cmd" &>/dev/null; then
echo "$(tput setaf 1)Error: $cmd is not installed$(tput sgr0)" >&2
exit 1
fi
done
# Clean Library Caches
gum spin --spinner dot --title "Cleaning Library Caches..." -- rm -rf ~/Library/Caches/*/
# Update Homebrew (separate commands for proper error handling)
gum spin --spinner dot --title "Updating Homebrew..." -- brew update
gum spin --spinner dot --title "Upgrading Homebrew Packages..." -- brew upgrade
gum spin --spinner dot --title "Cleaning Homebrew Cache..." -- brew cleanup --prune=all
# Prune Docker (only if daemon is running)
if docker info &>/dev/null; then
gum spin --spinner dot --title "Pruning Docker Resources..." -- docker system prune --all --force
else
echo "$(tput setaf 3)Skipping Docker prune (daemon not running)$(tput sgr0)"
fi
echo "$(tput setaf 2)Done!$(tput sgr0)"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment