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
| alias accio=wget | |
| alias avadaKedavra='rm -f' | |
| alias imperio=sudo | |
| alias priorIncantato='echo `history |tail -n2 |head -n1` | sed "s/[0-9]* //"' | |
| alias stupefy='sleep 5' | |
| alias wingardiumLeviosa=mv | |
| alias sonorus='set -v' | |
| alias quietus='set +v' |
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
| defmodule EmailValidator do | |
| # ensure that the email looks valid | |
| def validate_email(email) when is_binary(email) do | |
| case Regex.run(~r/^[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,4}$/, email) do | |
| nil -> | |
| {:error, "Invalid email"} | |
| [email] -> | |
| try do | |
| Regex.run(~r/(\w+)@([\w.]+)/, email) |> validate_email |
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 | |
| # | |
| # When you are working on your macbook sitting in cafe and you have to go pee, | |
| # you need some way to guard you machine. | |
| # | |
| # Start this script, remove any earphones, and go do the job. | |
| # The assumption is the thief will close the lid of the laptop before taking it away. | |
| # This script detects the closing of the lid and plays some loud audio that will | |
| # likely distract the thief and/or grab attention of nearby people, making the |
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 | |
| sudo apt-get update | |
| sudo apt-get -y install linux-image-extra-$(uname -r) | |
| sudo sh -c "wget -qO- https://get.docker.io/gpg | apt-key add -" | |
| sudo sh -c "echo deb http://get.docker.io/ubuntu docker main\ > /etc/apt/sources.list.d/docker.list" | |
| sudo apt-get update | |
| sudo apt-get -y install lxc-docker |