Skip to content

Instantly share code, notes, and snippets.

@ahgraber
ahgraber / open-in-vscode.md
Last active February 25, 2022 14:43
Open folder in VSCode

Steps

  1. Launch Automator
  2. Create New Document
  3. Create a new Quick Action (Select "Quick Action")
  4. Add the Action Workflow receives current files or folders in Finder
  5. If desired, add custom image/icon (see comment below)
  6. Add a new Run Shell Script action to the workflow.
  7. Configure the Workflow
@ahgraber
ahgraber / latest.md
Last active May 19, 2022 13:17
Latest github release
@ahgraber
ahgraber / README.md
Last active January 16, 2023 14:11
Clean up GitHub Actions workflow runs

Cleanup legacy GitHub Actions workflow runs

Python utility to delete GitHub Actions runs for a repository, based on parameters. The GitHub UI currently allows removal of individual workflow runs, but this becomes tedious with a bulk of previous runs. Credit: https://gist.github.com/magnetikonline/2242eb18bf8890e9fc72b3c3ef41bd93

Usage

  1. Create a Personal access token allowing the workflow scope:
  2. Execute the script against a target GitHub repository (with optional parameters).
@ahgraber
ahgraber / loc.sh
Created March 1, 2023 14:17
Get lines of code across multiple repos
#!/bin/bash
## assumes "multiple repos" are all in the same parent directory, which is also the current working directory
# set up git
for dir in ./*/; do
dir=${dir%*/} # remove the trailing "/"
cd "$dir"
echo "$dir"
git fetch -p && git pull
@ahgraber
ahgraber / README.md
Created December 30, 2023 16:50
Editing Customize TimeMachine Exclusions

Customize TimeMachine Exclusions

Add exclusions by dirname

find $(pwd) -type d -name <NAME> -maxdepth 3 -exec tmutil addexclusion {} \;

Automate exclusions