Skip to content

Instantly share code, notes, and snippets.

@faho
Last active February 3, 2021 17:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save faho/b67e68b05ccedebd88feb7a20cae7ace to your computer and use it in GitHub Desktop.
Save faho/b67e68b05ccedebd88feb7a20cae7ace to your computer and use it in GitHub Desktop.
git-typo ported to fish
# constants
# ascii art - Most of them found on asciiart.eu, unknown artists
set -g gitTypoDonkey '
/\ /\
( \\ // )
\ \\ // /
\_\\||||//_/
\/ _ _ \
\/|(O)(O)|
\/ | |
___________________\/ \ /
// // |____|
// || / \
//| \| \ 0 0 /
// \ ) V / \____/
// \ / ( /
"" \ /_________| |_/
/ /\ / | ||
/ / / / \ ||
| | | | | ||
| | | | | ||
|_| |_| |_||
\_\ \_\ \_\\'
set -g gitTypoExplosion0 '
)
(
.-`-.
: :
:TNT:
:___:'
set -g gitTypoExplosion1 '
\|/
- o -
/-`-.
: :
:TNT:
:___:'
set -g gitTypoExplosion2 '
.---.
: | :
:-o-:
:_|_:'
set -g gitTypoExplosion3 '
.---.
(\|/)
--0--
(/|\)'
gitTypoExplosion4="
'.\|/.'
(\ /)
- -O- -
(/ \)
,'/|\'."
set -g gitTypoExplosion5 '
`. \ | / ,`
`. `.` ,`
( .`.|.` .)
- ~ -0- ~ -
('
set -g gitTypoExplosion6 '
`,`|`.` )
.` .`. `.
,` / | \ `.
\ ` "
` . `.` ,`
. `` ,`. "
~ ( ~ -
`'
set -g gitTypoExplosion7 '
. `,`|` ` .
.` " `
, ` , ` `
( ) (
) ( )
( )
) /
,---.'
set -g gitTypoHeart '
****** ******
********** **********
************* *************
*****************************
*********** * ***********
*********** GIT **********
*********** **********
*********** **********
******************
***************
***********
*******
***
*
'
set -g gitTypoPill '
_________
[_________]
| .-. |
|,(o.o).|
| >|n|< |
|` `"` `|
|POISON!|
`"""""""`'
gitTypoPoop="
) )
( ) (
) _ )
( \_
_(_\ \)__
(____\___))"
# Staute of Liberty by b'ger
gitTypoStatue="
^
,' \\
L\"\"/
\` |
J |
J L
| | . ,
| |.\`v_L.'
// ,>-(-\'_
\\\`' \ - /-.
/ /\`\"\"|
),' \`-
( ,-' \\
) ,' ,' h
/ / / \`)--..
\/ / \ <)
< , L<'
F/ _/ ,'
L ,-' \\
| ___L
/ ( F
J ___,' L
| ,' |
F ,' |
(_,--..__ mt-2|_
,' \`\"\`--.._\\
,' / \\
/ (_
"
# arrays
# bible
set -g gitTypoBible "And Jesus said unto Paul, 'Come forth, and receive everlasting life.' But Paul came in fifth, and received a toaster. - Order 25:3" \
"And the angel said unto him: 'Stop hitting yourself. Stop hitting yourself.' But low he could not. For the angel was hitting him with his own hands. - Irony 7:12" \
"Blessed are the cheesemakers.- Brian 22:1" \
"First shalt thou take out the Holy Pin. Then shalt thou count to three, no more, no less. Three shall be the number thou shalt count, and the number of the counting shall be three. Four shalt thou not count, neither count thou two, excepting that thou then proceed to three. Five is right out. Once the number three, being the third number, be reached, then lobbest thou thy Holy Hand Grenade of Antioch towards thy foe, who, being naughty in My sight, shall snuff it. - Arthur 1:2:5" \
"He's not the Messiah. He's a very naughty boy. - Brian 3:28" \
"Let those among you who are without sin be the first to throw the stone. The crowd looked at Jesus, believing he had a good point. Then Jesus picked up a stone. - Irony 8:19" \
"'This is my body'\n'This is my blood'\n'And this is your card'\nApostles go nuts. - Miracles 15:14" \
"Thou shalt have dominion over all the beasts except, of course, cats. - Felines 12:17" \
"Verily I say unto thee, lay thine eyes upon the field in which my fucks are grown. Behold that it is barren. - Crops 6:11"
# german proverbs
set -g gitTypoGermanProverbs "Alles hat ein Ende, nur die Wurst hat zwei." \
"Da liegt der Hund begraben." \
"Das ist mir Wurst." \
"Das Blaue vom Himmel versprechen." \
"Das kannst du deiner Oma erzählen." \
"Das Leben ist kein Ponyhof." \
"Die Kirche im Dorf lassen." \
"Du gehst mir auf den Keks." \
"Fremdschämen." \
"Ich glaub ich spinne." \
"Ich verstehe nur Bahnhof." \
"Ins Gras beißen." \
"Jetzt haben wir den Salat." \
"Kabelsalat." \
"Kein Schwein war da." \
"Klappe zu, Affe tot." \
"Kummerspeck." \
"Leben ist kein Ponyhof." \
"Leben wie Gott in Frankreich." \
"Luftschloss." \
"Mein Englisch ist unter aller Sau." \
"Nul acht funfzehn." \
"Schlafen wie ein Murmeltier." \
"Sie hat einen Vogel." \
"Sie hat nicht alle Tassen im Schrank." \
"Sie spielt die beleidigte Leberwurst." \
"Treppenwitz." \
"Was Hänschen nicht lernt, lernt Hans nimmermehr." \
"Wo sich Fuchs und Hase gute Nacht sagen."
# sleep noises
set -g gitTypoSleepNoises "*snore*" "zzz"
# echo a random array element
# pass array name as first parameter
function echoRandomArrayElement
random choice $$argv[1]
end
function git
# add
switch $argv[1]
case dad
curl -s https://icanhazdadjoke.com
echo
command git add $argv[2..-1]
case ass
echo "$gitTypoDonkey"
command git add $argv[2..-1]
case blam
clear; echo "$gitTypoExplosion0"
sleep 0.5; clear; echo "$gitTypoExplosion1"
sleep 0.5; clear; echo "$gitTypoExplosion2"
sleep 0.5; clear; echo "$gitTypoExplosion3"
sleep 0.5; clear; echo "$gitTypoExplosion4"
sleep 0.5; clear; echo "$gitTypoExplosion5"
sleep 0.5; clear; echo "$gitTypoExplosion6"
sleep 0.5; clear; echo "$gitTypoExplosion7"
sleep 1; clear
command git blame $argv[2..-1]
case vommit
curl -s http://whatthecommit.com/index.txt
command git commit $argv[2..-1]
case lov
echo "$gitTypoHeart"
sleep 1.5
command git log $argv[2..-1]
case pill
echo "Now thats a hard pill to swallow..."
echo "$gitTypoPill"
command git pull $argv[2..-1]
case rest
echo "Thank you, I was tired..."
set -l noiseDuration 5
if [ "$argv[2]" = "--hard" ]
set noiseDuration 10
else if [ "$argv[2]" = "--soft" ]
set noiseDuration 3
else
end
for i in (seq 0 $noiseDuration)
sleep 1
echoRandomArrayElement gitTypoSleepNoises
end
sleep 1
echo "Wow nice nap !"
command git reset $argv[2..-1]
case merde
echo "$gitTypoPoop"
command git merge $argv[2..-1]
case statue
echo "$gitTypoStatue"
command git status $argv[2..-1]
case '*'
# remote
if [ "x$argv[1]" = "xremote" -a "x$argv[2]" = "xdad" ]
curl -s https://icanhazdadjoke.com
echo
command git remote add $argv[3..-1]
else if [ "x$argv[1]" = "xstash" -a "x$argv[2]" = "xpoop" ]
echo "$gitTypoPoop"
command git stash pop $argv[3..-1]
else if [ "x$argv[1]" = "xcommit" -a "x$argv[2]" = "x--amen" ]
echoRandomArrayElement gitTypoBible
command git commit --amend $argv[3..-1]
else
command git $argv
end
end
end
# other functions
function GIT
# convert output to all uppercase
git $argv | tr [a-z] [A-Z]
end
function got
if [ "$argv[1]" = "checkout" ]
echo "Beware, some people did that and ended up in detached HEAD state."
else
echo "You spend too much time watching series."
end
git $argv
end
if ! type -q gti
function gti
# invert output lines
git $argv | awk '{a[i++]=$0} END {for (j=i-1; j>=0;) print a[j--] }'
end
end
function gut
# citation choice and output
echoRandomArrayElement gitTypoGermanProverbs
git $argv
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment