Skip to content

Instantly share code, notes, and snippets.

Avatar

Jesse Hazel jwhazel

View GitHub Profile
@jwhazel
jwhazel / index.js
Created Oct 16, 2019
KY utility outages scraper
View index.js
/**
* In-browser scraper for KY utility outages
* 1.) Goto: https://psc.ky.gov/ors/PublicInfo_OutageIncidents.aspx
* 2.) Type: all, Other: other, From: 01/01/1999, To: today
* 3.) Copy this code into console and run
* 4.) Copy output into something like http://www.convertcsv.com/json-to-csv.htm
*/
(function() {
let output = [];
View mapbox custom style
{
"version": 8,
"name": "Custom Style",
"metadata": {
"mapbox:sdk-support": {
"js": "latest",
"android": "latest",
"ios": "latest"
}
},
@jwhazel
jwhazel / gist:ddfed7bceb3af75d8ce7c348dddaee6f
Created Nov 30, 2016
PHP function for converting web mercator (X,Y coords) to WGS84
View gist:ddfed7bceb3af75d8ce7c348dddaee6f
//Convert Web Mercator to WGS84
function toGeographic($X, $Y){
if (abs($X) < 180 && abs($Y) < 90){
return array('lat'=>0,'lng'=>0);
}
if (abs($X) > 20037508.3427892 || abs($Y) > 20037508.3427892){
return array('lat'=>0,'lng'=>0);
}
You can’t perform that action at this time.