Skip to content

Instantly share code, notes, and snippets.

View mja's full-sized avatar
💭
🙊

Mark James Adams mja

💭
🙊
View GitHub Profile
@mja
mja / homebrew_scipy.sh
Created December 13, 2010 08:09
Install numpy, scipy, and matplotlib on OS X 10.6
homebrew install gfortran
homebrew install python
homebrew install distribute
homebrew install pip
pip install ipython
pip install numpy
pip install scipy
pip install -f http://downloads.sourceforge.net/project/matplotlib/matplotlib/matplotlib-1.0/matplotlib-1.0.0.tar.gz matplotlib
@mja
mja / .gitconfig-changes-difftool
Created December 16, 2010 18:40
Using Changes.app as the difftool for git
[diff]
tool = chdiff
[difftool]
prompt = false
[difftool "chdiff"]
cmd = /usr/bin/env chdiff "$LOCAL" "$REMOTE"
>Error # 2072
>There was an unanticipated problem with the license for this product.
>This command not executed.
>Specific symptom number: 4
End of job: 7 command lines 1 errors 0 warnings 0 CPU seconds
@mja
mja / install-rdbi.R
Created June 18, 2011 17:28
Install RdbiPgSQL with Homebrew PostgreSQL
source("http://bioconductor.org/biocLite.R")
biocLite("Rdbi")
@mja
mja / VCV-array.R
Created August 25, 2011 12:57
Example from 5.1 of the MCMCglmm course notes
nitt <- dim(m5a.2$VCV)[1] # number of iterations
VCV <- array(as.vector(m5a.2$VCV), dim=c(nitt, 2, 2, 2),
dimnames=list(itt=1:nitt, trait=c('y.hol', 'y.car'), trait=c('y.hol', 'y.car'), random=c('id', 'units')))
@mja
mja / ubercousin.R
Created October 1, 2011 17:49
Solution to the Messy Matters ubercousin Bonus Puzzle
# Solution to the Messy Matters ubercousin Bonus Puzzle
# http://messymatters.com/2011/09/30/smallworld/
library(pedantics)
fixPedigree( # automatically create entries for the granddams/grandsires
as.data.frame(matrix(
# id dam sire
@mja
mja / .conkyrc
Last active September 29, 2015 23:48
Conky configuration
# Conky, a system monitor, based on torsmo
#
# conky configuration
# edited by darcon@gmail.com
# set to yes if you want Conky to be forked in the background
background no
# X font when Xft is disabled, you can pick one with program xfontsel
#font 5x7
@mja
mja / Stanhome.bash_profile
Created September 10, 2012 13:23
Command line script for compiling .stan files
STAN_HOME=$HOME/Applications/stan
export STAN_HOME
@mja
mja / openmc.R
Created November 2, 2012 11:56
Running OpenMx with multicore
require(OpenMx)
library(parallel)
data(demoOneFactor)
manifests <- names(demoOneFactor)
latents <- c("G")
factorModel <- mxModel(name="One Factor",
type="RAM",
manifestVars = manifests,
@mja
mja / typeI.R
Last active December 11, 2015 12:08 — forked from johnmyleswhite/gist:4596783
library("ggplot2")
library(plyr)
n.sims <- 100
max.n.vars <- 100
n.obs <- 100
res <- data.frame()
for (sim in 1:n.sims)