Skip to content

Instantly share code, notes, and snippets.

View jmxpearson's full-sized avatar

John Pearson jmxpearson

View GitHub Profile
@jmxpearson
jmxpearson / ggplot_grid.R
Created May 5, 2014 19:35
ggplot2 grid plot of regression coefficients
ddir <- '~/data/bartc' # data directory
load(file=paste(ddir, 'fitdata', sep='/'))
extractfun <- function(x) {
outs <- c(x$baseline, x$effects)
names(outs)[1] = 'baseline'
return (outs)
}
dat <- as.data.frame(t(sapply(fitobjs, FUN=extractfun, simplify=TRUE)))
@jmxpearson
jmxpearson / ethojoin.sql
Last active December 28, 2015 17:19
Sample join command to get spike info for Geoff's data
select count(*), var, unit, sum(start - stop)
from (
select movie, montime, mofftime
from (spikes, showings
where spikes.time > ontime and spikes.time < offtime)
join etho on movie )
group by etho.var, unit
@jmxpearson
jmxpearson / Default (OSX).sublime-keymap
Last active December 27, 2015 13:49
My settings for Sublime Text 2
[
{ "keys": ["ctrl+enter"], "command": "repl_transfer_current", "args": {"scope": "lines"}},
{ "keys": ["ctrl+shift+enter"], "command": "repl_transfer_current", "args": {"scope": "selection"}}
]