Skip to content

Instantly share code, notes, and snippets.

@goliney
goliney / .bash_profile
Last active August 30, 2022 01:45
Terminal shortcuts for clearing local git branches
# delete all git branches except main
function delete_all_branches_git() {
git checkout main
git branch | grep -v "main" | xargs git branch -D
}
# delete all git branches which start with prefix (except main)
function delete_branches_by_prefix_git() {
git checkout main
git branch | grep -v "main" | grep "$1" | xargs git branch -D
@goliney
goliney / listFiles.js
Last active May 25, 2020 20:33
Get list of files and directories
const path = require('path');
const fs = require('fs');
/*
Possible usage:
node listFiles.js >> files.json
Don't forget to edit rootDirPath first.
*/