Skip to content

Instantly share code, notes, and snippets.

View jwbowers's full-sized avatar
🎯
Focusing

Jake Bowers jwbowers

🎯
Focusing
View GitHub Profile
@leoniedu
leoniedu / Installing R on dreamhost
Created June 26, 2009 20:23
Installing R on dreamhost
## First do the unix account setup http://wiki.dreamhost.com/Unix_account_setup
cd ${HOME}
# create the first level directories (and log/setup)
mkdir -pv soft run www log log/setup backup data
# create the second level directories within run (our own FHS)
for subdir in bin etc include lib man share
do
mkdir -pv run/${subdir}
done
# symlink so that man pages stay all in the same place
@mxcl
mxcl / install_homebrew.markdown
Created March 6, 2010 15:14
Installs Homebrew to /usr/local so you don't need sudo to `brew install`
@kyleturner
kyleturner / Remove Submodule
Created January 5, 2012 01:07
How to remove a submodule from a Github project
To remove a submodule you need to:
Delete the relevant line from the .gitmodules file.
Delete the relevant section from .git/config.
Run git rm --cached path_to_submodule (no trailing slash).
Commit and delete the now untracked submodule files.
@pasela
pasela / git-export
Last active October 2, 2015 17:58
git-export - Create an unversioned copy of a tree.
#!/bin/sh
#
# git-export - Create an unversioned copy of a tree.
#
# USAGE
# git export [<tree-ish>] <path>
#
# Author: Yuki <paselan@gmail.com>
# License: MIT License
#
@jwbowers
jwbowers / bowers-nbp-functions.R
Created July 31, 2012 13:41
Helper functions for nbpMatching
## This file contains functions that I've found useful when working
## with the nbpMatching package. Context for the examples can be seen
## in Appendix E in
## http://jakebowers.org/PAPERS/WongRacialContext2012.pdf
## (forthcoming in the Journal of Politics).
## Make matrices of absolute distances
scalar.dist<-function(var){
## Utility function to make n x n abs dist matrices
## Cribbed from older versions of optmatch
@markmfredrickson
markmfredrickson / gist:6157476
Created August 5, 2013 16:52
How to look at submatrices of InfinitySparseMatrix objects
library(optmatch)
example(match_on)
#' @param x An ISM or blocked ISM
#' @param rs Names of rows to keep
#' @param cs Names of columns to keep
submatrix <- function(x, rs, cs) {
subset(x,
x@rownames %in% rs,
@Rich-Harris
Rich-Harris / gh-pages.md
Created August 11, 2013 23:02
Automating gh-pages branch updating with changes to the master branch
@denji
denji / homebrew-rvm.md
Last active February 6, 2024 08:52
Homebrew + RVM > Awesome

The MBP is my development machine, so I needed all of my tools installed with the ability to update them with ease. In the past, I used MacPorts to take care of my MySQL, Memcached, and Ruby installions and it worked just fine. This time around however, I wanted something new and fun. Homebrew.

Homebrew is a new package manager for OS X. Unlike Fink or MacPorts, Homebrew integrates with the core operating system, reducing the number of extra libraries to install etc. Another neat feature is the ability to write software package recipes in Ruby, awesome.

Here are some raw installation instructions (clean system). I like to keep everything under user ownership to make life more enjoyable, say no to sudo.

You will need the latest version of xcode, you can get it here. After the installation is complete, you may continue.

sudo mkdir /usr/local
@jiaxu825
jiaxu825 / pandocHeader
Last active March 14, 2024 20:42
A Pandoc YAML metadata block for compilling Markdown to pretty PDF via latex
---
title:
author:
date:
documentclass:
- scrartcl
header-includes:
- \usepackage{paralist}
- \usepackage{booktabs}
- \usepackage{numprint, xspace, paralist}
@JWiley
JWiley / parallel_boot_lm.cpp
Last active August 4, 2019 19:35
Rcpp Eigen and Parallel based parallel linear model bootstrap
// [[Rcpp::depends(RcppParallel)]]
// [[Rcpp::depends(RcppEigen)]]
#include <Rcpp.h>
#include <RcppEigen.h>
#include <RcppParallel.h>
using namespace std;
using namespace Rcpp;
using namespace RcppParallel;