Skip to content

Instantly share code, notes, and snippets.

View slibby's full-sized avatar

Sam Libby slibby

  • Esri
  • Boulder, CO
View GitHub Profile
@slibby
slibby / keybase.md
Created April 10, 2014 12:34
keybase.md

Keybase proof

I hereby claim:

  • I am slibby on github.
  • I am slibby (https://keybase.io/slibby) on keybase.
  • I have a public key whose fingerprint is 6419 8A04 FF76 F8A6 DE31 F5DA D226 BCB3 1879 2728

To claim this, I am signing this object:

@slibby
slibby / test.geojson
Created April 14, 2014 20:46
test.geojson
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@slibby
slibby / IPs_to_SecurityGroup_Rules.py
Last active August 29, 2015 14:00
Create new security group in EC2 from list of IP address/CIDR blocks
import boto.ec2
conn = boto.ec2.connect_to_region("us-west-1",
aws_access_key_id='',
aws_secret_access_key='')
web = conn.create_security_group('NewSG','New Security Group')
ips ="0.0.0.0/0,1.1.1.1/32" #etc
ips = ipranges.split(',')
for ip in ips:
web.authorize('tcp',443,443,ip)
for ip in ips:
@slibby
slibby / gist:078d9599a205b8cf01b8
Created June 8, 2015 17:01
solutions geoevent install output
[INFO] Scanning for projects...
[WARNING]
[WARNING] Some problems were encountered while building the effective model for com.esri.geoevent.solutions.transport.tcpsquirt:tcpsquirt-transport:bundle:10.3.0
[WARNING] 'build.plugins.plugin.version' for org.apache.felix:maven-bundle-plugin is missing. @ line 53, column 12
[WARNING]
[WARNING] Some problems were encountered while building the effective model for com.esri.geoevent.solutions.adapter:regexText-adapter:bundle:10.3.0
[WARNING] 'dependencies.dependency.systemPath' for com.esri.ges.adapter:text-adapter:jar refers to a non-existing file C:\Program Files\ArcGIS\Server\GeoEvent\system\com\esri\ges\framework\adapter\text-adapter\10.3.0\text-adapter-10.3.0.jar @ line 27, column 16
[WARNING]
[WARNING] It is highly recommended to fix these problems because they threaten the stability of your build.
[WARNING]
http://www.mariettaga.gov/arcgis/rest/services/ExternalViewer2/MapServer/35/query?where=1%3D1&text=&objectIds=&time=&geometry=&geometryType=esriGeometryEnvelope&inSR=&spatialRel=esriSpatialRelIntersects&relationParam=&outFields=&returnGeometry=true&maxAllowableOffset=&geometryPrecision=&outSR=&returnIdsOnly=false&returnCountOnly=false&orderByFields=&groupByFieldsForStatistics=&outStatistics=%5B%0D%0A++%7B%0D%0A++++%22statisticType%22%3A+%22count%22%2C%0D%0A++++%22onStatisticField%22%3A+%22SPEED_LIM%22%2C+%0D%0A++++%22outStatisticFieldName%22%3A+%22SPEED_LIM_COUNT%22%0D%0A++%7D%0D%0A%5D&returnZ=false&returnM=false&gdbVersion=&returnDistinctValues=false&f=html
{
"displayFieldName": "",
"fieldAliases": {
"SPEED_LIM_COUNT": "SPEED_LIM_COUNT"
},
"fields": [
{
"name": "SPEED_LIM_COUNT",
@slibby
slibby / buffer_squares.js
Last active September 23, 2016 23:21
Turf.js code to generate buffered squares
//define
var turf = require("turf");
var fs = require('fs');
var util = require("util");
var center = turf.point([0,0])
var distances = [10,20,30,40]
// create output container
var features = []
@slibby
slibby / printtask.py
Created August 19, 2015 15:15
Print task which replaces HTTPS FQDN URLs with http://ip
import arcpy
import os
import uuid
# Input WebMap json
Web_Map_as_JSON = arcpy.GetParameterAsText(0)
Web_Map_as_JSON = Web_Map_as_JSON.replace("https://FQDN","http://localIP")
# The template location in the server data store
template = arcpy.GetParameterAsText(2)
c:\Esri\Github\machine>python test.py
.E...E......F.F........E..............................E...2015-08-26 15:28:38,965 WARNING: Failed to authenticate SNS handler
.2015-08-26 15:28:39,077 WARNING: Mismatched /hook signatures: sha1=79c627d0a3f18ffb913fbbca70f6d9d983aa7c83 vs. sha1=80c4b24a90baa10a63811b
d05f396b658a5759bc, sha1=94c05fcb02b3790f99dd17248070863c63ac685c
. 12432 225.7 WARNING: Error in process_one.process()
Traceback (most recent call last):
File "C:\Python34\lib\site-packages\openaddresses_machine-2.1.2-py3.4.egg\openaddr\process_one.py", line 33, in process
if json.load(file).get('skip', None):
File "C:\Python34\lib\json\__init__.py", line 268, in load
parse_constant=parse_constant, object_pairs_hook=object_pairs_hook, **kw)
@slibby
slibby / webmap.json
Created November 11, 2015 22:05
test
{
"item": {
"title": "New Map",
"snippet": "test",
"extent": [
[
-79.20332031247852,
-27.611271424607484
],
[
@slibby
slibby / index.html
Created November 11, 2015 22:05
test
<!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">