Skip to content

Instantly share code, notes, and snippets.

Avatar

Miles Grimshaw milesgrimshaw

View GitHub Profile
@milesgrimshaw
milesgrimshaw / streetscore_cartodb.sql
Created Jun 28, 2014
SQL queries to compile a single table for Street Score exploration
View streetscore_cartodb.sql
## Instersection Commands For StreetScore and TreeCount
UPDATE cb_newyork_streetscore_compiled SET streetscore = (SELECT AVG(q_score) FROM streetscore_newyorkcity WHERE ST_Intersects(the_geom, cb_newyork_streetscore_compiled.the_geom) )
UPDATE cb_newyork_streetscore_compiled SET trees = (SELECT COUNT(*) FROM tree_census_simple WHERE ST_Intersects(the_geom, cb_newyork_streetscore_compiled.the_geom) )
## Collect PLUTO Data
UPDATE nyc_blocks_2010 SET assesstot = (SELECT sum(assesstot) FROM pluto WHERE ST_Intersects(the_geom, nyc_blocks_2010.the_geom) )
@milesgrimshaw
milesgrimshaw / Quirky.rb
Created Jun 11, 2014
Ruby script to collect data from Quirky product pages
View Quirky.rb
# Last Updated: 2014.06.05
# Gems to include
require 'Nokogiri'
require "open-uri"
require 'pp'
require 'json'
require 'csv'
# def get_default_data( default_stats, default_pricing, date_range )
View tech_reading.md
View Response
Dear Miles,
We heard you discovered a security issue with *Kluck*. We take security and privacy very seriously, and our team has worked today to address the concern.
The coordinates you discovered are not exact coordinates; they reflect a radius for a *user* who has given *Kluck* permission to show *the user's* profile, including location. However, to avoid any confusion, we have now disabled that feature. [Redacted]
We sincerely appreciate you bringing this to our attention...[redacted]
Sincerely,
View Response
Dear Miles,
We heard you discovered a security issue with *Kluck*. We take security and privacy very seriously, and our team has worked today to address the concern.
The coordinates you discovered are not exact coordinates; they reflect a radius for a *user* who has given *Kluck* permission to show *the user's* profile, including location. However, to avoid any confusion, we have now disabled that feature. [Redacted]
We sincerely appreciate you bringing this to our attention...[redacted]
Sincerely,
@milesgrimshaw
milesgrimshaw / Kickstarter_Geocoding.R
Last active Aug 29, 2015
Data prep for geocoding
View Kickstarter_Geocoding.R
# Load desired packages
library(lubridate)
library(stringr)
library(ggplot2)
library(scales)
# Set the working directory
getwd()
setwd("~/Desktop/Patreon/")
View Geocoding Apps Script
function addMahZipCodez() {
// grab basic sheet data
var sheet = SpreadsheetApp.getActiveSheet();
var rows = sheet.getDataRange();
var numRows = rows.getNumRows();
var values = rows.getValues();
// init some locals for looping over each row
var row;
@milesgrimshaw
milesgrimshaw / gist:8941929
Created Feb 11, 2014
Analysis of personal Evernote notes archive
View gist:8941929
# Load packages
library(ggplot2)
library(lubridate)
library(stringr)
library(scales)
# Set the working directory
getwd()
setwd("~/Dropbox/Personal/Projects/Evernote_Analysis/files/")
View openpaths data management
## Code for subsetting and formatting open paths data for Mapbox
## Miles Grimshaw
## December 26th 2013
## Set working directory and load required packages
getwd()
setwd("~/Dropbox/Personal/Mapbox/OpenPaths/")
library(stringr)
library(lubridate)
# library(ggplot2)
View convert CSV to geoJSON
require 'csv'
require 'json'
require 'pp'
i = 0
features = []
start_line = []
end_line = []
## Loop through each row of the data
You can’t perform that action at this time.