Skip to content

Instantly share code, notes, and snippets.

View gregmacfarlane's full-sized avatar

Greg Macfarlane gregmacfarlane

View GitHub Profile
@gregmacfarlane
gregmacfarlane / check_temperature.R
Last active November 8, 2015 21:14
Check the temperature for a hike
check_temperature <- function(temperature){
if(temperature > 85){
print("It's hot. Bring water and sunscreen.")
} else {
print("Looks like a great day to hike!")
}
}
check_temperature(68)
@gregmacfarlane
gregmacfarlane / shp2xml.py
Created September 15, 2014 20:50
A script to convert a lines shapefile into a MATSim network
# Code to read the FAF network
# Greg Macfarlane | Parsons Brinckerhoff
# ORNL provides the FAF network as a TransCAD network, and also as a shapefile
# that I think is probably exported from the TransCAD network. Kyle Ward in the
# Raleigh office tried to export an xml file from TransCAD, but it wasn't quite
# right. So I decided to write this script to make an xml MATSim network from
# the shapefile.