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
@tannerjt
tannerjt / testQuiz.yaml
Last active November 5, 2021 14:47
testQuiz
title: test quiz
questions:
-
- A California Channel Island known for its wildlife, dive sites and Mt. Orizaba, its highest peak.
- SW of Los Angeles
- -118.422444,33.382715
- 10
- https://images.unsplash.com/photo-1612714585270-c11c13ef42fd?ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&ixlib=rb-1.2.1&auto=format&fit=crop&w=1974&q=80
- 10000
@tannerjt
tannerjt / extractAttachmentURLs.py
Last active July 28, 2023 04:42
Extract ArcGIS Feature Service Attachments into Field URL's
#Author: Joshua Tanner
#Data: 7/7/2017
#Summary: Extract ArcGIS Feature Service Attachments into Field URL's
import copy, json, sys
from arcgis.gis import GIS
photo_field_name = 'attachment_url'
USERNAME = ''
PASSWORD = ''
# Joshua Tanner
# Loop through a CSV and Feature Class
# to update the fields
import csvkit, os
inCSV = "\\location\\of\\file"
data = {}
indexfield = "id"
reader = csvkit.py3.CSVKitDictReader(open(inCSV))
@tannerjt
tannerjt / replacehtml.py
Created April 5, 2017 21:12
Replace all HTML from fields in Esri feature class
from bs4 import BeautifulSoup
import urllib
import os
mxd = arcpy.mp.ArcGISProject('current')
map = mxd.listMaps()[0]
layer = map.listLayers()[0]
fields = ["title", "standardPlace", "content", "actor", "reflection", "contactName"]
@tannerjt
tannerjt / states.js
Created December 12, 2016 23:44
USA State BBoxes
const bboxes = {
"Mississippi": [
-91.636942,
30.173943,
-88.097888,
34.996052
],
"Oklahoma": [
-103.002565,
33.615765,
@tannerjt
tannerjt / launch_idle.py
Created December 12, 2016 23:04
Launch IDLE (Python) from virtualenv (venv)
from idlelib.PyShell import main
if __name__ == '__main__'
main()