Skip to content

Instantly share code, notes, and snippets.

View brendansudol's full-sized avatar

Brendan Sudol brendansudol

View GitHub Profile
@brendansudol
brendansudol / colorz.js
Created July 14, 2013 17:25
A D3.js recreation of Etsy's shopping by color animation.
var width = 660,
height = 600;
var color = d3.scale.linear()
.domain([0, width/4, width/4 * 2, width/4 * 3, width])
.range(["#fb000f", "#6e00fb", "#00fbec", "#8dfb00", "#fb3c00"])
.interpolate(d3.interpolateHsl);
var svg = d3.select("#colorz").append("svg")
.attr("width", width)
hello, world
cat 1/*.txt 2/*.txt 3/*.txt 4/*.txt 5/*.txt > combined.txt
awk '{arr[$1]+=1} END {for (i in arr) {print i,arr[i]}}' combined.txt > counts.txt
sort -nrk 2 counts.txt
@brendansudol
brendansudol / index.html
Last active October 24, 2016 00:42
bar chart constancy
<!doctype html>
<html>
<head>
<script type="text/javascript" src="http://mbostock.github.com/d3/d3.js"></script>
<link type="text/css" rel="stylesheet" href="style.css"/>
<style type="text/css"></style>
</head>
<body>
<p id="chart">
<p id="menu"><b>Top States by Age Bracket, 2008</b><br>Age: <select></select>
@brendansudol
brendansudol / learn_d3.md
Created July 23, 2012 13:04
Learning D3 - a (possibly) helpful roadmap

Learning D3

1. Read Up

Spend a few hours (minimum) going through these materials. It's okay if you don't understand half of it on your first time through (75% is way too much though). I found it super helpful to write out the code snippets and test them out while following along. There are now quite a few D3 tutorials out there, but I found these particularly helpful:

  1. Intro by Mike Bostock, D3 Creator
  2. D3 Workshop (just skim through)
  3. Three Little Circles
  4. A Bar Chart
@brendansudol
brendansudol / README.md
Last active October 24, 2016 00:41
circles and colors
@brendansudol
brendansudol / part2.mdown
Created January 10, 2012 05:52
Brendan Sudol - Part 2

Efficient Market Hypothesis, from Economics

When it comes to investing, many economists believe that a blindfolded monkey throwing darts at a newspaper’s financial pages could select a portfolio of stocks that would do just as well as Wall Street professionals. The idea that picking good stocks is just a matter of luck comes from a fundamental theory in financial economics known as the Efficient Market Hypothesis (EMH).

Introduced by Eugene Fama in the 1960s, the essence of EMH is that at any