Skip to content

Instantly share code, notes, and snippets.

@aht
aht / README.md
Last active January 29, 2016 05:22 — forked from mbostock/.block
Reingold–Tilford Tree

The tree layout implements the Reingold-Tilford algorithm for efficient, tidy arrangement of layered nodes. The depth of nodes is computed by distance from the root, leading to a ragged appearance. Radial orientations are also supported. Implementation based on work by Jeff Heer and Jason Davies using Buchheim et al.'s linear-time variant of the Reingold-Tilford algorithm. Data shows the Flare class hierarchy, also courtesy Jeff Heer.

Compare to this radial layout.

@aht
aht / README.md
Last active August 29, 2015 14:05 — forked from mbostock/.block

Adatao stuff.

@aht
aht / gen.js
Last active August 29, 2015 14:05 — forked from d3noob/.block
var entity = [16657, 586163, 54119, 112654, 185593, 570264, 19441, 843876]
var matrix = [
// 16657, 586163, 54119, 112654, 185593, 570264, 19441, 843876
[0, 10020, 0, 22500, 0, 0, 2500, 0], // 16657
[0, 0, 0, 9988, 0, 0, 0, 0], // 586163
[0, 0, 0, 0, 0, 0, 0, 0], // 54119
[0, 20000, 0, 0, 2500, 0, 0, 0], // 112654
[0, 0, 0, 0, 0, 0, 0, 17500], // 185593
[2487, 0, 0, 0, 0, 0, 2478, 0], // 570264
@aht
aht / chord.sample
Last active August 29, 2015 14:05 — forked from AndrewRP/chord.sample
This is a sample file
http://d3js.org/
http://www.personal.psu.edu/cab38/ColorBrewer/ColorBrewer.html
http://bl.ocks.org/AndrewRP/raw/7468330/
http://bl.ocks.org/AndrewRP/7468330
https://gist.github.com/mbostock/1046712
http://bl.ocks.org/mbostock/1046712
https://github.com/mbostock/d3/wiki/Gallery
http://bl.ocks.org/mbostock
http://bl.ocks.org/mbostock/4062006
@aht
aht / README.md
Last active August 29, 2015 14:05 — forked from mbostock/.block

Chord diagrams show directed relationships among a group of entities. This example also demonstrates simple interactivity by using mouseover filtering. Layout inspired by Martin Krzywinski's beautiful work on Circos.

"""
Automated installation of ejabberd with a postgresql backend inspired by this
article: http://www.planeterlang.org/en/planet/article/How_to_install_ejabberd_2.0.0_with_PostgreSQL_support/
"""
from fabric.api import run, sudo
EJABBERD_VERSION = '2.0.5'
EJABBERD_SOURCE_HOME = '~/dev/xmpp/oss'
POSTGRES_PSQL_PASSWORD = 'user'
@aht
aht / gist:1251197
Created September 29, 2011 16:39 — forked from trrichard/gist:1226966
Bookmarklet to uncripple Kindle Cloud Reader
javascript:(function(){
var importJs=function(jsUrl){
var s=document.createElement("script");
s.setAttribute("src",jsUrl);
document.body.appendChild(s);
};
importJs("http://jqueryjs.googlecode.com/files/jquery-1.3.2.min.js");
})();
$('iframe').contents().find('iframe').each(function() {
this.contentWindow.onclick = null;
@aht
aht / LICENSE.txt
Created August 4, 2011 15:28 — forked from 140bytes/LICENSE.txt
140byt.es -- Click ↑↑ fork ↑↑ to play!
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2011 YOUR_NAME_HERE <YOUR_URL_HERE>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
package main
import (
"rand"
"time"
"flag"
"fmt"
)
func getCoord(rg *rand.Rand) float64 {