Skip to content

Instantly share code, notes, and snippets.

Avatar
🎯
Focusing

Stephen Boyd sspboyd

🎯
Focusing
View GitHub Profile
@sspboyd
sspboyd / .block
Created Apr 19, 2021 — forked from netzwerg/.block
D3.js Simple Template
View .block
license: apache-2.0
border: no
height: 550
@sspboyd
sspboyd / .block
Created Apr 18, 2021 — forked from widmerin/.block
D3.js Life in Weeks
View .block
license: apache-2.0
border: no
height: 900
View player_data.csv
Player Pos GP G A P
Nikita Soshnikov R 70 7 7 14
Wayne Primeau C 59 3 5 8
Michael Grabner L 80 9 9 18
Keith Aulie D 57 2 2 4
Richard Panik R 76 11 6 17
Andrew MacWilliam D 12 0 2 2
Roman Polak D 240 12 33 45
Mason Raymond L 82 19 26 45
Nick Spaling C 35 1 6 7
@sspboyd
sspboyd / sketch.js
Created Oct 28, 2020
Minimal P5.js Instance Mode template
View sketch.js
const s = (p55) => { // using p55 to refer to the sketch - throwback to Processing megabucket era :)
// Declare some globals
let canvasW = 521;
let canvasH = 521;
p55.preload = () => {
// load any fonts, data, etc...
};
p55.setup = () => {
@sspboyd
sspboyd / sketch.js
Last active Oct 26, 2020
P5.js Instance Mode Template
View sketch.js
const s = (p55) => {
const PHI = (Math.sqrt(5) + 1) / 2; // I use PHI for layout ratios
const sketch_name = "sspboyd"; // put this in the index.html canvas div too!
let canvasW = 400;
let canvasH = 400;
// let copy_font;
p55.preload = () => {
// copy_font = p55.loadFont('assets/fonts/Georgia.ttf');
View TotalExpenditureByAgency-2015.csv
Agency description Year Expenditure
Department of Peacekeeping Operations 2015 8759159000
United Nations 2015 5613139904
United Nations Children’s Fund 2015 5077601656
United Nations Development Programme 2015 5057413898
World Food Programme 2015 4893472393
Office of the United Nations High Commissioner for Refugees 2015 3278871762
World Health Organization 2015 2738660315
International Organization for Migration 2015 1594121668
Pan American Health Organization 2015 1379321927
View Twitter User Object MySQL Schema.sql
CREATE TABLE `user` (
`twitter_id` int(10) unsigned NOT NULL,
`created_at` timestamp NOT NULL default '0000-00-00 00:00:00',
`name` varchar(80) NOT NULL,
`screen_name` varchar(30) NOT NULL,
`location` varchar(120) default NULL,
`description` varchar(640) default NULL,
`profile_image_url` varchar(400) NOT NULL,
`url` varchar(100) default NULL,
View notes_midi_freq.csv
Note Midi Frequency
C1 0 8.1757989156
Db1 1 8.6619572180
D1 2 9.1770239974
Eb1 3 9.7227182413
E1 4 10.3008611535
F1 5 10.9133822323
Gb1 6 11.5623257097
G1 7 12.2498573744
Ab1 8 12.9782717994
@sspboyd
sspboyd / OrderOfMagnitudeRounding.pde
Created Jun 5, 2019
Rounding up and rounding down to the nearest order of base 10 magnitude.
View OrderOfMagnitudeRounding.pde
// Some example code for rounding up and rounding down to the nearest order of base 10 magnitude.
// Thanks to this thread for pointing me in the right direction
// https://stackoverflow.com/questions/7906996/algorithm-to-round-to-the-next-order-of-magnitude-in-r
void setup() {
int i = 1200;
println("i = "+ i);
println("---");
println("log(i): "+log(i));
View gist:426f9dc01ccb943fae058dff41f2ff77
### Keybase proof
I hereby claim:
* I am sspboyd on github.
* I am sspboyd (https://keybase.io/sspboyd) on keybase.
* I have a public key ASBQaniLXuzD1pXx9nXXVo_0EUSJ0H9-8TDSjZLm0GMkigo
To claim this, I am signing this object: