Skip to content

Instantly share code, notes, and snippets.

View jgoodall's full-sized avatar

John Goodall jgoodall

View GitHub Profile
-include .env
PROJECTNAME := $(shell basename "$(PWD)")
GO ?= go
GOBUILD := $(GO) build
GOARCH := amd64
BIN_DIR := ./bin
GOFILES := $(shell find . -name "*.go")
@jgoodall
jgoodall / README.md
Last active July 27, 2023 02:45
Download flag css and convert to 3 char country codes

Download SVG country flags and css, then convert the codes from the iso 3166 two character codes to three character codes.

Usage

./get_flags.sh

Then copy the flag-icon.css file into public/css and the flags directory to public/.

@jgoodall
jgoodall / README.md
Last active August 29, 2015 14:17 — forked from mbostock/.block

This stacked bar chart is constructed from a CSV file storing the populations of different states by age group. The chart employs conventional margins and a number of D3 features:

@jgoodall
jgoodall / README.md
Created March 7, 2014 02:11
This script will download web pages and spit out the title, url, and text in a separate file

This script will download web pages and spit out the title, url, and text in a separate file.

Usage:

  1. Create a file articles with newline separated list of URLs to download
  2. Run python extract.py

Prerequisite: newspaper is used for text extraction. Install: pip install newspaper

@jgoodall
jgoodall / index.js
Last active December 27, 2015 02:19
[redis sorted sets](http://redis.io/commands#sorted_set) speed testing with [node-redis](https://github.com/mranney/node_redis). npm install -d node index.js
/* globals require, console, process, setInterval */
'use strict';
var async = require('async')
, redis = require('redis')
, client = redis.createClient();
client.on('error', function(err) {
console.error(err);
});
@jgoodall
jgoodall / index.html
Created September 12, 2013 15:52
intro to d3: scatterplot with transitions
<!DOCTYPE html>
<meta charset="utf-8">
<style>
.circle {
fill: steelblue;
stroke: '#fff';
}
.label {
fill: #777;
}
@jgoodall
jgoodall / index.html
Last active December 22, 2015 22:28
intro to d3: scatterplot using scales and axes
<!DOCTYPE html>
<meta charset="utf-8">
<style>
.circle {
fill: steelblue;
stroke: '#fff';
}
.label {
fill: #777;
}
@jgoodall
jgoodall / index.html
Created September 12, 2013 15:50
intro to d3: basic scatterplot
<!DOCTYPE html>
<meta charset="utf-8">
<style>
.circle {
fill: steelblue;
stroke: '#fff';
}
</style>
<body>
<script src="http://d3js.org/d3.v3.min.js"></script>
@jgoodall
jgoodall / index.html
Last active December 22, 2015 22:09
intro to d3: dynamic properties
<!DOCTYPE html>
<meta charset="utf-8">
<body>
<script src="http://d3js.org/d3.v3.min.js"></script>
<script>
// 1. select all p elements (there are none)
// 2. then bind some data to the elements - data always expects an [array],
// d3's selectAll returns a placeholder since there are no p elements yet
// 3. do something with incoming data via the enter() method. since there are
@jgoodall
jgoodall / index.html
Last active December 22, 2015 22:09
intro to d3: skeleton
<!DOCTYPE html>
<meta charset="utf-8">
<body>
<script src="http://d3js.org/d3.v3.min.js"></script>
<script>
  
console.log('append the svg to the body of the page');
var svg = d3.select("body")
.append("svg")