Skip to content

Instantly share code, notes, and snippets.

@ohlrogge
ohlrogge / Profile.ps1
Created February 4, 2025 08:24
Set alias for each PowerShell session
# Store under $HOME\Documents\PowerShell\Profile.ps1
Set-Alias -Name k kubectl
@ohlrogge
ohlrogge / batch-convert-pdf-to-jpg-and-svg.sh
Last active December 22, 2024 20:15
Batch Convert PDF to JPG and SVGs
#!/bin/bash
# This script requires ghostscript and pdf2svg to be installed
# Use brew to install ghostscript and pdf2svg on macOS
# brew install ghostscript pdf2svg
# In the terminal, navigate to the directory containing the PDFs you want to convert
# Make the script executable by running 'chmod +x batch-convert-pdf-to-jpg-and-svg.sh'
# Run the script by running './batch-convert-pdf-to-jpg-and-svg.sh'
# Create directories for output files
@ohlrogge
ohlrogge / git-delete-all-local-branches.md
Last active December 22, 2024 19:35
git: Deleting all local branches at once

Sometimes you just want to clean up your local branches after you've pushed everything to orign.

The following command deletes all local branches:

git branch | grep -v main | xargs git branch -d

The single commands in detail:

  • git branch lists all local branches