Skip to content

Instantly share code, notes, and snippets.

View mattflo's full-sized avatar

Matt Florence mattflo

View GitHub Profile
@RobertSudwarts
RobertSudwarts / deg_to_cardinal.py
Created June 7, 2015 16:18
[python] degrees to cardinal directions
def degrees_to_cardinal(d):
'''
note: this is highly approximate...
'''
dirs = ["N", "NNE", "NE", "ENE", "E", "ESE", "SE", "SSE",
"S", "SSW", "SW", "WSW", "W", "WNW", "NW", "NNW"]
ix = int((d + 11.25)/22.5)
return dirs[ix % 16]
@henryalee
henryalee / MongoDB Install and AutoStart
Last active November 21, 2017 03:20
Install mongodb with homebrew and set it to autostart
brew install mongo
mkdir -p ~/Library/LaunchAgents
cp /usr/local/Cellar/mongodb/2.2.0-x86_64/homebrew.mxcl.mongodb.plist ~/Library/LaunchAgents/
launchctl load -w ~/Library/LaunchAgents/homebrew.mxcl.mongodb.plist
# Mongo might be named differently, try this
cp /usr/local/Cellar/mongodb**/**/*plist ~/Library/LaunchAgents/
launchctl load -w ~/Library/LaunchAgents/*mongo*plist