Skip to content

Instantly share code, notes, and snippets.

Matti Vuorre mvuorre

View GitHub Profile
@mvuorre
mvuorre / git-clearHistory
Last active Jun 1, 2019 — forked from stephenhardy/git-clearHistory
Steps to clear out the history of a git/github repository
View git-clearHistory
-- Delete .git folder from disk
rm -rf .git
-- recreate the repo from the current content only (note old .gitignore is preserved)
git init
git add .
git commit -m "Initial commit"
-- push to the github remote repo ensuring you overwrite history
git remote add origin https://github.com/<username>/<reponame>.git
View theme_spss.R
library(ggplot2)
theme_spss <- function(base_family = "Helvetica") {
theme(text = element_text(family = base_family, face = "bold"),
axis.ticks = element_line(colour = "black", size = 1),
panel.background = element_rect(colour = "black",
fill = "gray90", size = 1.5),
panel.grid = element_blank(),
aspect.ratio = 1)
}
@mvuorre
mvuorre / multilevel_logistic_stan
Last active Aug 29, 2015
Multilevel logistic regression in STAN
View multilevel_logistic_stan
// random effects covariances from
// https://github.com/vasishth/StanJAGSexamples/blob/master/FrankEtAlCogSci2015/FTVCogSciProficiency.Stan
data {
int<lower=1> N; // Number of observations
int<lower=1> J; // Number of subjects
int<lower=1> K; // Number of predictors
int<lower=1,upper=J> id[N]; // Subject ids
real xInt[N]; // ISI vector
real<lower=-0.5,upper=0.5> xCond[N]; // Condition vector
View github_project_slidify
A practical guide to hosting slidify slides on github as part of a project.
1. Create a project repository and clone it to your computer ('awesome_project/')
2. Create a gh-pages branch
3. R:
setwd('awesome_project/')
author('project_slideshow', use_git=F)
6. Create slideshow with R-Markdown, then slidify('index.Rmd')
7. Push content into the project's gh-pages
8. <username.github.io/awesome_project/project_slideshow/index.html>
You can’t perform that action at this time.