Skip to content

Instantly share code, notes, and snippets.

View slattery's full-sized avatar

Mike Slattery slattery

View GitHub Profile
@slattery
slattery / README.md
Created February 21, 2019 21:43 — forked from tnightingale/README.md
Leaflet + D3js: Hexbin

This hexbin map shows the proximity of earthquakes (magnitude 3.0 or greater) in the Canterbury region of New Zealand during the month of September, 2010.

The map is created using Leaflet. The hexbin layer is a custom Leaflet layer which uses d3js to generate a svg hexbin overlay. The source for the custom leaflet layer is viewable here.

Earthquake data sourced from GeoNet.

@slattery
slattery / .block
Created November 10, 2018 23:22 — forked from micahstubbs/.block
Chatty Map II
license: MIT
border: none
height: 510
@slattery
slattery / OpenshiftOrigin.md
Created October 4, 2018 19:17 — forked from kuchibs/OpenshiftOrigin.md
Use Ansible to install Openshift Origin (oc) single node cluster on number of machines!

Install OpenShift Origin on one node (CENTOS) - commands:

1) Install docker

yum install docker -y 
systemctl start docker

Note:

echo "INSECURE_REGISTRY='--insecure-registry 172.30.0.0/16'" >> /etc/sysconfig/docker
systemctl enable docker
@slattery
slattery / regen-domain-types.js
Created June 14, 2018 15:34 — forked from adamkl/regen-domain-types.js
Generating typescript definitions from .graphql files using apollo-codegen and graphql-code-generator
const { introspectSchema } = require("apollo-codegen");
const { executeWithOptions } = require("graphql-code-generator/dist/cli");
const fs = require("fs");
const path = require("path");
const graphqlPath = "./src/graphql/";
const schemaInput = "./src/graphql/temp.graphql";
const jsonOutput = "./src/graphql/temp.json";
const dtsOutput = "./src/graphql/domain.d.ts";
@slattery
slattery / athena.R
Created May 8, 2018 19:10 — forked from russellpierce/athena.R
Connect to AWS Athena using R (with the option to use IAM credentials)
#repsych is on github and is here only for the glibrary idiom
library(repsych)
#install and load the following packages
glibrary(whisker, lubridate, magrittr, rappdirs, awsjavasdk, rJava)
if (!aws_sdk_present()) {
install_aws_sdk()
}
load_sdk()
@slattery
slattery / Dockerrun.config.json
Created July 3, 2017 20:11 — forked from travist/Dockerrun.config.json
Form.io AWS Docker Deployment Configuration
{
"AWSEBDockerrunVersion": "1",
"Authentication": {
"Bucket": "formio-docker",
"Key": ".dockercfg"
},
"Image": {
"Name": "formio/formio-server:latest",
"Update": "true"
},
./bin/drill-embedded                                                                                           
OpenJDK 64-Bit Server VM warning: ignoring option MaxPermSize=512M; support was removed in 8.0
Apr 19, 2017 4:53:50 PM org.glassfish.jersey.server.ApplicationHandler initialize
INFO: Initiating Jersey application, version Jersey: 2.8 2014-04-29 01:25:26...
apache drill 1.10.0 
"drill baby drill"

Now visit link http://localhost:8047 to open up Apache Drill explorer and configure S3 storage plugin refer

@slattery
slattery / app.R
Created May 30, 2017 16:07 — forked from leonawicz/app.R
Use custom local image files as icons in a Shiny Dashboard value box
#
# This Shiny web application demonstrates the use of custom image files
# in place of icons for value boxes in Shiny Dashboard by overriding two
# functions:
#
# 'icon' from the shiny package and 'valueBox' from the shinydashboard package.
#
# Each function adds minimal, specific additional handling of image files.
# Note: A custom css file must also be included so that value boxes can
# display the icons. For that reason, do not expect images in place of icons to
@slattery
slattery / gettsv.sh
Created May 12, 2017 16:27 — forked from smelendez/gettsv.sh
Download a Google Spreadsheet as a TSV
#!/bin/bash
wget -O - 'https://docs.google.com/spreadsheet/pub?key=0AjUUa__FW_6RdERnMnBFX2xPQS01dC11WWxmQXhZcWc&single=true&gid=0&output=txt' | cut -f1,2,4 > spreadsheet.tsv
@slattery
slattery / AGO_PullHostedFeatures.py
Created February 9, 2017 18:39 — forked from oevans/AGO_PullHostedFeatures.py
Python script to pull hosted features with attachments into a local file geodatabase. See ReadMe below.
import os, urllib, urllib2, datetime, arcpy, json
## ============================================================================== ##
## function to update a field - basically converts longs to dates for date fields ##
## since json has dates as a long (milliseconds since unix epoch) and geodb wants ##
## a proper date, not a long.
## ============================================================================== ##
def updateValue(row,field_to_update,value):
outputfield=next((f for f in fields if f.name ==field_to_update),None) #find the output field