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
lmullen / Makefile
Last active Sep 16, 2019
PDF slides and handouts using Pandoc and Beamer
View Makefile
SLIDES := $(patsubst %.md,%.md.slides.pdf,$(wildcard *.md))
HANDOUTS := $(patsubst %.md,%.md.handout.pdf,$(wildcard *.md))
all : $(SLIDES) $(HANDOUTS)
%.md.slides.pdf : %.md
pandoc $^ -t beamer --slide-level 2 -o $@
%.md.handout.pdf : %.md
pandoc $^ -t beamer --slide-level 2 -V handout -o $@
@lmullen
lmullen / README.md
Last active Aug 25, 2019
Distance matrix in R
View README.md

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.

Results:

  • New York is closest to Philadelphia
  • Los Angeles is closest to Houston
@lmullen
lmullen / .slate
Created Feb 8, 2013
My configuration file for the Slate window manager
View .slate
# GLOBAL CONFIGURATIONS
# -------------------------------------------------------------------
# See https://github.com/jigish/slate/wiki/Global-Configs
config defaultToCurrentScreen true
config secondsBeforeRepeat 0.4
config secondsBetweenRepeat 0.1
config keyboardLayout "qwerty"
config nudgePercentOf screenSize
config resizePercentOf screenSize
@lmullen
lmullen / shapefile.r
Last active Aug 3, 2019
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
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 | http://lincolnmullen.com | lincoln@lincolnmullen.com
# List files to be made by finding all *.md files and appending .pdf
PDFS := $(patsubst %.md,%.md.pdf,$(wildcard *.md))
# The all rule makes all the PDF files listed
all : $(PDFS)
# This generic rule accepts PDF targets with corresponding Markdown
@lmullen
lmullen / analysis.r
Last active Dec 7, 2018
Charting Faculty Salaries
View analysis.r
library(dplyr)
library(reshape2)
library(stringr)
library(ggplot2)
library(RColorBrewer)
# options(stringsAsFactors = FALSE)
options("scipen"=100, "digits"=4)
salaries <- read.csv("faculty-salaries-2013-14.csv")
@lmullen
lmullen / Makefile
Created Sep 3, 2014
Very minimal HTML for JavaScript
View Makefile
serve :
ruby -run -e httpd . -p 4000
@lmullen
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
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 | lincoln@lincolnmullen.com | http://lincolnmullen.com
# MIT License <http://lmullen.mit-license.org/>
#
# You will have to install the git gem for this to work:
# gem install git
#
@lmullen
lmullen / README.md
Created Sep 1, 2014
Getting the Ace editor to work with gitit
View README.md

The file page.st 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.