Last active
December 7, 2022 22:13
-
-
Save arnos-stuff/0f812069139763ac786225264506227d to your computer and use it in GitHub Desktop.
shell command that automatically submits a gist to your github account after opening vscode to ask for you to paste/write the gist's content
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# the rest of your ~/.bashrc or ~/.bash_profile (even ~/.zshrc) | |
# ... | |
# ... | |
# aliases | |
# first parameter: extension (ex: py, gz, txt, js, ...) | |
# second parameter: filename (w/o extension) | |
# third parameter: description of the gist | |
alias ghgist='_ghgist(){ mkdir -p /tmp/ghghist ; code -w "/tmp/ghghist/$2.$1" ; cat /tmp/ghghist/$2.$1 | gh gist create -d "$3" -p -f "$2.$1" | rm -rf /tmp/ghghist/$2.$1}; _ghgist' | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment