Skip to content

Instantly share code, notes, and snippets.

View johan's full-sized avatar

Johan Sundström johan

View GitHub Profile
// ==UserScript==
// @name Github: unfold commit history
// @namespace http://github.com/johan/
// @description Adds an "unfold all changesets" button on Commit History pages at github, which lets you browse the source changes without leaving the page. /Click a commit header again to re-fold it.)
// @include https://github.com/*/commits/*
// @include http://github.com/*/commits/*
// ==/UserScript==
(function() {
if ('undefined' == typeof __PAGE_SCOPE_RUN__) { // unsandbox, please!
@johan
johan / require.js
Created August 18, 2011 00:04 — forked from erikvold/require.js
Imports a commonjs style javascript file with loadSubScrpt for restartless Firefox add-ons.
/* Imports a commonjs style javascript file with loadSubScrpt
* By Erik Vold <erikvvold@gmail.com> http://erikvold.com/
*
* @param src (String)
* The url of a javascript file.
*/
(function(global) {
var modules = {}
, tools = {}
, baseURI, io, js;
@johan
johan / index.html
Created September 24, 2011 06:42 — forked from mbostock/.block
Axis Component
<!DOCTYPE html>
<html>
<head>
<script type="text/javascript" src="http://mbostock.github.com/d3/d3.js?2.0.0"></script>
<script type="text/javascript" src="http://mbostock.github.com/d3/d3.csv.js?2.0.0"></script>
<script type="text/javascript" src="http://mbostock.github.com/d3/d3.time.js?2.0.0"></script>
<style type="text/css">
body {
font: 10px sans-serif;
@johan
johan / index.html
Created October 23, 2011 06:06 — forked from mbostock/.block
Recettear characters vs force layout
<!DOCTYPE html>
<html>
<head id="head">
<meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>
<title>Recettear characters</title>
<script type="text/javascript" src="http://mbostock.github.com/d3/d3.js"></script>
<script type="text/javascript" src="http://mbostock.github.com/d3/d3.geom.js"></script>
<script type="text/javascript" src="http://mbostock.github.com/d3/d3.layout.js"></script>
<style type="text/css">
@johan
johan / amo.js
Created October 23, 2011 14:46 — forked from mbostock/.block
Greasemonkey users by browser version (1 month)
// loads AMO browser stats for an AMO public-stats addon (748 = Greasemonkey) for the
// last half a year (or some other number of days), cleans them up and passes them as
// cb([{ date: <Date object>, total: N, "Firefox/6.0": N, … }, { date: … }, …])
function get_amo_stats(cb, addon, days) {
var pipe = 'ed7df07cb426304321a88e3cb875226c'
, nth = get_amo_stats.nth = (get_amo_stats.nth || 0) + 1
, name = 'cb' + nth.toString(36)
, now = new Date
, from = new Date(+now - 864e5 * (days || 365 >> 1))
, aurl = 'https://addons.mozilla.org/en-US/firefox/statistics/csv/'+ (addon || 748)
@johan
johan / index.html
Created October 23, 2011 18:28 — forked from johan/amo.js
Greasemonkey users by browser version (6 months)
<!DOCTYPE html>
<html>
<head>
<title>Greasemonkey users by browser version</title>
<script type="text/javascript" src="http://mbostock.github.com/d3/d3.js?1.29.1"></script>
<script type="text/javascript" src="http://mbostock.github.com/d3/d3.layout.js?1.29.1"></script>
<script type="text/javascript" src="http://mbostock.github.com/d3/d3.time.js?1.29.1"></script>
<script type="text/javascript" src="load_amo_stats.js"></script>
<style type="text/css">
@johan
johan / README.md
Created October 24, 2011 04:53 — forked from mbostock/.block
D3 Show Reel

The first 15 seconds of the D3 show reel. See full video at http://vimeo.com/29862153. Includes seamless transitions between the following visualization types:

  • lines
  • horizons
  • areas
  • stacked areas
  • streamgraph
  • overlapping areas
  • grouped bars
  • stacked bars
@johan
johan / index.html
Created October 26, 2011 01:37 — forked from mbostock/.block
Point-Along-Path Interpolation
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>
<title>Point-Along-Path Interpolation</title>
<script type="text/javascript" src="http://mbostock.github.com/d3/d3.js?2.4.6"></script>
<style type="text/css">
path {
cursor: pointer;
@johan
johan / index.html
Created October 28, 2011 08:00 — forked from mbostock/.block
Google Maps + D3
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="initial-scale=1.0, user-scalable=no"/>
<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=true"></script>
<script type="text/javascript" src="http://mbostock.github.com/d3/d3.js?1.29.1"></script>
<style type="text/css">
html, body, #map {
width: 100%;
@johan
johan / index.html
Created October 28, 2011 09:09 — forked from mbostock/gist:672899
Fast Pointing
<html>
<head>
<title>Pointing</title>
<script type="text/javascript" src="http://github.com/mbostock/protovis/raw/v3.3.1/protovis.js"></script>
<style type="text/css">
#fig {
width: 450px;
height: 425px;
}