Skip to content

Instantly share code, notes, and snippets.

View miketahani's full-sized avatar

Mike Tahani miketahani

View GitHub Profile
@miketahani
miketahani / .block
Last active July 6, 2016 00:47 — forked from mbostock/.block
Stroke Dash Interpolation
license: gpl-3.0
@miketahani
miketahani / GIF-Screencast-OSX.md
Created June 30, 2016 23:11 — forked from dergachev/GIF-Screencast-OSX.md
OS X Screencast to animated GIF

OS X Screencast to animated GIF

This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.

Screencapture GIF

Instructions

To capture the video (filesize: 19MB), using the free "QuickTime Player" application:

@miketahani
miketahani / actions.js
Created April 20, 2016 08:07 — forked from roman01la/actions.js
Redux WebSockets recipe
const MODULE_NAME = 'base-app/events/'
export const CONNECT_WS = MODULE_NAME.concat('CONNECT_WS')
export const DISCONNECT_WS = MODULE_NAME.concat('DISCONNECT_WS')
export const SUBSCRIBE_WS = MODULE_NAME.concat('SUBSCRIBE_WS')
export const UNSUBSCRIBE_WS = MODULE_NAME.concat('UNSUBSCRIBE_WS')
export const EMIT_WS = MODULE_NAME.concat('EMIT_WS')
export const NEW_EVENT = MODULE_NAME.concat('NEW_EVENT')
export const ADD_EVENT = MODULE_NAME.concat('ADD_EVENT')
var request = require('request');
var express = require('express');
var app = express();
app.get('/goofy', function(req, res) {
request('http://images1.wikia.nocookie.net/__cb20120715102950/disney/images/a/a5/Disneygoofy2012.jpeg').pipe(res);
});
app.get('/loop', function(req, res) {
res.render('mypage');
# some convenience functions here, nothing new
'''
# usage:
from easypipe import easy_pipeline
from easypipe import print_metrics
data_folder = "data-hold/20news"
p = easy_pipeline()
print_metrics(p, data_folder)
'''
// This is the core Javascript code for http://windhistory.com/
// I haven't done a full open source release, but I figured I'd put the most important
// D3 code out there for people to learn from. --nelson@monkey.org
/** Common wind rose code **/
// Function to draw a single arc for the wind rose
// Input: Drawing options object containing
// width: degrees of width to draw (ie 5 or 15)
// from: integer, inner radius

A simple div-based data grid, which could be enhanced by adding similar functionlity to SlickGrid, such as virtual rendering.

Basic usage

var grid = d3.divgrid();

d3.csv('cars.csv', function(data) {
  d3.select('#grid')
 .datum(data)

Storytelling from Space: Tools/Resources

This list of resources is all about acquring and processing aerial imagery. It's generally broken up in three ways: how to go about this in Photoshop/GIMP, using command-line tools, or in GIS software, depending what's most comfortable to you. Often these tools can be used in conjunction with each other.

Acquiring Landsat & MODIS

Web Interface

  • Landsat archive

Processing LiDAR to extract building heights

Walk through

Detailed walk through of building extraction using postgis

First lets pull a data layer from of openstreetmap. You can do this any which way you’d like, as there are a variety of methods for pulling openstreetmap data from their database. Check the [wiki] (http://wiki.openstreetmap.org/wiki/Downloading_data) for a comprehensive list. My favourite method thus far is pulling the data straight into QGIS using the open layers plugin. For those who may want to explore this method, check [this tutorial] (http://www.qgistutorials.com/en/docs/downloading_osm_data.html). For building extraction you only need building footprints, and include the building tags. Not all polygons are of type building in OSM, so we can download all the polygons, and then filter the layer for only polygons tagged as buildings.

LiDAR data was pulled from USGS via the Earth Explorer site. [Here] (http://earthobservatory.nasa.gov/blogs/ele