Skip to content

Instantly share code, notes, and snippets.

View ajturner's full-sized avatar
🗺️
Considering WhereCamps

Andrew Turner ajturner

🗺️
Considering WhereCamps
View GitHub Profile
@ajturner
ajturner / measure.py
Last active February 25, 2024 21:27
Read data from a serial port and plot
# !pip3 install pyserial
import serial
ser = serial.Serial('/dev/cu.usbmodem1101') # open serial port
print(ser.name) # check which port was really used
ser.close()
data = {}
material = 'Pencil'
@ajturner
ajturner / OPTIONS.rb
Created February 17, 2011 21:10
make Rails respond to an HTTP OPTIONS method request
# Add to routes.rb
# Needed for responding to OPTIONS http method
map.connect '*path',
:controller => 'home',
:action => 'options_for_mopd',
:conditions => {:method => :options}
# in home_controller.rb
@ajturner
ajturner / index.html
Created November 20, 2015 22:09
Esri Vector Tiles + Mapbox GL JS
<!DOCTYPE html>
<html>
<head>
<meta charset='utf-8' />
<title></title>
<meta name='viewport' content='initial-scale=1,maximum-scale=1,user-scalable=no' />
<script src='https://api.tiles.mapbox.com/mapbox-gl-js/v0.11.4/mapbox-gl.js'></script>
<link href='https://api.tiles.mapbox.com/mapbox-gl-js/v0.11.4/mapbox-gl.css' rel='stylesheet' />
<style>
body { margin:0; padding:0; }
@ajturner
ajturner / index.html
Created March 4, 2020 15:25
Interactive legend built with CSS
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=7, IE=9, IE=10"/>
<title></title>
<link rel="stylesheet" type="text/css" href="//js.arcgis.com/3.7/js/esri/css/jsapi.css"/>
<link rel="stylesheet" type="text/css" href="http://fonts.googleapis.com/css?family=News+Cycle"/>
@ajturner
ajturner / index.html
Created March 4, 2020 15:21
Interactive Legend built with CSS.
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=7, IE=9, IE=10"/>
<title></title>
<link rel="stylesheet" type="text/css" href="//js.arcgis.com/3.7/js/esri/css/jsapi.css"/>
<link rel="stylesheet" type="text/css" href="http://fonts.googleapis.com/css?family=News+Cycle"/>
@ajturner
ajturner / index.html
Created August 25, 2015 21:07
Charter Schools
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<link rel="stylesheet" href=
"http://js.arcgis.com/3.14/esri/css/esri.css">
<link rel="stylesheet" type="text/css" href=
"https://rawgit.com/benheb/legend/master/legend.css">
@ajturner
ajturner / nav_sidebar.html
Created June 6, 2019 14:10
Example adding a navigation sidebar to an ArcGIS Hub page - http://geohub.brampton.ca/pages/globally-aware-locally-active-economy
<style>
body {
font-size: 16px
}
a:link {
color: white
}
a:hover {
@ajturner
ajturner / readme.md
Last active June 12, 2018 09:59
Hub Framework developer components
@ajturner
ajturner / EncodedPolyline.js
Created November 21, 2010 22:32
Javascript tools for encoding polylines
// PolylineEncoder.js copyright Mark McClure April/May 2007
//
// This software is placed explicitly in the public
// domain and may be freely distributed or modified.
// No warranty express or implied is provided.
//
// History:
// V 2.1 July 2007
// Minor modification in distance function to enhance
// speed. Suggested by Joel Rosenberg.
@ajturner
ajturner / index.html
Last active July 28, 2017 15:29
School Attendance Zones (Elementary)
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<link rel="stylesheet" href=
"http://js.arcgis.com/3.14/esri/css/esri.css">
<link rel="stylesheet" type="text/css" href=
"https://rawgit.com/benheb/legend/master/legend.css">