Skip to content

Instantly share code, notes, and snippets.

View scotthmurray's full-sized avatar
🤔

Scott Murray scotthmurray

🤔
View GitHub Profile
@scotthmurray
scotthmurray / 10PRINT.js
Created January 23, 2013 17:37
A simple JavaScript interpretation of the title of this book: https://mitpress.mit.edu/books/10-print-chr2055rnd1-goto-10-0 (Not as elegant as the original, I know.)
var numTimes = 100;
var r = "";
var c = function() {
var rand = Math.random(0, 1);
if (rand < 0.5) {
return "/";
} else {
return "\\";
@scotthmurray
scotthmurray / links.md
Last active December 15, 2015 05:09 — forked from anonymous/links.md
@scotthmurray
scotthmurray / DataJournalismJobs.md
Last active July 13, 2019 18:19
Ideas for where to post and publicize open data journalism positions

Where to Post your Data Journalism Jobs

Update: This has moved. An updated and maintained version is here: http://alignedleft.com/resources/data-vis-jobs

I posed this question on Twitter:

If you wanted to hire a “data journalist” to support an existing reporting team with data parsing + vis, how would you find that person?

I've documented the responses here. Basically, there seems to be only one job site specifically for data journalists (so far!), and several others, depending on which audience you want to reach (e.g., more focused on development, data vis, or journalism).

@scotthmurray
scotthmurray / README.md
Last active August 29, 2015 13:57
The United States of Bouncy Balls

Takes mbostock’s shape tweening example as a starting point, then devolves into ridiculousness. Try mousing over paths, and also clicking! Never use this for a real mapping project, except perhaps as inspiration for creating a legitimate outlines-to-Dorling transition.

@scotthmurray
scotthmurray / README.md
Last active February 1, 2022 22:32
Fade to Front

Click each shape above to move it to the front.

SVG doesn’t include a concept of z-index, layering, or depth, except that elements that exist later in an SVG document are drawn “on top”. But when designing interactive pieces, we often want shapes that the user has selected / clicked / interacted with to be moved “on top,” to prevent occlusion and ensure visibility.

It’s easy to take an element and simply move it to the bottom of its parent container:

var moveToFront = function() { 
	this.parentNode.appendChild(this); 
}
@scotthmurray
scotthmurray / Important.txt
Created December 4, 2014 19:01
Really Important
some really important information to share
@scotthmurray
scotthmurray / Better Life Index Data.csv
Created December 4, 2014 19:06
OECD Better Life Index Data
We can make this file beautiful and searchable if this error is corrected: It looks like row 6 should actually have 25 columns, instead of 13. in line 5.
Country,Dwellings without basic facilities,Housing expenditure,Rooms per person,Household net adjusted disposable income,Household net financial wealth,Employment rate,Job security,Long-term unemployment rate,Personal earnings,Quality of support network,Educational attainment,Student skills,Years in education,Air pollution,Water quality,Consultation on rule-making,Voter turnout,Life expectancy,Self-reported health,Life satisfaction,Assault rate,Homicide rate,Employees working very long hours,Time devoted to leisure and personal care
Australia,1.1,20,2.3,31197,38482,72,4.4,1.06,46585,93,74,512,18.8,13,93,10.5,93,82,85,7.4,2.1,0.8,14.23,14.41
Austria,1,21,1.6,29256,48125,73,3.4,1.07,43837,95,82,500,16.9,27,95,7.1,75,81.1,69,7.5,3.4,0.5,8.61,14.46
Belgium,1.9,20,2.3,27811,78368,62,4.5,3.37,47276,91,71,509,18.8,21,84,4.5,89,80.5,74,7.1,6.6,1.2,4.41,15.71
Brazil,6.7,21,1.4,10310,6875,67,4.8,2.17,7909,90,43,402,16.3,18,67,4,79,73.4,69,7.2,7.9,25.5,10.74,14.97
Canada,0.2,22,2.5,30212,63261,72,6.6,0.9,44017,94,89,522
@scotthmurray
scotthmurray / betterlifeindex.csv
Created December 10, 2014 18:57
Better Life Test
We can make this file beautiful and searchable if this error is corrected: It looks like row 6 should actually have 25 columns, instead of 13. in line 5.
Country,Dwellings without basic facilities,Housing expenditure,Rooms per person,Household net adjusted disposable income,Household net financial wealth,Employment rate,Job security,Long-term unemployment rate,Personal earnings,Quality of support network,Educational attainment,Student skills,Years in education,Air pollution,Water quality,Consultation on rule-making,Voter turnout,Life expectancy,Self-reported health,Life satisfaction,Assault rate,Homicide rate,Employees working very long hours,Time devoted to leisure and personal care
Australia,1.1,20,2.3,31197,38482,72,4.4,1.06,46585,93,74,512,18.8,13,93,10.5,93,82,85,7.4,2.1,0.8,14.23,14.41
Austria,1,21,1.6,29256,48125,73,3.4,1.07,43837,95,82,500,16.9,27,95,7.1,75,81.1,69,7.5,3.4,0.5,8.61,14.46
Belgium,1.9,20,2.3,27811,78368,62,4.5,3.37,47276,91,71,509,18.8,21,84,4.5,89,80.5,74,7.1,6.6,1.2,4.41,15.71
Brazil,6.7,21,1.4,10310,6875,67,4.8,2.17,7909,90,43,402,16.3,18,67,4,79,73.4,69,7.2,7.9,25.5,10.74,14.97
Canada,0.2,22,2.5,30212,63261,72,6.6,0.9,44017,94,89,522
@scotthmurray
scotthmurray / index.html
Created December 11, 2014 01:04
SVG Resize Test
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>SVG Resize Test</title>
<script type="text/javascript" src="http://d3js.org/d3.v3.js"></script>
<style type="text/css">
body {
background-color: #50BCE8;
We can make this file beautiful and searchable if this error is corrected: It looks like row 4 should actually have 41 columns, instead of 1. in line 3.
Country,Rank,Score,ScoreReversedHighGood,UndernourishmentStandard,UnderweightStandard,EnoughtoEatScore,EnoughtoEatScoreReversed,FoodPriceLevelStandard,FoodPriceInflationStandard,AffordScore,AffordScoreReversed,NutritionDiversityStandard,SafeWaterStandard,FoodQualityScore,FoodQualityScoreReversed,DiabetesStandard,ObesityStandard,UnhealthyEatingScore,UnhealthyEatingScoreReversed,RawUndernourish,RawUnderweight,RawFoodPrice,RawInflationVolatility,RawDietDiversity,RawSafeWater,RawDiabetes,RawObesity,Code,Region,Incomegroup,Driver1,Driver2,Driver3,DriverBest,DriverBestF,Driver1a,Driver2a,Driver3a,DriverWorst,DriverWorstF
Netherlands,1,6,94,0,0,0,100,6,7,7,93,3,0,2,98,9,25,17,83,13.3,16.6,2.02,0.039440707,57,74.4,8.8,10.3,NLD,Europe & Central Asia,High income: OECD,100,100,100,100,Enough to Eat,7,7,17,17,Unhealthy Eating
France,2,8,92,0,0,0,100,14,3,9,91,10,0,5,95,12,24,18,82,4,0.9,2.03,0.082913198,45,97.8,6.3,7.7,FRA,Europe & Central Asia,High income: OECD,100,100,100,100,Enough to Eat,9,9,18,18,Unhealthy Eating
Sw