Skip to content

Instantly share code, notes, and snippets.

View malcolm-decuire's full-sized avatar

Malcolm Decuire malcolm-decuire

View GitHub Profile
!function(){function n(n){return n&&(n.ownerDocument||n.document||n).documentElement}function t(n){return n&&(n.ownerDocument&&n.ownerDocument.defaultView||n.document&&n||n.defaultView)}function e(n,t){return t>n?-1:n>t?1:n>=t?0:0/0}function r(n){return null===n?0/0:+n}function u(n){return!isNaN(n)}function i(n){return{left:function(t,e,r,u){for(arguments.length<3&&(r=0),arguments.length<4&&(u=t.length);u>r;){var i=r+u>>>1;n(t[i],e)<0?r=i+1:u=i}return r},right:function(t,e,r,u){for(arguments.length<3&&(r=0),arguments.length<4&&(u=t.length);u>r;){var i=r+u>>>1;n(t[i],e)>0?u=i:r=i+1}return r}}}function o(n){return n.length}function a(n){for(var t=1;n*t%1;)t*=10;return t}function c(n,t){for(var e in t)Object.defineProperty(n.prototype,e,{value:t[e],enumerable:!1})}function l(){this._=Object.create(null)}function s(n){return(n+="")===pa||n[0]===va?va+n:n}function f(n){return(n+="")[0]===va?n.slice(1):n}function h(n){return s(n)in this._}function g(n){return(n=s(n))in this._&&delete this._[n]}function p(){var n=[]
@malcolm-decuire
malcolm-decuire / index.html
Created October 28, 2015 01:45 — forked from phoebebright/index.html
d3 csv nest simple example
<html>
<head>
<title>D3 Simple Nest and CSV Example</title>
<script src="http://d3js.org/d3.v2.js"></script>
</head>
<body>
<script>
@malcolm-decuire
malcolm-decuire / README.md
Created November 23, 2015 07:36
mapping police violence: data

I wanted to explore the data collected by Mapping Police Violence
Using Tabletop.js to get data from the public spreadsheet URL.

Unfortunately each month of data has a slightly different set of column headers and values. I've attempted to normalize all entries to have the same schema:

{
    "name": "Donald Lewis Matkins",
    "race": "Unknown race",
    "gender": "Male",
 "state": "MS",
@malcolm-decuire
malcolm-decuire / README.md
Last active December 18, 2015 20:58
American Lynches

This is a simple map showing the breakdown of lynchings in America. A blue state means lynching victims were primarily black and red state means lynching victims were primarily white.

Built with blockbuilder.org

@malcolm-decuire
malcolm-decuire / README.md
Created November 23, 2015 07:42
Milky Way
@malcolm-decuire
malcolm-decuire / _verify-repair-permissions-disk.md
Created December 11, 2015 23:53 — forked from bzerangue/_verify-repair-permissions-disk.md
Mac OS X Utilities via Terminal: (Verify and Repair: Disk Permissions AND Disk / Software Update / TimeMachine)

Verify and Repair Disk Permissions via Terminal (Mac OS X)

Verify Permissions

diskutil verifyPermissions /

Repair Permissions

diskutil repairPermissions /

@malcolm-decuire
malcolm-decuire / README.md
Last active January 13, 2016 03:52
Gun Violence Scatter Plot

Built with blockbuilder.org

This is a scatter-plot of NRA contributions vs Firearms Deaths per 100K people. Notice TX & TN. I like how CA & NY are right near the $20K for NRA contributions. Contributions are mostly at the state level e.g. state candidates.

Summary: Below are links to datasets regarding NRA contributions & Gun-deaths per 100K people for each state. The intuition I'm going for is this: "what if NRA contributions & Gun deaths are related"

  1. NRA Contributions: http://classic.followthemoney.org//press/ReportView.phtml?r=499
  2. Gun Deaths: https://docs.google.com/spreadsheets/d/1GZP1oymvWHEoRnJjP-XdKfmVIqQX2JXy2DgWuVQ3faw/edit?hl=en#gid=10
@malcolm-decuire
malcolm-decuire / README.md
Created December 19, 2015 19:02
d3.layout.orbit modes

An example of d3.layout.orbit that shows the different modes:

"flat" is the default, demonstrated in earlier examples that use flare.json.

"solar" arranges each satellite in its own ring, equally divided from the set size of the layout.

"atomic" places 2 satellites in orbit in the first ring and 8 in every ring after that.

"custom" is achieved by passing an array of integers. Each integer sets the number of satellites in that ring, with the final value used to set the number of satellites in all remaining rings. Under the hood, "solar" could be achieved by passing [1], "atomic" could be achieved by passing [2,8] and "flat" could be achieved by passing [9999].

@malcolm-decuire
malcolm-decuire / README.md
Last active December 21, 2015 19:02
Fractal Kaleidoscope_Beta
@malcolm-decuire
malcolm-decuire / README.md
Last active December 21, 2015 19:10
Lobbying Spending 1998-2015

This data is from www.opensecret.org. This is each industry's lobbying spending from 1998-2015.

FYI: Misc includes: business services, advertising, etc.

The chart employs conventional margins and a number of D3 features: