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
function cosineDistanceBetweenPoints(lat1, lon1, lat2, lon2) { | |
const R = 6371e3; | |
const p1 = lat1 * Math.PI/180; | |
const p2 = lat2 * Math.PI/180; | |
const deltaP = p2 - p1; | |
const deltaLon = lon2 - lon1; | |
const deltaLambda = (deltaLon * Math.PI) / 180; | |
const a = Math.sin(deltaP/2) * Math.sin(deltaP/2) + | |
Math.cos(p1) * Math.cos(p2) * | |
Math.sin(deltaLambda/2) * Math.sin(deltaLambda/2); |
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
// ==UserScript== | |
// @name Reversewigo solver ✓🐵 DEV | |
// @namespace http://tampermonkey.net/ | |
// @version 0.30 | |
// @description Reversewigo solver ✓🐵 - solve reverse wherigo automatically on cache page. Solver code originated from Rick Rickhardson's reverse-wherigo source (public domain). Also, creates show source button for mystery cacahes. | |
// @author [email protected] | |
// @grant GM_registerMenuCommand | |
// @grant GM_getValue | |
// @grant GM_setValue | |
// @grant GM.getValue |
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
// featureCollection and all features on map | |
let fc; | |
// autogenerated features (points within hand-drawn region) | |
let uniqueWps; | |
// gps coordinates of autogenerated features | |
let wps; | |
// script that does the magic | |
let gscript = "https://gist.githubusercontent.com/mrummuka/b70b9a9fb0825b4bace91a4b6d6b1257/raw/602987bba124e03a7641e96d56800375abd96409/regionWpGenerator"; | |
fc = window.api.data.get('map'); |
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
const MYSTERY_RADIUS = 3.218; // km | |
const CACHE_RADIUS = 0.160; // km (WAS: 0.1609) | |
// resolution for how dense the created points will be (target: one gps decimal) | |
// var cellSide = 0.00001666666667; // if I calculated correctly this should have been enough, but apparently I didn't so doubling the precision for tests | |
const cellSide = 0.000006; | |
// converts decimal degree value into array of degrees, minutes and minute decimals (gps) | |
// todo: range checks | |
function l_dd2d_m_dec(val) { |
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
import sys, datetime, pycaching, time | |
if len(sys.argv) > 2: | |
tbcode = sys.argv[1] | |
tbmsg = sys.argv[2] | |
else: | |
print("arg1=tbcode arg2=logmsg not provided") | |
exit(1) | |
geocaching = pycaching.login() | |
from pycaching.log import Log, Type as LogType | |
log = Log(type=LogType.discovered_it, text=tbmsg, visited=datetime.date.today()) |
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
# | |
# cli for pycipher (https://github.com/jameslyons/pycipher) | |
# | |
from __future__ import print_function | |
import pycipher | |
from pycipher import ADFGX | |
from pycipher import Affine | |
from pycipher import Atbash | |
from pycipher import Autokey | |
from pycipher import Beaufort |