Skip to content

Instantly share code, notes, and snippets.

View nickpeihl's full-sized avatar

Nick Peihl nickpeihl

View GitHub Profile
@nickpeihl
nickpeihl / convertKmzToShp.ps1
Created January 8, 2018 19:56
Powershell script to convert all KMZ files in the current folder to Shapefiles
foreach ($f in Get-ChildItem "${PWD}" -Filter *.kmz) {
docker run -it -v ${PWD}:/data geodata/gdal ogr2ogr -f "ESRI Shapefile" $f.Name.Replace('kmz', 'shp') $f.Name
}
@nickpeihl
nickpeihl / index.html
Last active November 20, 2019 09:24
ags-walk example
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="Example of using AGSWalk in client JavaScript to list services from an ArcGIS Server URL">
<title>AGSWalk - List ArcGIS Server Rest Services</title>
<link rel="stylesheet" href="https://unpkg.com/tachyons@4.9.0/css/tachyons.min.css"/>
</head>
<body>
@nickpeihl
nickpeihl / index.html
Created September 18, 2017 23:26
Interactive Choropleth Map - Leaflet Example
<!DOCTYPE html>
<html>
<head>
<title>Choropleth Tutorial - Leaflet</title>
<meta charset="utf-8">
<meta name="viewport"
content="width=device-width, initial-scale=1.0">
<link rel="shortcut icon"
@nickpeihl
nickpeihl / index.js
Created July 28, 2017 23:40
Query ArcGIS feature service in Leaflet
var L = require('leaflet')
require('leaflet-draw')
var Esri = require('esri-leaflet')
var css = require('sheetify')
css('leaflet')
css('leaflet-draw')
css('tachyons')
var map = L.map('map', {
@nickpeihl
nickpeihl / hide-unwanted-tweets
Created July 27, 2017 17:43
Hide unwanted tweets with the UserStyles add-on.
@namespace url(http://www.w3.org/1999/xhtml);
@-moz-document domain("twitter.com") {
/* Hide ads */
.promoted-tweet { display: none; }
/* Should hide conversations involving people you don't follow */
[data-you-follow="false"] { display: none; }
}
@nickpeihl
nickpeihl / index.js
Created June 19, 2017 21:55
Node module to check if Twitter screenname is a nazi
var Twitter = require('twitter')
var client = new Twitter({
consumer_key: process.env.TWITTER_CONSUMER_KEY,
consumer_secret: process.env.TWITTER_CONSUMER_SECRET,
access_token_key: process.env.TWITTER_ACCESS_TOKEN_KEY,
access_token_secret: process.env.TWITTER_ACCESS_TOKEN_SECRET
})
module.exports = naziChecker
@nickpeihl
nickpeihl / index.js
Created June 16, 2017 00:42
Load data from ArcGIS Server Rest API into geojson-p2p-db
var hyperlog = require('hyperlog')
var level = require('level-browserify')
var gjdb = require('geojson-p2p-db')
var FeatureService = require('featureservice')
var request = require('xhr-request')
var series = require('run-series')
var waterfall = require('run-waterfall')
var Terraformer = require('terraformer')
Terraformer.ArcGIS = require('terraformer-arcgis-parser')
@nickpeihl
nickpeihl / README.md
Last active July 21, 2017 21:55
Homeaway Listings to GeoJSON

homeaway listings

Create a GeoJSON file of HomeAway listings in a bounding box.

Usage

  1. Request access to the HomeAway Developer API.
  2. Create a new client on the My Clients page.
  3. Set the HOMEAWAY_CLIENT_ID and HOMEAWAY_CLIENT_SECRET environment variables in your operating system to your client values.
@nickpeihl
nickpeihl / README.md
Last active January 5, 2023 21:41
Convert GeoJSON FeatureCollection to newline delimited JSON Feature objects

cat data.geojson | jq -c '.features | .[]' > outfile.jsonld

@nickpeihl
nickpeihl / aerialImagery2013.json
Created April 14, 2017 18:46
2013 Aerial Imagery TileJSON
{
"tilejson": "2.1.0",
"name": "imagery2013",
"description": "Aerial imagery of San Juan County WA taken in 2013",
"version": "1.0.0",
"tiles": [
"http://sjcgis.org/arcgis/rest/services/Basemaps/Aerials_2013_WM/MapServer/tile/{z}/{y}/{x}"
],
"minzoom": 8,
"maxzoom": 13,