Skip to content

Instantly share code, notes, and snippets.

@davidbradway
davidbradway / .block
Last active August 11, 2016 18:29 — forked from armollica/.block
HTML Annotation
height: 960
@davidbradway
davidbradway / README.md
Created August 11, 2016 18:42 — forked from jasondavies/README.md
World Map

Based on Mike Bostock’s [World Map][0], modified to automatically colour countries such that no adjacent countries share the same colour.

This is done by extracting the topology via [TopoJSON][1] and greedily picking colours until the constraint is fulfilled.

See also: [Graph coloring][2] on Wikipedia.

Update: Greedily colouring is now performed in a single line, thanks to Mike Bostock!

@davidbradway
davidbradway / countries.json
Last active August 15, 2016 15:16
learning topojson
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
#
ssh-keygen -t rsa -C "dpb6@duke.edu"
eval "$(ssh-agent -s)"
ssh-add ~/.ssh/id_rsa
git config --global user.email "dpb6@duke.edu"
git config --global user.name "David Bradway"
@davidbradway
davidbradway / BN59-01041A.cfg
Created February 24, 2017 14:26
LIRC Config, brand: Samgung, model no. of remote control: BN59-01041A, devices being controlled by this remote: LN46D630
# Please make this file available to others
# by sending it to <winlirc.configs@gmail.com>
#
# this config file was automatically generated
# using lirc-0.9.0(MCE) on Fri Feb 24 09:12:40 2017
#
# contributed by David Bradway
#
# brand: Samgung
+-------------------------+
| [POWER] [LIGHT] | KEY_POWER SOURCE
| SOURCE |
| [ 1 ] [ 2 ] [ 3 ] | KEY_1 KEY_2 KEY_3
| |
| [ 4 ] [ 5 ] [ 6 ] | KEY_4 KEY_5 KEY_6
| |
| [ 7 ] [ 8 ] [ 9 ] | KEY_7 KEY_8 KEY_9
| |
| [ - ] [ 0 ] PRE-CH | KEY_TEXT KEY_0 KEY_PREVIOUS
@davidbradway
davidbradway / durham-dockless.m
Created November 29, 2017 19:33
Cost Analysis of Bike Shares in Durham (MATLAB)
%% Cost Analysis of Bike Shares in Durham
rpm = 1:105; % rides per month
L1 = rpm;
L2 = 14 * ceil(rpm/100);
S1 = 5 * ceil(rpm/6);
S2 = 29 + 0*rpm;
figure(1), clf
subplot(2,1,1)
@davidbradway
davidbradway / setup.md
Last active May 19, 2020 22:00
Set Up Docker On Raspberry Pi Raspbian Stretch Lite

Keybase proof

I hereby claim:

  • I am davidbradway on github.
  • I am davidbradway (https://keybase.io/davidbradway) on keybase.
  • I have a public key ASCuLH-bl5srBYIsIOqlOXoYzkpaS76RN23NC061r8S7mwo

To claim this, I am signing this object:

@davidbradway
davidbradway / get-singularity.sh
Created December 19, 2017 22:09
install and set up singularity on an Ubuntu machine (needs root access)
sudo apt-get update
sudo apt-get install -y python dh-autoreconf build-essential
sudo apt-get install -y automake autoconf libtool
git clone https://github.com/singularityware/singularity.git
cd singularity
./autogen.sh
./configure --prefix=/usr/local
make
sudo make install
singularity run shub://vsoch/singularity-images