Skip to content

Instantly share code, notes, and snippets.

View stdavis's full-sized avatar

Scott Davis stdavis

View GitHub Profile
import arcpy
import sys
VISTABALLOTAREAS = r'Database Connections\SGID10.sde\SGID10.POLITICAL.VistaBallotAreas'
RESIDENCES = r'C:\Temp\Temp.gdb\Residences'
PRECINCTS = r'C:\Temp\vista_prod.odc\GV_VISTA.PRECINCTS'
RESIDENCES_SOURCE = r'C:\Temp\vista_prod.odc\GV_VISTA.RESIDENCES'
COUNTIES = r'Database Connections\SGID10.sde\SGID10.BOUNDARIES.Counties'
errors = []
@stdavis
stdavis / make_edits.py
Created February 6, 2017 19:05
Flush Netlify Cache
from os.path import join
from glob import glob
files = [
'a-day-in-the-life-of-utahs-arcgis-server-base-maps',
'about-our-new-v6-website-in-ghpages',
'about/data-policies',
'authoritative-utah-geocoding-results',
'best-practices-document-for-loading-data-into-an-sde',
@stdavis
stdavis / init.js
Created November 28, 2016 17:46
object function console log
atom.commands.add('atom-text-editor', 'custom:conlog', function () {
editor = atom.workspace.getActiveTextEditor();
const modName = editor.getTitle().split('.')[0];
const folder = path.basename(path.dirname(editor.getPath()));
const currentPoint = editor.getCursorBufferPosition();
let funcName;
editor.scan(/(\S*): function?\s\([\s\S]+?console.*/g, function (iterator) {
if (iterator.range.containsPoint(currentPoint)) {
console.log('found');
funcName = iterator.match[1];
@stdavis
stdavis / profile.js
Created March 29, 2016 17:11
moment package definition for Dojo build system
{
packages: [{
name: 'moment',
main: 'moment',
resourceTags: {
amd: function (filename) {
return /\.js$/.test(filename);
},
test: function (filename, mid) {
return /\/tests/.test(mid);
@stdavis
stdavis / example.js
Created December 18, 2015 23:56
LayerSelector: level 20
require([
'esri/map',
'esri/layers/WebTiledLayer',
'esri/layers/TileInfo',
'esri/geometry/Extent',
'dojo/on',
'dojo/dom'
], function (
Map,
@stdavis
stdavis / example.js
Created December 18, 2015 15:27
layer-selector: Tokens
new LayerSelector({
map: map,
quadWord: 'your-quad-word-here',
baseLayers: [
'Imagery',
'Hybrid',
{
token: 'Lite',
selected: true
},
@stdavis
stdavis / example.js
Created December 18, 2015 15:24
layer-selector: Layer factory example
require([
'layer-selector',
'esri/map',
'esri/layers/ArcGISTiledMapServiceLayer',
'dojo/domReady!'
], function(LayerSelector, Map, TiledLayer) {
var map = new Map('map', {});
@stdavis
stdavis / WebTiledLayerExample.js
Created December 18, 2015 00:23
WebTiledLayer Example
require([
'esri/map',
'esri/layers/WebTiledLayer',
'esri/geometry/Extent'
], function (
Map,
WebTiledLayer,
Extent
) {
map = new Map('mapDiv', {
@stdavis
stdavis / querycsv.py
Created August 21, 2015 20:54
querycsv_redux
#!/usr/bin/env python
"""
querycsv.py
Purpose:
Execute SQL (conceptually, a SELECT statement) on an input file, and
write the results to an output file.
Author(s):
R. Dreas Nielsen (RDN)
Copyright and license:
Copyright (c) 2008, R.Dreas Nielsen
atom.commands.add('atom-workspace', 'custom:semicolonize', () => {
editor = atom.workspace.getActiveTextEditor();
editor.moveToEndOfLine();
editor.insertText(';');
});
atom.commands.add('atom-workspace', 'custom:colonize', () => {
editor = atom.workspace.getActiveTextEditor();
editor.moveToEndOfLine();
editor.insertText(':');