Skip to content

Instantly share code, notes, and snippets.

View jeffreyhanson's full-sized avatar

Jeff Hanson jeffreyhanson

View GitHub Profile
@knausb
knausb / .gitignore
Last active March 19, 2019 15:27
rocker_asan
.Rproj.user
.Rhistory
.RData
.Ruserdata
*.html
@rmkane
rmkane / GAME_MASTER_v0_1.json
Created July 17, 2016 04:25
Pokemon GO Game Data
{
"Items": [ {
"TemplateId": "BADGE_BATTLE_ATTACK_WON",
"Badge": {
"BadgeType": "BADGE_BATTLE_ATTACK_WON",
"BadgeRanks": 4,
"Targets": "\\nd\\350\\007"
}
}, {
"TemplateId": "BADGE_BATTLE_TRAINING_WON",
anonymous
anonymous / GAME_MASTER_v0_1.protobuf
Created July 16, 2016 16:31
Pokemon Go decoded GAME_MASTER protobuf file v0.1
Result: 1
Items {
TemplateId: "BADGE_BATTLE_ATTACK_WON"
Badge {
BadgeType: BADGE_BATTLE_ATTACK_WON
BadgeRanks: 4
Targets: "\nd\350\007"
}
}
Items {
library(raster)
library(RandomFields)
library(R2OpenBUGS)
library(coda)
library(R2jags)
library(mvtnorm)
# Compare JAGS manual method to spatial.exp in BUGS
# simulate data
@tomhopper
tomhopper / ggplot2_axis_ranges.R
Last active October 2, 2020 10:36
Get the actual x- and y-axis ranges from a ggplot object. Works on ggplot2 >= 0.8.9 (tested on 0.9.3.1). Code from http://stackoverflow.com/questions/7705345/how-can-i-extract-plot-axes-ranges-for-a-ggplot2-object
library(ggplot2)
#' create a data frame with test data.
my.df <- data.frame(index = 1:10, value = rnorm(10))
#' create the ggplot object
my.ggp <- ggplot(data = my.df, aes(x = index, y = value)) + geom_point() + geom_line()
#' get the x- and y-axis ranges actually used in the graph
# This worked in early versions of ggplot2 (probably <2.2)
@xiaodaigh
xiaodaigh / server.r
Last active February 2, 2016 18:07
R Shiny: An textInput that only gets invalidated upon losing focus or when enter is pressed shiny::runGist("7150112")
library(shiny)
shinyServer(function(input, output, session) {
# Partial example
output$meh <- renderPrint({
print("Press enter or focusout to update --- ")
print(input$myTextInput )