Skip to content

Instantly share code, notes, and snippets.

@sqwxl
sqwxl / spin
Last active September 7, 2022 13:39
Simple bash spinner
#!/usr/bin/env bash
# source this file in your scripts and use as so:
# <command> & spin "Text to display while command is running"
function spin() {
local tag="$1"
local pid=$! # get the pid of the last background process
local sp="⠋⠙⠹⠸⠼⠴⠦⠧⠇⠏"
local i=1
@sqwxl
sqwxl / git.fish
Last active October 12, 2024 15:55
Never again accidentally run `commit --amend` instead of `rebase --continue` in a merge conflict
function git
if test $argv[1] = commit; and contains -- --amend $argv
git_commit_safe_amend $argv[2..-1]
else
command git $argv
end
end