Skip to content

Instantly share code, notes, and snippets.

View johan's full-sized avatar

Johan Sundström johan

View GitHub Profile
@johan
johan / ted-postrank.rb
Created October 3, 2011 06:39 — forked from igrigorik/ted-postrank.rb
Makes a tsv of the popularity of all TED talks to date using Postrank, if you have a Postrank API key
#! /usr/bin/env ruby
# good with ruby 1.8.7
# not good: the Postrank key used accepts no more traffic, and Google has since
# acquired Postrank, so there currently isn't any way of getting a new one. :-(
require 'rubygems'
require 'nokogiri'
require 'open-uri'
require 'digest/md5'
require 'fastercsv'
@johan
johan / index.html
Created November 11, 2011 09:32 — forked from johan/index.html
Google Maps + D3 + USGS
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="initial-scale=1.0, user-scalable=no"/>
<title>Earthquakes &gt; 1.0 the past week</title>
<script src="http://maps.google.com/maps/api/js?sensor=true"></script>
<script src="http://mbostock.github.com/d3/d3.js?2.5.0"></script>
<script src="http://mbostock.github.com/d3/d3.csv.js?2.5.0"></script>
<script src="http://mbostock.github.com/d3/d3.time.js?2.5.0"></script>
<style type="text/css">
@johan
johan / README.md
Last active December 17, 2015 03:38 — forked from mbostock/.block

A recreation of E.J. Marey’s graphical train schedule. Stations are separated vertically in proportion to geography; thus, the slope of the line reflects the speed of the train: the steeper the line, the faster the train. This display also reveals when and where limited service trains (in orange) are passed by baby bullets (in red). This type of plot is sometimes called a “stringline chart”.

See also the earlier Protovis version by Vadim Ogievetsky.

@johan
johan / README.md
Last active December 12, 2015 06:08 — forked from mbostock/.block
The psy curve

This example demonstrates the construction of the psy curve.

@johan
johan / README.md
Last active December 11, 2015 19:08 — forked from johan/README.md
@johan
johan / README.md
Last active December 11, 2015 18:59 — forked from johan/README.md
Sunny side of the Earth, for any date and time.
@johan
johan / README.md
Last active December 11, 2015 18:59 — forked from mbostock/.block
Solar Terminator on Interrupted Mollweide
@johan
johan / README.md
Last active December 11, 2015 18:48 — forked from mbostock/.block
Why you arrive from the North when flying to the US from Iceland.

When flying to the US via Iceland, you never arrive from the East, but always cross the North US border. This two-point equidistant projection focused on Keflavik airport, Iceland (red) and San José airport, USA (blue) demonstrates why.

The circles are great circles centered on either airport spaced at 10° intervals.

The projection implementation is still a work in progress, hence the visual artifacts; it requires elliptical clipping. Based on a gist by Mike Bostock.

@johan
johan / us-counties.json
Created November 21, 2012 04:20 — forked from mbostock/.block
TopoJSON Examples
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@johan
johan / gist-logs.user.js
Created October 25, 2012 09:06 — forked from noromanba/gist-logs.user.js
Show commit logs on Gist for Greasemonkey
// ==UserScript==
// @name gist logs
// @namsgpace https://www.hatena.ne.jp/noromanba/
// @description Show commit logs on Gist for Greasemonkey
// @include https://gist.github.com/*
// @grant GM_xmlhttpRequest
// @version 2012.10.12.2
// @license WTFPL http://sam.zoy.org/wtfpl/ (Do What The Fuck You Want To Public License)
// @contributor satyr https://gist.github.com/107780
// @contributor saitamanodoruji https://gist.github.com/2653937