Skip to content

Instantly share code, notes, and snippets.

View stuartlynn's full-sized avatar

Stuart Lynn stuartlynn

  • Two Sigma
  • Brooklyn
View GitHub Profile
@stuartlynn
stuartlynn / data.js
Created August 26, 2015 18:58
GeoJSON example for GDI
var geojson = {
"type": "FeatureCollection",
"features": [
{
"type": "Feature",
"properties": {},
"geometry": {
"type": "Polygon",
"coordinates": [
[
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@stuartlynn
stuartlynn / gist:51890ceeadda90102b5e
Created May 27, 2014 16:39
Language stats for project
require 'mongo'
client = Mongo::MongoClient.new
db = client["ouroboros"]
stats = {}
total = db["galaxy_zoo_classifications"].count
done = 0
db["galaxy_zoo_classifications"].find.each do |classification|
@stuartlynn
stuartlynn / gist:d32e62cc4256c8526945
Created May 27, 2014 16:49
Planet hunters language stats
select application_identifier, count(*), count(distinct zooniverse_user_id) from classifications where zooniverse_user_id is not null group by application_identifier
select application_identifier, count(*), count(distinct session_id) from classifications where zooniverse_user_id is null group by application_identifier
@stuartlynn
stuartlynn / gist:91668bf98c46c51aeb6c
Created July 17, 2014 15:50
Processing for PH2 site
import kplr
import json
import csv
import code
import numpy as np
import sys
from itertools import izip
@stuartlynn
stuartlynn / gist:650d44ec7b1deb3904e3
Last active August 29, 2015 14:04
Kelp processing
require 'pg'
require 'rmagick'
require 'pry'
require 'json'
require 'date'
client = PG.connect(dbname: "world")
no_rows = 20#40
no_colls = 20#40
require 'json'
require 'pry'
require 'aws-sdk'
require 'bson'
AWS.config access_key_id: ENV['S3_ACCESS_ID'], secret_access_key: ENV['S3_SECRET_KEY']
s3 = AWS::S3.new
bucket = s3.buckets['zooniverse-static']
@stuartlynn
stuartlynn / gist:7dad3e6b01a12d2957cb
Created October 20, 2014 20:43
Planet hunter mini course analysis
{
"metadata": {
"name": "Minicourse Analysis"
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
{
@stuartlynn
stuartlynn / gist:28e5bb8b294d68603a64
Created November 4, 2014 18:45
Cancer research processing
require 'pry'
require 'bson'
require 'json'
manifest = []
outfile = 'for_testing'
blank_images = []
["MRE11 TMAs.zip"].each do |zip_name|