Skip to content

Instantly share code, notes, and snippets.

### Keybase proof
I hereby claim:
* I am datafunk on github.
* I am datafunk (https://keybase.io/datafunk) on keybase.
* I have a public key ASBBox8ozBwZ9XI17C37L4FCgtyS4D53_3NdqQX15uS-7go
To claim this, I am signing this object:
@datafunk
datafunk / vagrantfile
Created April 14, 2016 00:12
Vagrant Ubuntu Trausty 64
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure(2) do |config|
config.vm.box = "ubuntu/trusty64"
config.vm.provider "virtualbox" do |vb|
# # Display the VirtualBox GUI when booting the machine
vb.gui = true
# # Customize the amount of memory on the VM:
vb.memory = "1024"
@datafunk
datafunk / vagrantfile
Created April 14, 2016 00:09
Vagrant W10 Edge config
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure(2) do |config|
config.vm.box = "MSEdge/Win10TH2"
config.vm.provider "virtualbox" do |vb|
# Display the VirtualBox GUI when booting the machine
vb.gui = true
@datafunk
datafunk / vagrantfile
Created April 13, 2016 23:27
Vagrant ModernIE W7 IE11 config
# -*- mode: ruby -*-
# vi: set ft=ruby :
# box name into env var, same script can be used with different boxes. Defaults to win7-ie11.
box_name = box_name = ENV['box_name'] != nil ? ENV['box_name'].strip : 'win7-ie11'
# box repo into env var, so private repos/cache can be used. Defaults to http://aka.ms
box_repo = ENV['box_repo'] != nil ? ENV['box_repo'].strip : 'http://aka.ms'
Vagrant.configure("2") do |config|
# If the box is win7-ie11, the convention for the box name is modern.ie/win7-ie11
@datafunk
datafunk / Global-ocean-land-temperatures.csv
Last active May 30, 2017 04:45
#KnightD3 - a linechart
year Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec
1880 -0.3 -0.21 -0.19 -0.28 -0.15 -0.29 -0.24 -0.08 -0.17 -0.17 -0.19 -0.21
1881 -0.09 -0.14 0.01 -0.03 -0.05 -0.29 -0.06 -0.02 -0.09 -0.2 -0.26 -0.15
1882 0.09 0.08 0.01 -0.2 -0.18 -0.25 -0.1 0.03 -0.01 -0.23 -0.21 -0.25
1883 -0.33 -0.42 -0.18 -0.24 -0.26 -0.12 -0.09 -0.13 -0.19 -0.12 -0.21 -0.18
1884 -0.18 -0.12 -0.35 -0.36 -0.33 -0.39 -0.34 -0.26 -0.24 -0.23 -0.31 -0.3
1885 -0.65 -0.3 -0.24 -0.45 -0.42 -0.51 -0.29 -0.28 -0.2 -0.2 -0.23 -0.06
1886 -0.42 -0.46 -0.42 -0.3 -0.28 -0.4 -0.17 -0.33 -0.2 -0.26 -0.27 -0.26
1887 -0.66 -0.48 -0.32 -0.38 -0.34 -0.21 -0.19 -0.28 -0.21 -0.33 -0.27 -0.38
1888 -0.43 -0.42 -0.48 -0.28 -0.22 -0.21 -0.09 -0.11 -0.08 0.01 -0.01 -0.12
Year low hi
1880 -0.3 -0.08
1890 -0.49 -0.24
1900 -0.39 0.09
1910 -0.69 -0.32
1920 -0.46 -0.06
1930 -0.28 0.14
1940 -0.13 0.2
1950 -0.34 -0.08
1960 -0.36 0.18
@datafunk
datafunk / Land-Ocean-TempIndex-YR.csv
Last active September 9, 2015 08:34
Vertical bar chart with negative values
Year Celsius
1880 -0.185
1881 -0.08
1882 -0.13
1883 -0.175
1884 -0.29
1885 -0.275
1886 -0.275
1887 -0.315
1888 -0.155
Year Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec
1880 -0.3 -0.21 -0.19 -0.28 -0.15 -0.29 -0.24 -0.08 -0.17 -0.17 -0.19 -0.21
1881 -0.09 -0.14 0.01 -0.03 -0.05 -0.29 -0.06 -0.02 -0.09 -0.2 -0.26 -0.15
1882 0.09 0.08 0.01 -0.2 -0.18 -0.25 -0.1 0.03 -0.01 -0.23 -0.21 -0.25
1883 -0.33 -0.42 -0.18 -0.24 -0.26 -0.12 -0.09 -0.13 -0.19 -0.12 -0.21 -0.18
1884 -0.18 -0.12 -0.35 -0.36 -0.33 -0.39 -0.34 -0.26 -0.24 -0.23 -0.31 -0.3
1885 -0.65 -0.3 -0.24 -0.45 -0.42 -0.51 -0.29 -0.28 -0.2 -0.2 -0.23 -0.06
1886 -0.42 -0.46 -0.42 -0.3 -0.28 -0.4 -0.17 -0.33 -0.2 -0.26 -0.27 -0.26
1887 -0.66 -0.48 -0.32 -0.38 -0.34 -0.21 -0.19 -0.28 -0.21 -0.33 -0.27 -0.38
1888 -0.43 -0.42 -0.48 -0.28 -0.22 -0.21 -0.09 -0.11 -0.08 0.01 -0.01 -0.12
@datafunk
datafunk / gist:c0a469762394a96b5a90
Last active August 29, 2015 14:12
Custom format input type "file" and display the selected file. Problem asked on HTML5 mailing list, example makes use of SO thread as quoted in the code below.
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>test</title>
<style type="text/css">
label.myLabel input[type="file"] {
position: fixed;
top: -1000px;
@datafunk
datafunk / inRange.loop.js
Created October 31, 2014 02:36
Check which bucket each individual array member belongs to
/*!
Check which bucket each individual values member belongs to
*/
var values = [22, -55.2, -18, -5, 0, 0.23, 5.1, 12, 450];
// classes is to verify my bucketing is correct
var classes = [];
// range values must fit inside
var buckets = [-10, 0, 0.2, 0.5, 10, 20];
var l = buckets.length;