Skip to content

Instantly share code, notes, and snippets.

View Harwood's full-sized avatar
🏴‍☠️

Harwood

🏴‍☠️
View GitHub Profile
import Foundation
enum DockerComposeCommand {
case down
case up
}
enum TailscaleServeType {
case https
case tlsTerminatedTcp
@Harwood
Harwood / cidr.fish
Last active December 20, 2022 19:30
Collection of fish shell functions
function cidr --description "return ip range for a domain"
dig $argv +short | xargs whois | grep CIDR | awk '{ print $2 }'
end
@Harwood
Harwood / .gitconfig
Last active December 20, 2022 19:28
Git config
[alias]
aliases = !git config --get-regexp 'alias.*' | colrm 1 6 | sed 's/[ ]/ = /'
cleanslate = !git checkout -- . && git checkout master && git branch | grep -v "^\\*" | xargs git branch -D && git clean --quiet --force -d -x && git fetch --all --multiple --prune --prune-tags --tags && git pull
prep = "!f() { git clone $@ && cd $(basename $_ .git) && ln -s ~/.pre-commit/pre-commit-config.yaml ./.pre-commit-config.yaml && pre-commit install --install-hooks && pre-commit autoupdate ;}; f"
loc = !git ls-files | xargs -n1 git blame --line-porcelain | sed -n 's/^author //p' | sort -f | uniq -ic | sort -nr
lg = log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --date=relative
spellcheck = !git ls-tree --full-tree -r HEAD | awk '{ print $4 }' | xargs -n1 sh -c 'aspell check "$@" < /dev/tty' aspell
untracked = ls-files -o --exclude-standard
sit-issue = "!f() { $(git root)/.sit/modules/issue-tracking/cli/sit-issue ;}; f"
sit-

Keybase proof

I hereby claim:

  • I am harwood on github.
  • I am harwood (https://keybase.io/harwood) on keybase.
  • I have a public key ASAJKWlFuB99wJw-DTD9mZfM_DqjSjS9gUrwNq0OrlT3yQo

To claim this, I am signing this object:

#! /usr/bin/env bash
set -e
base_url=`git config --get remote.origin.url`
current_branch=`git rev-parse --abbrev-ref HEAD`
current_sha1=`git show-ref --heads --hash ${current_branch}`
if [ ${base_url} == *'http'* ]
then