Skip to content

Instantly share code, notes, and snippets.

View gavinr's full-sized avatar

Gavin Rehkemper gavinr

View GitHub Profile
@gavinr
gavinr / geojson-to-esri-json-polygons-nodejs.js
Last active July 2, 2018 16:24
Script to covert a file of GeoJSON to Esri JSON in NodeJS utilizing the `arcgis-to-geojson-utils` package.
const esriUtils = require('@esri/arcgis-to-geojson-utils');
const fs = require('fs');
const inGeoJson = JSON.parse(fs.readFileSync('FILENAME.json', 'utf8'));
console.log('inGeoJson', inGeoJson);
const result = esriUtils.geojsonToArcGIS(inGeoJson);
let outFeatureSet = {
@gavinr
gavinr / locations.geojson
Created February 12, 2018 18:19
Create a pull request with your location!
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@gavinr
gavinr / vim-notes.md
Last active February 13, 2018 03:50
VIM notes

Reminders

  • daw = delete the word under the cursor ("delete a word")

  • caw = delete the word under the cursor and put you in insert mode ("change a word")

  • f<character> = put the cursor on the next character ("find")

  • ^ = go to beginning of text on line (compare to 0)

  • <SHIFT>i = go to beginning of test on line and insert mode.

  • * = search for word in whole doc

  • di" = delete inside quotes

@gavinr
gavinr / index.html
Last active November 22, 2017 21:12
<html><body><p>If you're a JavaScript developer, you may be interested in TypeScript, a typed superset of JavaScript that compiles to plain JavaScript. If you're also creating Web AppBuilder widgets, using TypeScript in a widget is a great way to get started with TypeScript. Here are a few notes and tips that I've discovered while using TypeScript within a Web AppBuilder custom widget development workflow.</p>
<p></p>
<h3>Background</h3>
<p></p>
<p>My usual Web AppBuilder development workflow is to have my widget code in its own code repository, and use a task runner like Grunt or Gulp to automatically compile and copy my code to the correct places (The stemapp directory and optionally the server directory of the app that I'm currently working on). Within this context, TypeScript fills the "transpiler" role where Babel might currently be in your stack.</p>
<p></p>
<h3>tsconfig.json&nbsp;file</h3>
<p></p>
<p>Many aspects of your tsconfig.json file are on a per-project basis, but there are a few things that you
@gavinr
gavinr / troubleshooting-esri-resource-proxy.md
Last active June 28, 2017 18:55
Troubleshooting steps to review and try when you're having problems with the Esri Resource Proxy (https://github.com/Esri/resource-proxy)

Note: In general the below steps are assuming the .NET (.ashx) proxy. Some of the steps may also apply to the Java or PHP proxies.

Proxy is not working

  1. Read through the instructions/troubleshooting on both the main proxy page as well as the specific readme for your particular proxy.
  2. Try the proxy against a known working url (like http://esri.com) and make sure the page comes back (the page may look weird but as long as you don't get an error and get something back, you know the proxy is at least working for that URL.)
  3. Try turning logging off.
  4. Test if setting mustMatch to false makes it work. If so, see mustMatch=false works but not when I set to true below.
  5. Are there outbound firewall settings on your machine that are preventing the pro
@gavinr
gavinr / decktape-slides-dot-com.js
Created March 16, 2017 15:15
Fork of the decktape "generic" plugin to work with a slides.com URL
// The generic plugin emulates end-user interaction by pressing keyboard and detects changes to the DOM.
// The deck is considered over when no change is detected afterward.
exports.options = {
keycode: {
default: 'Right',
metavar: '<code>',
help: 'Key code pressed to navigate to next slide'
},
maxSlides: {
// All material copyright ESRI, All Rights Reserved, unless otherwise specified.
// See http://js.arcgis.com/3.16/esri/copyright.txt for details.
//>>built
require({
cache: {
"url:esri/dijit/FeatureTable/templates/FeatureTable.html": '\x3cdiv class\x3d"${baseClass}" \x3e\r\n \x3cdiv id\x3d "${gridBorderContainerId}" class\x3d"esri-feature-table-border-container" data-dojo-attach-point\x3d "_gridBorderContainer" data-dojo-type\x3d"dijit.layout.BorderContainer" gutters\x3d"false"\x3e\r\n \x3cdiv id\x3d "${gridHeaderId}" class\x3d"esri-feature-table-content-pane esri-feature-table-menu" data-dojo-attach-point\x3d "_gridHeaderNode" data-dojo-type\x3d"dijit/layout/ContentPane" data-dojo-props\x3d"region: \'top\'"\x3e\r\n \x3cdiv class\x3d"esri-feature-table-menu-item esri-feature-table-loading-indicator" data-dojo-attach-point\x3d "_gridLoadingIndicatorNode" style\x3d"display:none;"\x3e\x3c/div\x3e\r\n \x3cdiv class\x3d"esri-feature-table-menu-item esri-feature-table-title" data-dojo-atta
@gavinr
gavinr / Demo.MD
Last active March 5, 2016 23:36
demo scratch

Keybase proof

I hereby claim:

  • I am gavinr on github.
  • I am gavinr (https://keybase.io/gavinr) on keybase.
  • I have a public key whose fingerprint is 9AAF 28CE 0B92 D7E0 F125 717F D11C 559F B618 70AB

To claim this, I am signing this object:

[{"image": "http://distilleryimage11.instagram.com/231895caaf2211e19dc71231380fe523_6.jpg", "caption": "another crappy day at work...", "link": "http://instagr.am/p/Lfz0O-Io5_/", "full_name": "gino beltran", "lat": "33.540744", "lng": "-117.782432"}, {"image": "http://distilleryimage4.instagram.com/3c82fe5caf2111e19dc71231380fe523_6.jpg", "caption": "No more June gloom", "link": "http://instagr.am/p/LfzFAppLO8/", "full_name": "Sachi Cunningham", "lat": "33.552143096", "lng": "-117.776512145"}, {"image": "http://distilleryimage4.instagram.com/2d2bb0c0af2111e1aebc1231381b647a_6.jpg", "caption": "Pretty day", "link": "http://instagr.am/p/LfzBxBtsx0/", "full_name": "marleerochelle", "lat": "33.510166168", "lng": "-117.75150299"}, {"image": "http://distilleryimage11.instagram.com/d6e2ecdaaf1e11e1bf341231380f8a12_6.jpg", "caption": "Finally some sun in Cali", "link": "http://instagr.am/p/LfxHPaD1g_/", "full_name": "ooflipmikeoo", "lat": "33.514331817", "lng": "-117.757499694"}, {"image": "http://distilleryimage5.in