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
/* | |
CSS changes for: https://transalpclub.nl/forum/unread | |
apply with Stylus Browser extension (or anyway you want to add CSS) | |
*/ | |
body { | |
/* minder witruimte rondom tekstregels */ | |
line-height: 1em; |
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
// Delete all search-engines not starting with _ or named Google | |
// Open Settings -> Search Engines | |
// Open F12 Developer tools | |
// Run scipt as snippet | |
settings.SearchEnginesBrowserProxyImpl.prototype.getSearchEnginesList() | |
.then(function(val) { | |
val.others.sort(function(a, b) { return b.modelIndex - a.modelIndex; });// sort just for clarity | |
val.others.forEach(function(engine) { |
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
console.clear(); | |
nearbyGateways(52.4, 4.87); // latitude, longitude | |
function nearbyGateways(lat, lon, meters = 15000) { | |
fetch(`https://www.thethingsnetwork.org/gateway-data/location?latitude=${lat}&longitude=${lon}&distance=${meters}`) | |
.then(response => response.json()) | |
.then(json => { | |
let $_Distance = (lat1, lon1, lat2, lon2, accuracy = 1e3) => { // Haversine distance | |
let M = Math, C = M.cos, P = M.PI / 180, |
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
//ES5 version | |
fetch(uri) | |
.then(response => response.json()) | |
.then(json => { | |
// Create HTML TABLE, for a challenge refactor this to one .reduceRight call | |
let headers = [], maxid = 0;// maximum Primary Key value read in this DB response | |
// process rows first because the headers info is needed in the THEAD | |
let TBODY = json.map(function (row) { | |
headers = Object.keys(row); | |
let TRdata = '';// stuff all data values as data-attributes on the TR tag |
NewerOlder