Skip to content

Instantly share code, notes, and snippets.

Lincoln Mullen lmullen

Block or report user

Report or block lmullen

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
lmullen / shapefile.r
Last active May 11, 2020
How I use shapefiles in R with ggplot2 and RGDAL
View shapefile.r
library(rgdal) # R wrapper around GDAL/OGR
library(ggplot2) # for general plotting
library(ggmaps) # for fortifying shapefiles
# First read in the shapefile, using the path to the shapefile and the shapefile name minus the
# extension as arguments
shapefile <- readOGR("path/to/shapefile/", "name_of_shapefile")
# Next the shapefile has to be converted to a dataframe for use in ggplot2
shapefile_df <- fortify(shapefile)
lmullen / Makefile
Last active May 1, 2020
PDF slides and handouts using Pandoc and Beamer
View Makefile
SLIDES := $(patsubst,,$(wildcard *.md))
HANDOUTS := $(patsubst,,$(wildcard *.md))
all : $(SLIDES) $(HANDOUTS) :
pandoc $^ -t beamer --slide-level 2 -o $@ :
pandoc $^ -t beamer --slide-level 2 -V handout -o $@
lmullen / .slate
Created Feb 8, 2013
My configuration file for the Slate window manager
View .slate
# -------------------------------------------------------------------
# See
config defaultToCurrentScreen true
config secondsBeforeRepeat 0.4
config secondsBetweenRepeat 0.1
config keyboardLayout "qwerty"
config nudgePercentOf screenSize
config resizePercentOf screenSize
lmullen / gist:3767386
Created Sep 22, 2012
Make all markdown files in directory into PDFs
View gist:3767386
# Produce PDFs from all Markdown files in a directory
# Lincoln Mullen | |
# List files to be made by finding all *.md files and appending .pdf
PDFS := $(patsubst,,$(wildcard *.md))
# The all rule makes all the PDF files listed
all : $(PDFS)
# This generic rule accepts PDF targets with corresponding Markdown
lmullen /
Last active Aug 25, 2019
Distance matrix in R

An example of using a matrix to find which cities are closest to one another. The file distances-from-google.r downloads some sample data from Google's Distance Matrix API and converts it from a JSON object to an R matrix. The file distance-matrix.r creates a function to find the closest city in each row of a distance matrix.


  • New York is closest to Philadelphia
  • Los Angeles is closest to Houston
lmullen / analysis.r
Last active Dec 7, 2018
Charting Faculty Salaries
View analysis.r
# options(stringsAsFactors = FALSE)
options("scipen"=100, "digits"=4)
salaries <- read.csv("faculty-salaries-2013-14.csv")
lmullen / Makefile
Created Sep 3, 2014
Very minimal HTML for JavaScript
View Makefile
serve :
ruby -run -e httpd . -p 4000
lmullen / convert-file-encoding-line-breaks.zsh
Created Mar 12, 2014
Convert text files in cp1252 with dos line endings to files in UTF-8 with Unix line endings
View convert-file-encoding-line-breaks.zsh
# Convert text files in cp1252 with dos line endings to files in UTF-8 with
# Unix line endings
for file (*.txt) {iconv -f cp1252 -t utf-8 $file -o $file}
dos2unix *.txt
lmullen / post-commit
Created Jul 27, 2013
A script to log commits from a Git hook
View post-commit
#!/usr/bin/env ruby
# Write git commit messages to a log file
# Lincoln A. Mullen | |
# MIT License <>
# You will have to install the git gem for this to work:
# gem install git
lmullen /
Created Sep 1, 2014
Getting the Ace editor to work with gitit

The file goes in the templates/ directory in the Gitit wiki home directory. You'll put the Ace JavaScript and CSS files in static/.

You can’t perform that action at this time.