Skip to content

Instantly share code, notes, and snippets.

View mike-callahan's full-sized avatar

Michael Callahan mike-callahan

  • EssentialAILabs
  • Seattle, Washington
View GitHub Profile
@mike-callahan
mike-callahan / h100.tf
Last active March 18, 2024 19:05
Terraform example of a GCP MIG to be used with Dynamic Workload Scheduler (resize requests)
module "gpudirect" {
source = "git::https://github.com/GoogleCloudPlatform/professional-services.git//examples/gpudirect-tcpx"
project_id = "PROJECT-ID"
region = "us-central1"
}
data "google_service_account" "sa" {
account_id = "[email protected]"
}
@mike-callahan
mike-callahan / logger.sh
Created September 3, 2025 04:02
Simple bash logger
# -------------------------------------------------------------------
# log: simple logger with timestamp, log levels, and color support
#
# Usage:
# log "message"
# log INFO "message"
# log WARN "message with \nnewlines"
# log ERROR "something went wrong"
# log DEBUG "debug info"
#
@mike-callahan
mike-callahan / gist:e42969d2fe775d2be544b3ff15f898db
Last active October 17, 2025 17:43
Git Save - A bash function that pushes your exact working state to a development branch without touching your staging area (its like control-S for git!)
git-save() { (
# Safe options scoped to subshell
set -e
set -u
set -o pipefail 2>/dev/null || true
# Configuration (add flags later if you want)
REMOTE="origin"
SNAPSHOT_BRANCH="snapshot/${USER:-dev}"
INCLUDE_IGNORED="false"