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
return function(request, next_middleware) | |
local function geo_distance(lat1, lon1, lat2, lon2) | |
if lat1 == nil or lon1 == nil or lat2 == nil or lon2 == nil then | |
return nil | |
end | |
local dlat = math.rad(lat2-lat1) | |
local dlon = math.rad(lon2-lon1) | |
local sin_dlat = math.sin(dlat/2) | |
local sin_dlon = math.sin(dlon/2) | |
local a = sin_dlat * sin_dlat + math.cos(math.rad(lat1)) * math.cos(math.rad(lat2)) * sin_dlon * sin_dlon |
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
#!/usr/bin/env ruby | |
require 'FileUtils' | |
require 'net/http' | |
require 'open-uri' | |
require 'parallel' | |
require 'rest_client' | |
require 'json' | |
print "Chute ID: " | |
chute_id = gets.chomp |
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
#!/usr/bin/env ruby | |
require 'FileUtils' | |
require 'net/http' | |
require 'open-uri' | |
require 'parallel' | |
require 'json' | |
print "Chute shortcut: " | |
chute_shortcut = gets.chomp | |
begin |
NewerOlder