Skip to content

Instantly share code, notes, and snippets.

View levijubb's full-sized avatar

Levi levijubb

  • 127.0.0.1
View GitHub Profile
@levijubb
levijubb / clean-sweep.sh
Last active May 13, 2026 02:30
🧹 Clean up merged local git branches
git branch --merged | grep -v "\*" | grep -v "main" | xargs -n 1 git branch -d
@levijubb
levijubb / gc.sh
Created December 18, 2025 02:06
Quick checkout to a branch based on regex string. Fzf selection if >1 matches
gc() {
if [[ -z "$1" ]]; then
echo "Usage: gc <search>"
return 1
fi
local matches
matches=$(git branch --list | sed 's/^..//' | grep -i "$1")
if [[ -z "$matches" ]]; then
@levijubb
levijubb / gopro-cleanup.py
Created March 27, 2025 04:53
Raycast script to remove unnecessary files on GoPro SD card.
#!/usr/bin/env python3.11
# Required parameters:
# @raycast.schemaVersion 1
# @raycast.title GoPro Cleanup
# @raycast.mode fullOutput
# Optional parameters:
# @raycast.icon 🎥
@levijubb
levijubb / BackupDatabases.ps1
Last active March 19, 2025 04:30
Automates backup of specified Microsoft SQL Server databases to a specified directory. Script will make backups with timestamps and remove backup files older than 7 days.
<#
.SYNOPSIS
Backs up specified SQL Server databases to a local directory with timestamped filenames,
compresses the backups, and deletes old backups after 7 days.
.DESCRIPTION
This script automates the backup of multiple SQL Server databases to disk, appends a timestamp
to each backup file, compresses them into ZIP archives, and removes backups older than 7 days.
The script uses sqlcmd for database backups and PowerShell for file management.