This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name": "flare", | |
"children": [ | |
{ | |
"name": "analytics", | |
"children": [ | |
{ | |
"name": "cluster", | |
"children": [ | |
{"name": "AgglomerativeCluster", "size": 3938}, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Add space for double click highlight in imo.im | |
// @namespace http://imo.im | |
// @version 0.1 | |
// @description add a space before imo.im posts so double click highlight is functional | |
// @match https://imo.im | |
// @copyright 2012+, @jakl | |
// ==/UserScript== | |
setTimeout(function(){ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function(exports){ | |
fetchGzipped = function(url, cb){ | |
var req = new XMLHttpRequest() | |
req.open('GET', url, true) | |
req.responseType = 'arraybuffer' | |
req.onload = function(){ | |
gzdata = new Uint8Array(req.response) | |
data = (new Zlib.Gunzip(gzdata)).decompress() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name": "flare", | |
"children": [ | |
{ | |
"name": "analytics", | |
"children": [ | |
{ | |
"name": "cluster", | |
"children": [ | |
{"name": "AgglomerativeCluster", "size": 3938}, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'rubygems' | |
require 'csv' | |
require 'pry' | |
desc "Dump a representative set of test/dev data" | |
task :dump => :environment do | |
#Load models so they are available for the ActiveRecord::Base.descendants call | |
Dir.foreach("#{Rails.root}/app/models") do |f| | |
require f if f =~ /.*\.rb/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var binary_xhr = require('binary-xhr'); | |
var zlib = require('zlib-browserify'); | |
binary_xhr('data.gz', function(e, data){ | |
zlib.gunzip(new Uint8Array(data), function(e, result){ | |
console.log(e, result); // e: undefined, result: Buffer {0: 80, 1: 75, 2: 3, 3: 4, 4: 20...} | |
}); | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
window.Buffer = require('buffer'); | |
var inflate = require('inflate'); | |
var binary_xhr = require('binary-xhr'); | |
var Stream = require('stream').Stream; | |
var util = require('util'); | |
function FakeStream(){ | |
this.readable = true; | |
}; |
This simple bar chart is constructed from a TSV file storing the frequency of letters in the English language. The chart employs conventional margins and a number of D3 features:
- d3.tsv - load and parse data
- d3.format - format percentages
- d3.scale.ordinal - x-position encoding
- d3.scale.linear - y-position encoding
- d3.max - compute domains
- d3.svg.axis - display axes