Skip to content

Instantly share code, notes, and snippets.

@mugshepherd
mugshepherd / colorbrewer.js
Last active July 10, 2016 18:43
Pet Lemur Survey Visualization
// This product includes color specifications and designs developed by Cynthia Brewer (http://colorbrewer.org/).
// JavaScript specs as packaged in the D3 library (d3js.org). Please see license at http://colorbrewer.org/export/LICENSE.txt
var colorbrewer = {Blues: {
3: ["#deebf7","#9ecae1","#3182bd"],
4: ["#eff3ff","#bdd7e7","#6baed6","#2171b5"],
5: ["#eff3ff","#bdd7e7","#6baed6","#3182bd","#08519c"],
6: ["#eff3ff","#c6dbef","#9ecae1","#6baed6","#3182bd","#08519c"],
7: ["#eff3ff","#c6dbef","#9ecae1","#6baed6","#4292c6","#2171b5","#084594"],
8: ["#f7fbff","#deebf7","#c6dbef","#9ecae1","#6baed6","#4292c6","#2171b5","#084594"],
9: ["#f7fbff","#deebf7","#c6dbef","#9ecae1","#6baed6","#4292c6","#2171b5","#08519c","#08306b"]
@mugshepherd
mugshepherd / colorbrewer.js
Created July 7, 2016 18:20
dc.js dashboard
var colorbrewer = {Blues: {
3: ["#deebf7","#9ecae1","#3182bd"],
4: ["#eff3ff","#bdd7e7","#6baed6","#2171b5"],
5: ["#eff3ff","#bdd7e7","#6baed6","#3182bd","#08519c"],
6: ["#eff3ff","#c6dbef","#9ecae1","#6baed6","#3182bd","#08519c"],
7: ["#eff3ff","#c6dbef","#9ecae1","#6baed6","#4292c6","#2171b5","#084594"],
8: ["#f7fbff","#deebf7","#c6dbef","#9ecae1","#6baed6","#4292c6","#2171b5","#084594"],
9: ["#f7fbff","#deebf7","#c6dbef","#9ecae1","#6baed6","#4292c6","#2171b5","#08519c","#08306b"]
}};
{
"response": {
"beers": {
"items": [
{
"first_checkin_id": 201952879,
"recent_checkin_id": 201952879,
"rating_score": 4.25,
"first_had": "Fri, 10 Jul 2015 19:23:07 -0500",
"count": 1,
@mugshepherd
mugshepherd / index.html
Last active June 22, 2016 17:39
work from tutorial on d3, dc, and crossfilter.js
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title></title>
<link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/dc/2.0.0-beta.26/dc.css">
<link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/leaflet/0.7.7/leaflet.css">
<link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.6/css/bootstrap.css">
<link rel="stylesheet" type="text/css" href="main.css">
</head>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title></title>
<script src="http://d3js.org/d3.v3.min.js"></script>
<script src="http://d3js.org/topojson.v1.min.js"></script>
<style>
svg {
<!DOCTYPE html>
<meta charset="utf-8">
<title>Streamgraph</title>
<style>
body {
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
margin: auto;
position: relative;
width: 960px;
# Da Quiz
=begin
Your solutions to all the problems below (except for Problem 0)
should be included in this file.
=end
## Problem 0
puts ("Hello, I am C-3P0, human-cybord relations. What is your name?")
user_name = gets.chomp
puts ("It is a pleasure to meet you, #{user_name}. Have you ever met a protocol droid before?")
puts ("Please answer with yes or no.")
met_droid = gets.chomp
puts ("#{met_droid}? How interesting, for someone from around these parts.")
puts ("I'm terribly sorry for prying, but you don't by any chance go by the alias of Obi-Wan Kenobi, do you?")
@mugshepherd
mugshepherd / WDI6_newStudent
Last active August 29, 2015 14:17
Sample code to be added to .bash_profile file for new student. Sets up working directory. Does not put student into GeneralAssembly folder.
new_student(){
cd ~
mkdir ~/GeneralAssembly
cd GeneralAssembly
mkdir -p "Homework/week01/day01" "Notes/week01/day01" "Projects" "Outcomes"
echo "Dont Panic!" > Readme.md
echo "Hey there, student! Welcome to WDI6! I just set up this directory tree for you"
tree ~/GeneralAssembly