This file contains hidden or 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
#!/bin/bash | |
read -r -p "Are you sure? [y/N] " response | |
case $response in | |
[yY][eE][sS]|[yY]) | |
echo "Burning the world...." | |
docker rm $(docker ps -a -q) | |
docker rmi -f $(docker images -q) | |
rm -rf ~/Library/Containers/com.docker.docker/Data/* | |
;; |
This file contains hidden or 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
cmd="sudo unshare -n -- sh -c 'ifconfig lo up; sudo -u $USER $@'" | |
eval $cmd |
This file contains hidden or 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
def slurp(filename): | |
return [line.strip() for line in open(filename)] | |
def green(s): | |
return '\033[92m' + s + '\033[0m' | |
def blue(s): | |
return '\033[94m' + s + '\033[0m' | |
def red(s): |
This file contains hidden or 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
python -m SimpleHTTPServer 8080 |
This file contains hidden or 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
def time[A](block: => A): A = { | |
val before = System.currentTimeMillis | |
val result = block | |
val after = System.currentTimeMillis | |
println(s"Time: ${after - before}ms") | |
result | |
} |