Skip to content

Instantly share code, notes, and snippets.

View tygerbytes's full-sized avatar
🦖

Ty Walls tygerbytes

🦖
View GitHub Profile
computed: {
// Don't do this
missingRaceTime: () => {
return this.submitted && this.fiveKmRaceTime === '';
},
...
@tygerbytes
tygerbytes / Register-DynamicArgumentCompleters.ps1
Last active June 19, 2021 07:13
Register tab completion for custom commands that change depending on the current directory.
param(
[Parameter(Mandatory=$true)]
[String[]]$commandsToComplete)
<#
.SYNOPSIS
Register tab completion for custom commands that change depending on the current directory.
Source: https://gist.github.com/tygerbytes/833a73fe77f1f426f1f094c6ae7b5b2c
Author: Ty Walls (https://twitter.com/tygertec)
Website: https://www.tygertec.com
@tygerbytes
tygerbytes / qr.zsh
Created August 17, 2021 17:17
Generate QR code
#!/usr/bin/env zsh
# Make sure we have all the utilities we need
requiredBins=('qrencode' 'feh')
if [[ `uname` == "Darwin" ]]; then
requiredBins+=("pbpaste")
else
requiredBins+=("xclip")
fi
@tygerbytes
tygerbytes / mansplain.zsh
Created August 17, 2021 21:59
Mansplaining whatis wrapper :-)
function mansplain() {
desc=$(whatis $1 2>&1 | head -1 | grep -o -P '\- .*$' | cut -c 3-)
if [[ -z "$desc" ]]; then
echo "Well I've never heard of \"$1\", so it doesn't exist"
else
echo "Well, actually, it's more like $desc"
fi
}
# http://EditorConfig.org
root = true
[*]
indent_size = 2
indent_style = space
end_of_line = lf
charset = utf-8
insert_final_newline = true
trim_trailing_whitespace = true