Skip to content

Instantly share code, notes, and snippets.

@infoburp
infoburp / d3.v2.js
Created August 22, 2012 17:40
simple d3 force example played with a bit
(function() {
if (!Date.now) Date.now = function() {
return +(new Date);
};
try {
document.createElement("div").style.setProperty("opacity", 0, "");
} catch (error) {
var d3_style_prototype = CSSStyleDeclaration.prototype, d3_style_setProperty = d3_style_prototype.setProperty;
d3_style_prototype.setProperty = function(name, value, priority) {
d3_style_setProperty.call(this, name, value + "", priority);
@infoburp
infoburp / fft.js
Created August 4, 2012 00:28
javascript fft
//do fast fourier transform on audio input.
//with thanks to Jeffrey Clymer for allowing the use of this code
var screenx=512, screeny=200, offset=10, x;
var yr = new Array(512); yi = new Array(512);
var n=1024, g=10, p=2*Math.PI/n, g1, l, m, k, k1, k2, k3;
var y1, y2, j;
var dend = "px; position:absolute; top:1px; width:2px; height:2px; font-size=1; background-color:#0000ff\'></div>"
var fend = "px; position:absolute; top:1px; width:1px; height:2px; font-size=1; background-color:#0000ff\'></div>"