Skip to content

Instantly share code, notes, and snippets.

View mcnuttandrew's full-sized avatar
🤷‍♂️
🤷‍♂️🤷‍♂️🤷‍♂️🤷‍♂️🤷‍♂️🤷‍♂️🤷‍♂️🤷‍♂️🤷‍♂️🤷‍♂️🤷‍♂️🤷‍♂️🤷‍♂️🤷‍♂️🤷‍♂️🤷‍♂️🤷‍♂️🤷‍♂️

Andrew McNutt mcnuttandrew

🤷‍♂️
🤷‍♂️🤷‍♂️🤷‍♂️🤷‍♂️🤷‍♂️🤷‍♂️🤷‍♂️🤷‍♂️🤷‍♂️🤷‍♂️🤷‍♂️🤷‍♂️🤷‍♂️🤷‍♂️🤷‍♂️🤷‍♂️🤷‍♂️🤷‍♂️
View GitHub Profile
@mcnuttandrew
mcnuttandrew / spec.json
Created February 12, 2024 20:58
Vega-lite Arrow Direction
{
"$schema": "https://vega.github.io/schema/vega-lite/v5.json",
"config": {"view": {"stroke": ""}},
"width": 800,
"height": 200,
"data": {
"values": [
{"direction": "right", "col": 3},
{"direction": "right", "col": 2},
{"direction": "right", "col": 1},
@mcnuttandrew
mcnuttandrew / example.js
Created December 18, 2019 23:53
Modify all json files in a folder
const {executeCommandLineCmd, getFile, writeFile} = require('hoopoe');
// imagine you have a number of json files in a folder called showcase/data/
executeCommandLineCmd('ls -a showcase/data').then(({stdout}) => {
// Build a list of desired file names
const fileNames = stdout.split('\n').filter(name => name.includes('.json'));
// Execute your actions over each of them
fileNames.forEach(fileName => {
// get the file
getFile(`./showcase/data/${fileName}`)
@mcnuttandrew
mcnuttandrew / .block
Last active June 28, 2019 20:45
Vega-Lite - Categorical Bar Chart By Colum
license: bsd-3-clause
{
"$schema": "https://vega.github.io/schema/vega-lite/v4.json",
"description": "A bar chart showing the US population distribution of age groups in 2000.",
"height": {"step": 17},
"data": { "url": "data/population.json"},
"transform": [{"filter": "datum.year == 2000"}],
"mark": "bar",
"encoding": {
"y": {"field": "age"},
"x": {
@mcnuttandrew
mcnuttandrew / .block
Last active September 22, 2018 16:11
Non-Contiguous Cartogram
license: gpl-3.0
@mcnuttandrew
mcnuttandrew / .block
Created September 22, 2018 15:42
Non-Contiguous Cartogram
license: gpl-3.0
@mcnuttandrew
mcnuttandrew / world-lang.json
Created April 20, 2018 21:10
World Languages Data, the countries that speak (officially or unoffically as dominant language) the 17 most populous world langs. Source wikipedia.
{
"English": ["Antigua and Barbuda", "Bahamas", "Barbados", "Belize", "Botswana", "Burundi", "Cameroon", "Canada", "Cook Islands", "Dominica", "Federated States of Micronesia", "Fiji", "Gambia", "Ghana", "Grenada", "Guyana", "India", "Ireland", "Jamaica", "Kenya", "Kiribati", "Lesotho", "Liberia", "Malawi", "Malta", "Marshall Islands", "Mauritius", "Namibia", "Nauru", "Nigeria", "Niue", "Pakistan", "Palau", "Papua New Guinea", "Philippines", "Rwanda", "Saint Kitts and Nevis", "Saint Lucia", "Saint Vincent and the Grenadines", "Samoa", "Seychelles", "Sierra Leone", "Singapore", "Solomon Islands", "South Africa", "South Sudan", "Sudan", "Swaziland", "Tanzania", "Tonga", "Trinidad and Tobago", "Tuvalu", "Uganda", "Vanuatu", "Zambia", "Zimbabwe", "Australia", "New Zealand", "United Kingdom", "United States", "Bahrain", "Bangladesh", "Brunei", "Cyprus", "Eritrea", "Ethiopia", "Israel", "Jordan", "Kuwait", "Malaysia", "Maldives", "Myanmar", "Qatar", "Sri Lanka", "United Arab Emirates"],
"French": ["Democratic R
@mcnuttandrew
mcnuttandrew / convert.sh
Created March 10, 2018 01:49
Generating tile works of gifs example
# 1. have image magick installed
# 2. save all of the gifs the wikipedia page about bridges (https://en.wikipedia.org/wiki/Moveable_bridge)
# into a folder called sources
# 3. make a folder called targets (mkdir targets)
# 4. profit
for I in Drawbridge lift table curl roll thrust draw subm tilt fold swing transport; do
convert -coalesce sources/120px-MovableBridge_$I.gif targets/120px-MovableBridge_$I.png
montage -tile 30x1 -geometry +0+0 targets/120px-MovableBridge_$I-*.png compiled/compiled-$I.png
done
@mcnuttandrew
mcnuttandrew / 1 Teacup
Last active July 16, 2018 22:17
Project Teacup
In 2014 I made a small rails application called Project-Teacup to demonstrate that I knew what I was doing with rails
(spoiler: I did not) as part of applying for employment. That application attempted to be a twitter for dreams
(https://github.com/mcnuttandrew/Project-Teacup) which was based on an idea I had, naturally, while dreaming.
The project was quite successful in that it got me a job, but also in that it inspired a number of people to record
their dreams.
Project-Teacup has been down for a number of years, yet the data lives on. Heroku, where the project was hosted,
has been going through some ~stuff~ so I figured it would be good to extract the data and expose it publically
for general consumption. The database was seeded with several hundred dreams from a (single) friends dream
journal which was hacked apart by hand, and then inserted into the database under the guise of variety of random
@mcnuttandrew
mcnuttandrew / british-motor-colors.js
Created May 22, 2017 22:46
British Motor Corp Colors
export default const bmcColors = {
bmcStone: '#625c4e',
bmcMineralBlue: '#172d47',
bmcRivieraBlue: '#20476e',
bmcFarinaGrey: '#a19f93',
bmcColoradoRed: '#a61618',
bmcSandyBiege: '#897968',
bmcIrisBlue: '#6c8aa4',
bmcMidnightBlue: '#090d13',
bmcGrampianGrey: '#454641',