Skip to content

Instantly share code, notes, and snippets.

View erikhazzard's full-sized avatar

Erik Hazzard erikhazzard

View GitHub Profile
@erikhazzard
erikhazzard / inlet.js
Created June 29, 2012 05:20
just another inlet to tributary
var p=d3.scale.category10();
var r=p.range(); // ["#1f77b4", "#ff7f0e", "#2ca02c", "#d62728", "#9467bd",
// "#8c564b", "#e377c2", "#7f7f7f", "#bcbd22", "#17becf"]
var s=d3.scale.ordinal().range(r);
p.domain(); // [] - empty
s.domain(); // [] - empty, see above
console.log(p(0)); // "#1f77b4"
console.log(p(1)); // "#ff7f0e"
console.log(p(2)); // "#2ca02c"
console.log(p.domain()); // [0,1,2];
@erikhazzard
erikhazzard / gist:3041903
Created July 3, 2012 18:52
svg test background zanky
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="500px" height="700px" viewBox="0 0 500 700" enable-background="new 0 0 500 700" space="preserve" title="Visual.ly Chart " Title="Visual.ly Chart ">
<g id="Layer_1">
<g id="_x40_twitter-followers-following-ratio--enoex" onload="({&quot;color-1&quot;:&quot;#b17763&quot;,&quot;color-2&quot;:&quot;#336699&quot;,&quot;color-3&quot;:&quot;#003366&quot;,&quot;color-4&quot;:&quot;#989898&quot;,&quot;color-5&quot;:&quot;#ababab&quot;,&quot;color-6&quot;:&quot;#cdcdcd&quot;,&quot;font_family&quot;:&quot;Oswald&quot;})" transform="translate(15.498001098632812,0)" height="98.00959777832031" width="208.00399780273438"><rect class="bgRect" width="208.004" height="98.0096" x="0" y="0" style="fill: #ffffff; opacity: 0; "></rect><text id="twitter-num-following" text-anchor="middle" font-size="100" fill="#b17763" style="font-family: Oswald; font-size: 78.40767822265624px; dominant-baseline: text-before-edge; "
<!DOCTYPE html>
<html>
<head>
<title>Simple Stack</title>
<style>
svg {
border: solid 1px #ccc;
font: 10px sans-serif;
shape-rendering: crispEdges;
}
<!DOCTYPE html>
<html>
<head>
<title>Simple Stack</title>
<style>
svg {
border: solid 1px #ccc;
font: 10px sans-serif;
shape-rendering: crispEdges;
}
# ==============================================================================
# app.py
# A backend example for the proto demo. Will serve up data and static pages
#
# ==============================================================================
import flask
import datetime
import json
import re
@erikhazzard
erikhazzard / gist:3311383
Created August 10, 2012 05:38
class json example
classJson = {"classes": [
{"name": "Phil 165",
"id": "phil165",
"progress": 1.0 },
{"name": "Ed 111",
"id":"ed111",
"progress": 0.6 },
{"name": "CS 106B",
"id":"cs106b",
"progress": 0.7 },
@erikhazzard
erikhazzard / gist:3346705
Created August 14, 2012 05:51
demo_init_1.js
(function() {
var _this = this;
ZABZO.init = function() {
ZABZO.setupZabzo({
svgId: "#zabzo-svg",
callback: function(){
ZABZO.updateProgress(50);
}
});
[
{
Key: "first_name",
Values: {
Jessica: 6,
Jason: 5,
Ashley: 4,
John: 4,
Katie: 4,
Laura: 3,
@erikhazzard
erikhazzard / gist:3797171
Created September 27, 2012 23:55
full width
<html>
<head>
<style>
body {
bottom: 0;
left: 0;
margin: 0;
padding: 0;
position: absolute;
right: 0;
@erikhazzard
erikhazzard / gist:3797180
Created September 27, 2012 23:58
full height %
<html>
<head>
<style>
body {
min-height: 100%;
}
#my-div {
background: #336699;
height: 100%;
position: relative;