Skip to content

Instantly share code, notes, and snippets.

View tannerjt's full-sized avatar
Building Better

Joshua Tanner tannerjt

Building Better
View GitHub Profile
@ycabon
ycabon / index.js
Last active October 9, 2018 21:40
Using Puppeter with MapView
const puppeteer = require('puppeteer');
const viewport = {
width: 1920,
height: 1080
}
async function testPage(name, url) {
const browser = await puppeteer.launch();
const page = await browser.newPage();
@brambow
brambow / postgis-to-geojson-feature-collection.sql
Last active April 25, 2023 15:44
PostGIS query to build a GeoJSON FeatureCollection
SELECT json_build_object(
'type', 'FeatureCollection',
'crs', json_build_object(
'type', 'name',
'properties', json_build_object(
'name', 'EPSG:4326'
)
),
'features', json_agg(
json_build_object(
@nickpeihl
nickpeihl / index.js
Created January 13, 2017 22:45
Example of Streaming Esri JSON to GeoJSON
const request = require('request')
const JSONStream = require('JSONStream')
const TerraformerArcGIS = require('terraformer-arcgis-parser')
const geojsonStream = require('geojson-stream')
const fs = require('fs')
const url = 'http://sjcgis.org/arcgis/rest/services/Polaris/Buildings/MapServer/0/query?outSR=4326&where=FID >= 20000 AND FID<=20175&f=json&outFields=*&geometry=&returnGeometry=true&geometryPrecision=10'
const featureStream = JSONStream.parse('features.*', convert)
const outFile = fs.createWriteStream('features.geojson')
@pramsey
pramsey / ccog-readinglist.md
Last active September 3, 2021 00:30
Canadian Council on Geomatics Reading List
/**
* Retrieves all the rows in the active spreadsheet that contain data and logs the
* values for each row.
* For more information on using the Spreadsheet API, see
* https://developers.google.com/apps-script/service_spreadsheet
*/
function readRows() {
var sheet = SpreadsheetApp.getActiveSheet();
var rows = sheet.getDataRange();
var numRows = rows.getNumRows();
@jonathantneal
jonathantneal / README.md
Last active March 19, 2024 23:31
Local SSL websites on macOS Sierra

Local SSL websites on macOS Sierra

These instructions will guide you through the process of setting up local, trusted websites on your own computer.

These instructions are intended to be used on macOS Sierra, but they have been known to work in El Capitan, Yosemite, Mavericks, and Mountain Lion.

NOTE: You may substitute the edit command for nano, vim, or whatever the editor of your choice is. Personally, I forward the edit command to Sublime Text:

alias edit="/Applications/Sublime\ Text.app/Contents/SharedSupport/bin/subl"
@pedrogrande
pedrogrande / carrierwave.rb
Last active October 9, 2017 20:29
Carrierwave initializer file to use Fog and S3 storage for your file uploads
#config/initializers/carrierwave.rb
CarrierWave.configure do |config|
config.fog_credentials = {
# Configuration for Amazon S3 should be made available through an Environment variable.
# For local installations, export the env variable through the shell OR
# if using Passenger, set an Apache environment variable.
#
# In Heroku, follow http://devcenter.heroku.com/articles/config-vars
#
@oevans
oevans / AGO_PullHostedFeatures.py
Last active April 16, 2024 18:37
Python script to pull hosted features with attachments into a local file geodatabase. See ReadMe below.
import os, urllib, urllib2, datetime, arcpy, json
## ============================================================================== ##
## function to update a field - basically converts longs to dates for date fields ##
## since json has dates as a long (milliseconds since unix epoch) and geodb wants ##
## a proper date, not a long.
## ============================================================================== ##
def updateValue(row,field_to_update,value):
outputfield=next((f for f in fields if f.name ==field_to_update),None) #find the output field
@netpoetica
netpoetica / Setting up Nginx on Your Local System.md
Last active April 22, 2024 04:25
Setting up Nginx on Your Local System

#Setting up Nginx on Your Local System ###by Keith Rosenberg

##Step 1 - Homebrew The first thing to do, if you're on a Mac, is to install homebrew from http://mxcl.github.io/homebrew/

The command to type into terminal to install homebrew is:

ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
@benbalter
benbalter / geojson-conversion.sh
Last active April 23, 2024 13:16
Bulk convert shapefiles to geojson using ogr2ogr
# Bulk convert shapefiles to geojson using ogr2ogr
# For more information, see http://ben.balter.com/2013/06/26/how-to-convert-shapefiles-to-geojson-for-use-on-github/
# Note: Assumes you're in a folder with one or more zip files containing shape files
# and Outputs as geojson with the crs:84 SRS (for use on GitHub or elsewhere)
#geojson conversion
function shp2geojson() {
ogr2ogr -f GeoJSON -t_srs crs:84 "$1.geojson" "$1.shp"
}