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
storage = STORAGE(); | |
ON('load-record', function (event) { | |
if (storage.getItem("turf")) { | |
eval(JSON.parse(storage.getItem("turf"))); | |
turf = module.exports; | |
} else { | |
REQUEST({url: 'https://gist.githubusercontent.com/bmcbride/568bb31c073af412f35db3a558cc246a/raw/b9d0c3265fffec8119151c647cb74be7f349beb3/turf.js'}, function(error, response, body) { | |
if (error) { | |
ALERT('Error with request: ' + INSPECT(error)); |
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
import sys | |
import json | |
from fulcrum import Fulcrum | |
api_key = 'your_api_key' | |
form_id = 'your_form_id' | |
if api_key == '' or api_key == 'your_api_key' or form_id == '' or form_id == 'your_form_id': | |
sys.exit('api_key and form_id are required!') |
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
// Special Apps Script function to process HTTP POST request | |
function doPost(e){ | |
return handleResponse(e); | |
} | |
function handleResponse(e) { | |
// Parse JSON webhook payload | |
var jsonString = e.postData.getDataAsString(); | |
var payload = JSON.parse(jsonString); | |
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
function doPost(e){ | |
return handleResponse(e); | |
} | |
function handleResponse(e) { | |
var email = e.parameter.email; | |
var form = e.parameter.form; | |
var jsonString = e.postData.getDataAsString(); | |
var payload = JSON.parse(jsonString); | |
var subject = "Fulcrum Webhook Payload"; |
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 an array of objects according to key, value, or key and value matching | |
function getObjects(obj, key, val) { | |
var objects = []; | |
for (var i in obj) { | |
if (!obj.hasOwnProperty(i)) continue; | |
if (typeof obj[i] == 'object') { | |
objects = objects.concat(getObjects(obj[i], key, val)); | |
} else | |
//if key matches and value matches or if key matches and value is not passed (eliminating the case where key matches but passed value does not) | |
if (i == key && obj[i] == val || i == key && val == '') { // |
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
gdal_translate image.tif image.mbtiles -of MBTILES | |
gdaladdo image.mbtiles 2 4 8 |
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
import xml.etree.ElementTree as ET | |
metric = 0 | |
kml = raw_input('Enter the KML file path and name: ') | |
srt = kml.replace('.kml', '.srt'); | |
file = open(srt, 'w') | |
if metric == 1: | |
speedUnits = '(km/h)' | |
altitudeUnits = '(m)' |
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
/********************************************************************* | |
Original Source: https://github.com/jmckenna/basemaps/blob/master/contrib/osm2pgsql-to-imposm-schema.sql | |
Modified for use in creating shapefiles to replace in TileMill Open Streets, DC project | |
Purpose: This script will modify tables generated through the osm2pgsql | |
utilility [1] into tables similar to those as generated from the | |
imposm utility [2]. The generated tables can then be used | |
by the mapserver-utils utility [3]. | |
This is most likely useful for the Windows platform. |
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
<?php | |
/** | |
* Title: Fulcrum Webhook for syncing data shares to MySQL database | |
* Notes: Requires PHP with PDO & allow_url_fopen enabled | |
* Author: Bryan R. McBride | |
* Source: https://gist.github.com/bmcbride/44afdc10ee943b4e7b92 | |
*/ | |
# Fulcrum app information | |
$formID = 'your-fulcrum-form-id'; |
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
<?php | |
$ch = curl_init($_GET['url']); | |
curl_setopt($ch, CURLOPT_HEADER, 0); | |
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); | |
$output = curl_exec($ch); | |
curl_close($ch); | |
echo $output; | |
?> |