Last active
April 10, 2019 18:03
-
-
Save sloppylopez/c221a7763e8e80f62b000c84ca76db84 to your computer and use it in GitHub Desktop.
Collection of Fish functions
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
function cat | |
ccat $argv | |
end |
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
function cleanDockerLocal | |
echo -e "Stoping Docker containers 💃" | colorStuff | |
docker kill (docker ps -q) | colorStuff | |
echo -e "Deleting Docker containers 🔥" | colorStuff | |
docker rm (docker ps -a -q) | colorStuff | |
echo -e "Deleting Docker images 💥" | colorStuff | |
docker rmi (docker images -q) | colorStuff | |
echo -e "cleanDockerLocal done! 🀄" | colorStuff | |
end |
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
set -l symbols ◷ ◶ ◵ ◴ | |
function clock | |
while sleep 0.5 | |
echo -e -n "\b$symbols[1]" | colorStuff | |
set -l symbols $symbols[2..-1] $symbols[1] | |
end | |
end |
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
function colorStuff | |
while read -l input | |
switch $input | |
case "*error*" | |
set_color red | |
echo $input | |
case "*warning*" | |
set_color yellow | |
echo $input | |
case "*" | |
set_color magenta | |
echo $input | |
end | |
end | |
set_color blue | |
end |
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
function createServer | |
echo -e "Creating Python server 🐍" | colorStuff | |
python -m SimpleHTTPServer | colorStuff | |
end |
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
function dps | |
echo -e "Listing Docker Containers 🐳" | colorStuff | |
docker ps $argv | colorStuff | |
end | |
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
function findByName | |
echo 'Finding by name' $argv[2] '@' $argv[1] '🍿' | colorStuff | |
sudo find $argv[1] -name $argv[2] | colorStuff | |
end |
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
function lsa | |
echo "Listing 'ls -trhall' 🍺" | colorStuff | |
ls -thrall | |
end |
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
function myIp | |
echo "My ip address is 🦄" | colorStuff | |
ipconfig getifaddr en0 | colorStuff | |
end | |
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
function resetLastNonPushedCommit | |
echo "Git: Removing last non-pushed commit from local 💩" | colorStuff | |
git reset --hard HEAD^ | |
end |
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
function seekAndDestroy | |
echo "Searchiiiiiiiing... seek and destroy 🎸" | colorStuff | |
kill (lsof -t -i :$argv[1]) | |
end |
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
function sourceAllFishFunctions | |
. colorStuff.fish sourceAllFishFunctions.fish cleanDockerLocal.fish createServer.fish dps.fish findByName.fish lsa.fish whoListenAt.fish | |
end |
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
function whoListenAt | |
echo -e "Checking who is listening at" $argv[1] '🎳' | colorStuff | |
lsof -i :$argv[1] | |
end | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment