Skip to content

Instantly share code, notes, and snippets.

View lantins's full-sized avatar

Luke Antins lantins

View GitHub Profile
@hfossli
hfossli / standard.sh
Last active February 8, 2024 05:19
Standard bash script format
#!/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]"
@michaelgrosser
michaelgrosser / vagrantfile.rb
Last active November 7, 2017 11:11
Share Host AWS Credentials with Vagrant Guest
# 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",
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