Skip to content

Instantly share code, notes, and snippets.

View r-wheeler's full-sized avatar

Ryan Wheeler r-wheeler

View GitHub Profile
--{"message": "test",
-- "results": {"k":"value"}
--}
-- Simple Nested JSON Parse with Aeson
{-# LANGUAGE OverloadedStrings #-}
import Control.Applicative ((<$>), (<*>))
import Control.Lens
import Control.Monad (mzero)
@r-wheeler
r-wheeler / colorbrewer.html
Created August 20, 2015 15:45
random js includes
<script src="//cdnjs.cloudflare.com/ajax/libs/d3-tip/0.6.3/d3-tip.min.js"></script>
<script src="//cdn.rawgit.com/mbostock/d3/master/lib/colorbrewer/colorbrewer.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/underscore.js/1.6.0/underscore-min.js"></script>
@r-wheeler
r-wheeler / pt.csv
Created August 14, 2015 14:37
More periodic table
We can make this file beautiful and searchable if this error is corrected: It looks like row 7 should actually have 23 columns, instead of 21 in line 6.
Atomic Number,Element,Symbol,Atomic Weight,Period,Group,Phase,Most Stable Crystal,Type,Ionic Radius,Atomic Radius,Electronegativity,First Ionization Potential,Density,Melting Point (K),Boiling Point (K),Isotopes,Discoverer,Year of Discovery,Specific Heat Capacity,Electron Configuration,Display Row,Display Column
1,Hydrogen,H,1.00794,1,1,gas,,Nonmetal,0.012,0.79,2.2,13.5984,0.00008988,14.175,20.28,3,Cavendish,1766,14.304,1s1,1,1
2,Helium,He,4.002602,1,18,gas,,Noble Gas,,0.49,,24.5874,0.0001785,,4.22,5,Janssen,1868,5.193,1s2,1,18
3,Lithium,Li,6.941,2,1,solid,bcc,Alkali Metal,0.76,2.1,0.98,5.3917,0.534,453.85,1615,5,Arfvedson,1817,3.582,[He] 2s1,2,1
4,Beryllium,Be,9.012182,2,2,solid,hex,Alkaline Earth Metal,0.35,1.4,1.57,9.3227,1.85,1560.15,2742,6,Vaulquelin,1798,1.825,[He] 2s2,2,2
5,Boron,B,10.811,2,13,solid,rho,Metalloid,0.23,1.2,2.04,8.298,2.34,2573.15,4200,6,Gay-Lussac,1808,1.026,[He] 2s2 2p1,2,13
6,Carbon,C,12.0107,2,14,solid,hex,Nonmetal,,0.91,2.55,11.2603,2.267,3948.15,4300,7,Prehistoric,,0.709,[He] 2s2 2
@r-wheeler
r-wheeler / periodicTable.csv
Created August 13, 2015 19:49
Periodic Table data
Name Symbol Atomic_Number Atomic_Weight Density Melting_Point Boiling_Point Atomic_Radius Covalent_Radius Ionic_Radius Specific_Volume Specific_Heat Heat_Fusion Heat_Evaporation Thermal_Conductivity Pauling_Electronegativity First_Ionisation_Energy Oxidation_States Electronic_Configuration Lattice Lattice_Constant
Hydrogen H 1 1.00794 0.0708 (@ -253degC) 14.01 20.28 79 32 14.1 14.267 (H-H) 0.117 (H-H) 0.904 (H-H) 0.1815 2.2 1311.3 1 -1 1s¹ HEX 3.75
Helium He 2 4.002602 0.147 (@ -270degC) 0.95 4.216 0 - 31.8 5.188 - 0.08 0.152 - 2361.3 - 1s² HEX 3.57
Lithium Li 3 6.941 0.534 553.69 1118.15 155 163 13.1 3.489 2.89 148 84.8 0.98 519.9 1 [He]2s¹ BCC 3.49
Beryllium Be 4 9.01218 1.848 1551 3243 112 90 5 1.824 12.21 309 201 1.57 898.8 2 [He]2s² HEX 2.29
Boron B 5 10.811 2.34 2573 3931 98 82 4.6 1.025 23.6 504.5 27.4 2.04 800.2 3 [He]2s²2p¹ TET 8.73
Carbon C 6 12.011 2.25 (graphite) 3820 5100 91 77 5.3 0.711 - - 1.59 2.55 1085.7 4 2 -4 [He]2s²2p² DIA 3.57
@r-wheeler
r-wheeler / iris.csv
Created August 13, 2015 00:56
iris
sepal length sepal width petal length petal width species
5.1 3.5 1.4 0.2 Iris-setosa
4.9 3.0 1.4 0.2 Iris-setosa
4.7 3.2 1.3 0.2 Iris-setosa
4.6 3.1 1.5 0.2 Iris-setosa
5.0 3.6 1.4 0.2 Iris-setosa
5.4 3.9 1.7 0.4 Iris-setosa
4.6 3.4 1.4 0.3 Iris-setosa
5.0 3.4 1.5 0.2 Iris-setosa
4.4 2.9 1.4 0.2 Iris-setosa
@r-wheeler
r-wheeler / bubbles.js
Created August 12, 2015 01:17
D3 Bubbles!
w = 960,
h = 500;
var svg = d3.select("body").append("svg:svg")
.attr("width", w)
.attr("height", h);
var circle = svg.selectAll("circle")
.data(d3.range(70).map(function(datum,interval) {
return {
@r-wheeler
r-wheeler / lineAndtable.html
Created August 7, 2015 17:57
D3 Line chart + HTML Table
<!DOCTYPE html>
<meta charset="utf-8">
<style> /* set the CSS */
body { font: 12px Arial;}
path {
stroke: steelblue;
stroke-width: 2;
fill: none;
/* --------------------------------------------------------------
typography.css
* Sets up some sensible default typography.
-------------------------------------------------------------- */
/* Default font settings.
The font-size percentage is of 16px. (0.75 * 16px = 12px) */
html { font-size:100.01%; }
import luigi
import time
class TimeTaskMixin(object):
'''
A mixin that when added to a luigi task, will print out
the tasks execution time to standard out, when the task is
finished
'''
@luigi.Task.event_handler(luigi.Event.PROCESSING_TIME)
import luigi
import luigi.scheduler
import luigi.worker
import logging as log
import socket
from datetime import datetime as dt
from ConfigParser import ConfigParser
from components import AssessSVMRegression
from components import CreateProteinList
from components import CreateReport