Skip to content

Instantly share code, notes, and snippets.

@Dekker1
Created May 5, 2014 22:00
Show Gist options
  • Save Dekker1/2b5e5ab4be2ff45e33e8 to your computer and use it in GitHub Desktop.
Save Dekker1/2b5e5ab4be2ff45e33e8 to your computer and use it in GitHub Desktop.
Functions for F-shell. Drop an F-bomb, kill a process
function flip
echo "$argv[1]" | perl -C3 -Mutf8 -lpe '$_=reverse;y/a-zA-Z.['\'',({?!\"<_;‿⁅∴\r/ɐqɔpǝɟƃɥıɾʞ|ɯuodbɹsʇnʌʍxʎzɐqɔpǝɟƃɥıɾʞ|ɯuodbɹsʇnʌʍxʎz˙],'\'')}¿¡,>‾؛⁀⁆∵\n/'
end
function fuck
set -l CMD "pkill"
which $CMD >/dev/null; or set -l CMD "killall"
echo
if [ $argv[1] = "off" ]
set FLIP ' (ノಠ益ಠ)ノ彡' '(ノಠ-ಠ)ノ彡'
set SIG "-9"
else if [ $argv[1] = "you" ]
set FLIP ' (╯°□°)╯︵' '(ノ ゜Д゜)ノ ︵' '(ノಥДಥ)ノ︵' ' ヽ(`Д´)ノ︵' ' (ノಥ益ಥ)ノ '
set SIG ""
end
if set -q $argv[2]
echo "┬─┬ ノ( ゜-゜ノ) patience young grasshopper"
return
end
set -l n (math 'scale=0;'(random)'%'(count $FLIP)'+1')
set -l F $FLIP[$n]
if eval "$CMD $SIG $argv[2]"
echo "$F" (flip $argv[2]); echo
else
echo "┬─┬ ︵ /(.□. \)"; echo
end
set -e FLIP
set -e SIG
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment