Skip to content

Instantly share code, notes, and snippets.

View enjalot's full-sized avatar

Ian Johnson enjalot

View GitHub Profile
@enjalot
enjalot / index.html
Created December 6, 2011 01:55
[dd3] d3.js scales tutorial
<html></html>
@enjalot
enjalot / enja.py
Created December 9, 2011 22:54
simple irc logging script
#!/usr/bin/env python
"""
# A simple IRC Bot, that logs conversation in an IRC Channel
#
# (C) 2008, Pranav Prakash
# Email: [email protected]
#
#
#
@enjalot
enjalot / index.html
Created December 11, 2011 02:58 — forked from mbostock/.block
d3.js sin waves
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>
<style type="text/css">
body {
background: #333;
}
@enjalot
enjalot / index.html
Created December 13, 2011 19:51
safari select bug
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>
<title>Safari Select bug</title>
<style type="text/css">
</style>
</head>
<body>
<button id="select">Select</button>
@enjalot
enjalot / index.html
Created December 20, 2011 21:53
masking with external svg elements
<html>
<head>
<script type="text/javascript" src="http://mbostock.github.com/d3/d3.js?2.6.0"></script>
</head>
<body>
<svg>
<defs>
<mask id="rekt">
<g id="rrr">
@enjalot
enjalot / bar.js
Created December 27, 2011 22:21
Basic CSV Parsing
//Simple d3.js barchart example to illustrate d3 selections
//other good related tutorials
//http://www.recursion.org/d3-for-mere-mortals/
//http://mbostock.github.com/d3/tutorial/bar-1.html
var w = 850
var h = 400
var bars = function(data)
@enjalot
enjalot / boid.js
Created January 6, 2012 06:26
spermboids
// Boid flocking based on http://harry.me/2011/02/17/neat-algorithms---flocking
var boid = (function() {
function boid() {
var position = [0, 0],
velocity = [0, 0],
gravityCenter = null,
gravityMultiplier = 1,
neighborRadius = 50,
mouseRadius = 50,
maxForce = .1,
@enjalot
enjalot / gist:1821600
Created February 13, 2012 23:58 — forked from erikhazzard/gist:1821595
getbbox cs getcomputedlength
<html>
<meta charset='utf-8' />
<head>
</head>
<body>
<svg>
<text id="text_node" y="1em">
<tspan>You</tspan>
<tspan dx='.25em'>shall</tspan>
<tspan dx='.25em'>not</tspan>
@enjalot
enjalot / index.html
Created February 14, 2012 18:58 — forked from erikhazzard/index.html
d3 tspan append
<html>
<meta charset='utf-8' />
<head>
</head>
<body>
<svg>
<text id='text_node' y="20px" text-anchor="start" opacity="1">
<tspan>You</tspan>
<tspan dx='.5em'>shall</tspan>
<tspan dx='.5em' dy='.9em'>not</tspan>
@enjalot
enjalot / bars.js
Created March 22, 2012 06:54
samples for tributary
var w = 600
, h = 467
var data1 = [
5,
20,
55,
60,
89
];