Skip to content

Instantly share code, notes, and snippets.

@seankross
seankross / index.html
Last active August 29, 2015 13:57
titanic
<!DOCTYPE html>
<meta charset="utf-8">
<style>
@import url(https://raw.github.com/jasondavies/d3-parsets/master/d3.parsets.css);
body {
font-family: sans-serif;
font-size: 16px;
width: 960px;
margin: 1em auto;
# mtcars as as service
# Create a JSON API for your data with GitHub + Blockspring
# This script will filter rows of mtcars based on API parameters
# import relevant libraries
suppressMessages(library(dplyr))
suppressMessages(library(RJSONIO))
# Get data from GitHub
# You will need to get your own API key by creating an account at api.blockspring.com
# install.packages(c("httr", "RJSONIO"))
library(httr)
library(RJSONIO)
mtcars_aaS <- function(api_key, mpg_min = "0", mpg_max = "10e6",
cyl_min = "0", cyl_max = "10e6",
disp_min = "0", disp_max = "10e6",
hp_min = "0", hp_max = "10e6",
library(dplyr)
create_tbl_df <- function(...){
tbl_df(as.data.frame(matrix(...)))
}
results <- create_tbl_df(nrow=5, ncol=2)

https://gist.github.com/kirstenfrank/218c36a1938055d0f4e4sample codebook.

It's very similar to a Statistical Analysis Plan, actually.

Setup, there is a dogwalking business. It wants to analyze its work.

Raw data is: name of dog, address of owner, time walked, date walked, size of dog (small, medium, or large), health of dog (well or sick) on that date and time, comments, and pay.

The business wants to assign ID# to the dogs, and codewords to the address to make this data anonymous. There isn't anything to do to the comments--since free text is all over the place.

@seankross
seankross / ssh.md
Last active August 29, 2015 14:10
SSH

However this is done in PuTTY 😕 :

ssh schliepe@opensub00.umiacs.umd.edu

Type in your password, then when you're in try:

cd /nfshomes/kross/fletching
@seankross
seankross / keybase.md
Last active August 29, 2015 14:16
keybase

Keybase proof

I hereby claim:

  • I am seankross on github.
  • I am seankross (https://keybase.io/seankross) on keybase.
  • I have a public key whose fingerprint is 920D 6BAA 1092 52E6 9977 1CE8 B5CD 7B45 761C C977

To claim this, I am signing this object:

@seankross
seankross / R Plot Differences
Created December 2, 2012 00:46
Plots difference between two stocks
setwd('~/Desktop/R/Inputs')
getYahooCsv <- function(startDate, endDate, ticker){
  string <- paste("http://ichart.finance.yahoo.com/table.csv?s=",ticker,
                  "&a=",startDate[1]-1,"&b=",startDate[2],"&c=",startDate[3],
                  "&d=",endDate[1]-1,"&e=",endDate[2],"&f=",endDate[3],"&g=d&ignore=.csv",
                  sep="")
  
  return (read.csv(string))
}