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
#!/bin/bash | |
CLEAR='\033[0m' | |
RED='\033[0;31m' | |
function usage() { | |
if [ -n "$1" ]; then | |
echo -e "${RED}👉 $1${CLEAR}\n"; | |
fi | |
echo "Usage: $0 [-n number-of-people] [-s section-id] [-c cache-file]" |
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
# Copy AWS credentials and config from host to guest | |
$aws_credentials_path = ENV['HOME'] + "/.aws/credentials" | |
$aws_config_path = ENV['HOME'] + "/.aws/config" | |
if File.file?($aws_credentials_path) && File.file?($aws_config_path) then | |
config.vm.provision "shell", | |
inline: "mkdir -p /root/.aws", | |
privileged: true | |
config.vm.provision "shell", | |
inline: "mkdir -p /home/nginx/.aws", |
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
class Numeric | |
def to_rad | |
self * Math::PI / 180 | |
end | |
end | |
# http://www.movable-type.co.uk/scripts/latlong.html | |
# loc1 and loc2 are arrays of [latitude, longitude] | |
def distance loc1, loc2 | |
lat1, lon1 = loc1 |