Skip to content

Instantly share code, notes, and snippets.

View nydame's full-sized avatar

Felicia Betancourt nydame

View GitHub Profile
@nydame
nydame / CA-diabetes-data.csv
Created March 22, 2015 01:00
Exercise 1 for Data Visualization and Infographics with D3
County Premature death Value Adult obesity Value Diabetes Value Premature age-adjusted mortality Value Median household income Value
California 5570 0.232 0.079 287.4 58322
Alameda County 5141 0.207 0.078 267.1 70209
Amador County 7504 0.23 0.098 350.3 51388
Butte County 7944 0.243 0.081 403.8 40748
Calaveras County 6938 0.258 0.091 323.2 50962
Colusa County 5945 0.226 0.078 299.8 49871
Contra Costa County 5257 0.237 0.076 263 74208
Del Norte County 9671 0.255 0.088 455.4 37305
El Dorado County 5170 0.203 0.081 259.9 68446
@nydame
nydame / CA-diabetes-data.csv
Last active August 29, 2015 14:18
Exercise 2 for Data Visualization and Infographics with D3
California 5570 0.232 0.079 287.4 58322
Alameda County 5141 0.207 0.078 267.1 70209
Amador County 7504 0.23 0.098 350.3 51388
Butte County 7944 0.243 0.081 403.8 40748
Calaveras County 6938 0.258 0.091 323.2 50962
Colusa County 5945 0.226 0.078 299.8 49871
Contra Costa County 5257 0.237 0.076 263 74208
Del Norte County 9671 0.255 0.088 455.4 37305
El Dorado County 5170 0.203 0.081 259.9 68446
@nydame
nydame / CA-diabetes-data.csv
Created April 10, 2015 04:14
Exercise 3 for Data Visualization and Infographics with D3
California 5570 0.232 0.079 287.4 58322
Alameda County 5141 0.207 0.078 267.1 70209
Amador County 7504 0.23 0.098 350.3 51388
Butte County 7944 0.243 0.081 403.8 40748
Calaveras County 6938 0.258 0.091 323.2 50962
Colusa County 5945 0.226 0.078 299.8 49871
Contra Costa County 5257 0.237 0.076 263 74208
Del Norte County 9671 0.255 0.088 455.4 37305
El Dorado County 5170 0.203 0.081 259.9 68446
@nydame
nydame / CA-diabetes-data.csv
Last active August 29, 2015 14:19
Exercise 4 for Data Visualization and Infographics with D3
California 5570 0.232 0.079 287.4 58322
Alameda County 5141 0.207 0.078 267.1 70209
Amador County 7504 0.23 0.098 350.3 51388
Butte County 7944 0.243 0.081 403.8 40748
Calaveras County 6938 0.258 0.091 323.2 50962
Colusa County 5945 0.226 0.078 299.8 49871
Contra Costa County 5257 0.237 0.076 263 74208
Del Norte County 9671 0.255 0.088 455.4 37305
El Dorado County 5170 0.203 0.081 259.9 68446
@nydame
nydame / CA-diabetes-data.csv
Created April 19, 2015 23:16
Exercise 5 for Data Visualizations and Infographics with D3
California 5570 0.232 0.079 287.4 58322
Alameda County 5141 0.207 0.078 267.1 70209
Amador County 7504 0.23 0.098 350.3 51388
Butte County 7944 0.243 0.081 403.8 40748
Calaveras County 6938 0.258 0.091 323.2 50962
Colusa County 5945 0.226 0.078 299.8 49871
Contra Costa County 5257 0.237 0.076 263 74208
Del Norte County 9671 0.255 0.088 455.4 37305
El Dorado County 5170 0.203 0.081 259.9 68446
@nydame
nydame / index.html
Created April 27, 2015 02:52
Exercise 6 for Data Visualizations and Infographics with D3
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Global Obesity Trends</title>
<script type="text/javascript" src="http://d3js.org/d3.v3.js"></script>
<style type="text/css">
body {
background-color: whitesmoke;
@nydame
nydame / show-bookmarks.js
Last active August 29, 2015 14:20
WordPress shortcode for displaying bookmarks alongside their own favicons
$("#container a").each(function() {
$(this).css({
background: "url(//www.google.com/s2/favicons?domain=" + getDomain(this.href) +
") left center no-repeat",
"padding-left": "20px"
});
});
function getDomain(url) {
return url.match(/:\/\/(.[^/]+)/)[1];
@nydame
nydame / scaleSVGPath.js
Created August 7, 2015 03:13
Scale an SVG path element with a simple javascript function
function scalePathUp(path, num) {
// make sure num is > 0 and DOM element path has "d" attribute
if ( num <= 0 || typeof path.getAttribute("d") !== "string" ) {return false;}
var coords = [],
fragmentsAr = [],
idx,
jdx,
kdx,
lettersAr = [],
@nydame
nydame / vanillaJSutils.js
Last active March 16, 2018 18:07
A few vanilla JavaScript utility functions
// 1. Add and remove classes jQuery-style
/**
* Determines if a given thing is in a given array.
* @param {any} x An object or primitive whose presence in a is being queried
* @param {Array} a Array being queried
* @return {number} -1 if x could not be found in a; otherwise index where it was first found, so 0 would be minimum value
*/
function isThingInArray(x, a) {
if ( Array.isArray(a) ) {
@nydame
nydame / player-js-analysis.md
Last active February 2, 2018 21:28 — forked from R-V-S/player-js-analysis.md
player.js analysis
  1. This file declares a class, Player, instantiates it, and assigns it to a global player variable.
  2. The Player class contains four methods:
    • constructor()
    • playPause()
    • skipTo()
    • setVolume()
  3. The constructor() method sets initial values for the currentlyPlaying, playState, volume, and soundObject properties.
    • currentlyPlaying is set to the first item in album.songs.
    • The initial playState is "stopped".
  • The volume is set to the number 80.