Skip to content

Instantly share code, notes, and snippets.

View jkaupp's full-sized avatar

Jake Kaupp jkaupp

View GitHub Profile
@jkaupp
jkaupp / gist:0b8a58e790b602d92833
Created February 9, 2015 14:53
#IVMOOC Assignment 3 Code
library(plyr)
library(gdata)
library(ggmap)
library(ggplot2)
setwd("/Users/Jake/Documents/MOOCs/IVMOOC")
data <- read.csv("NSF Master LandL.csv")
data.state <-ddply(data, .(state, Latitude, Longitude), summarize, expected_total_amount=sum(expected_total_amount))
# See also the entry on stackoverflow: http://goo.gl/KUvmW2
library(lattice)
library(chron)
source("http://blog.revolutionanalytics.com/downloads/calendarHeat.R")
# Plot as calendar heatmap
calendarHeat(stock.data$Date, stock.data$Adj.Close,
varname="MSFT Adjusted Close")
stock <- "MSFT"
start.date <- "2012-01-01"
end.date <- Sys.Date()
quote <- paste("http://ichart.finance.yahoo.com/table.csv?s=",
stock,
"&a=", substr(start.date,6,7),
"&b=", substr(start.date, 9, 10),
"&c=", substr(start.date, 1,4),
"&d=", substr(end.date,6,7),
"&e=", substr(end.date, 9, 10),
@jkaupp
jkaupp / README.md
Created April 14, 2015 17:26
Curriculum Dendrogram
@jkaupp
jkaupp / mode.R
Created December 3, 2015 17:23
R function to calculate the mode of a dataset.
Mode <- function(x) {
ux <- unique(x)
ux[which.max(tabulate(match(x, ux)))]
}
library(proto)
stat_smooth_func <- function (mapping = NULL, data = NULL, geom = "smooth", position = "identity",
method = "auto", formula = y ~ x, se = TRUE, n = 80, fullrange = FALSE,
level = 0.95, na.rm = FALSE, ...) {
StatSmoothFunc$new(mapping = mapping, data = data, geom = geom, position = position,
method = method, formula = formula, se = se, n = n, fullrange = fullrange,
level = level, na.rm = na.rm, ...)
}
@jkaupp
jkaupp / passwd_prototype.R
Created January 19, 2016 01:53 — forked from ojessen/passwd_prototype.R
Protoype password handling with hash
require(digest)
require(shiny)
ui <- basicPage(
uiOutput("register"),
actionButton("doRegister",label="Register"),
verbatimTextOutput("resultRegister"),
uiOutput("login"),
@jkaupp
jkaupp / LOPUS.R
Created April 18, 2017 16:55
LOPUS Script
# The following code was written by Jake Kaupp at Queen's University, Kingston, Canada
# for looking at LOPUS observation data
# Date: February 2017
library(jsonlite)
library(plyr)
library(tidyverse)
library(lubridate)
# Data file is located in the same direoctory as this script
@jkaupp
jkaupp / pandoc.css
Created June 19, 2017 16:58 — forked from killercup/pandoc.css
Add this to your Pandoc HTML documents using `--css pandoc.css` to make them look more awesome. (Tested with Markdown and LaTeX.)
/*
* I add this to html files generated with pandoc.
*/
html {
font-size: 100%;
overflow-y: scroll;
-webkit-text-size-adjust: 100%;
-ms-text-size-adjust: 100%;
}
@jkaupp
jkaupp / git-deployment.md
Created July 10, 2017 16:01 — forked from noelboss/git-deployment.md
Simple automated GIT Deployment using Hooks

Simple automated GIT Deployment using GIT Hooks

Here are the simple steps needed to create a deployment from your lokal GIT repository to a server based on this in-depth tutorial.

How it works

You are developing in a working-copy on your local machine, lets say on the master branch. Most of the time, people would push code to a remote server like github.com or gitlab.com and pull or export it to a production server. Or you use a service like my Deepl.io to act upon a Web-Hook that's triggered that service.