Skip to content

Instantly share code, notes, and snippets.

View mattcanty's full-sized avatar
💭
Hello

Matt Canty mattcanty

💭
Hello
View GitHub Profile
Broadcast Time Zone
@mattcanty
mattcanty / otp.sh
Created November 7, 2020 15:16
1Password CLI Shell Functions
otp() {
ITEM_NAME=$1
TOTP=$(op get totp $ITEM_NAME --vault Personal 2>&1)
if [[ $TOTP == *"You are not currently signed in"* ]]; then
eval $(op signin my.1password.com)
totp $ITEM_NAME
return
@mattcanty
mattcanty / .gitlab-ci.yaml
Created May 17, 2020 08:40
pre-commit GitLab CI
variables:
XDG_CACHE_HOME: "$CI_PROJECT_DIR/.cache/"
cache:
paths:
- .cache/pip
- .cache/pre-commit
precommit:
image: golang
@mattcanty
mattcanty / Install-Civilisation2.ps1
Created December 10, 2018 21:16
Civilisation 2 Auto Install
$7ZipInstaller = ‘7z1805-x64.msi’
$Civ2Archive = 'civilization2gold_win_64bit.7z'
$TempDir = 'C:\Temp'
If(!(Test-Path $TempDir))
{
New-Item $TempDir -Type Directory
}
Invoke-WebRequest `

Keybase proof

I hereby claim:

  • I am mattcanty on github.
  • I am mattcanty (https://keybase.io/mattcanty) on keybase.
  • I have a public key ASDcNW3PACjKZFkEjXvvQu6oYWTqib7Q8Jy5CRYiH7gMpgo

To claim this, I am signing this object:

@mattcanty
mattcanty / gbt.sh
Created March 9, 2018 09:39
Mac Setup
go get -u github.com/jtyr/gbt/cmd/gbt
export GBT_CAR_DIR_DEPTH='2'
export GBT_CAR_SIGN_WRAP='1'
PS1='$(gbt $?)'
sourceCodeUrl="$(curl -s https://api.github.com/repos/ryanoasis/nerd-fonts/releases/latest | rq -j 'at "assets" | spread | find (a => a.name == "SourceCodePro.zip") | at browser_download_url' | awk -F'","' -v OFS=, '{$1=$1;gsub(/^"|"$/,"")}1')"
curl -fsSL "$sourceCodeUrl" -o /tmp/sourceCodePro.zip
%systemroot%\system32\inetsrv\APPCMD list site
@mattcanty
mattcanty / fix-rdpclip.bat
Created July 15, 2016 13:56
Fix RdpClip issues
taskkill /im rdpclip.exe /F
start rdpclip.exe
@mattcanty
mattcanty / retry.fs
Created May 29, 2015 16:05
F# Retry Loop
let rec retry times fn =
if times > 1 then
try
fn()
with
| _ -> retry (times - 1) fn
else
fn()
//Source @gradbot on Stack Overflow http://stackoverflow.com/a/5942170/966609
@mattcanty
mattcanty / .gitconfig
Last active September 23, 2016 11:23
Git 'Standup' Alias
[alias]
aa = add .
s = status
lg = log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit -10
co = checkout
cob = checkout -b
ec = config --global -e
up = !git pull --rebase --prune $@ && git submodule update --init --recursive
save = !git add -A && git commit -m 'SAVEPOINT'
undo = reset HEAD~1 --mixed