Skip to content

Instantly share code, notes, and snippets.

View jugglebird's full-sized avatar

Chris Hunter jugglebird

View GitHub Profile
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Jigsaw puzzle</title>
<script type="text/javascript">
function save(filename, data)
{
var blob = new Blob([data], {type: "text/csv"});
@jugglebird
jugglebird / index.html
Created October 11, 2011 04:15 — forked from jeffpflueger/index.html
Experiment 1 with d3 and svgweb
<!DOCTYPE html>
<html>
<head>
<!-- SVG web to turn svg into flash for IE
This might not be working on bl.ocks.org for the following reasons:
1) MIME types not added to the bl.ocks.org webserver:
AddType text/x-component htc
AddType application/x-shockwave-flash swf
AddType image/svg+xml svg
# Factory girl, relaxed.
#
# Factory.define :user do |f|
# f.login 'johndoe%d' # Sequence.
# f.email '%{login}@example.com' # Interpolate.
# f.password f.password_confirmation('foobar') # Chain.
# end
#
# Factory.define :post do |f|
# f.user { Factory :user } # Blocks, if you must.
var inject = function(iterable, initial, func) {
var cur = initial
for(var i = 0;i < iterable.length;i++) {
cur = func(cur, iterable[i])
}
return cur
}
var map = function(arr, func) {
return inject(arr, [], function(memo, val) {