Skip to content

Instantly share code, notes, and snippets.

View werebus's full-sized avatar

Matt Moretti werebus

  • UMass Transportation Services (@umts)
  • Greenfield, MA
View GitHub Profile
@werebus
werebus / resume-blank.tex
Last active September 30, 2015 15:47
Resume LaTeX layout
% resume.tex
%
% Layout (c) 2007-2011 Jeremy B. R. Edberg <[email protected]> http://www.jedberg.net
%
%%%%%%%%%%%%
% Variables, fill these in:
\newcommand{\resumeauthor}{Your Full Name}
\newcommand{\resumeemail}{[email protected]}
\newcommand{\resumephone}{Mobile: 812-555-1234}
@werebus
werebus / .vimrc
Last active May 24, 2017 19:31
A very basic .vimrc
set nocompatible
set backspace=indent,eol,start
filetype plugin indent on
set history=50
set ruler
set number
set showcmd
set incsearch
@werebus
werebus / create file
Created July 19, 2012 15:28
Ruby openssl decrypt
$ echo "This is a secret file" | openssl enc -aes-256-cbc > secret.txt
!/usr/bin/env ruby
#
class GeoDist
def self.haversine(lat1, lon1, lat2, lon2)
r = 6371 ## km
dLat = self.toRadians(lat2-lat1)
dLon = self.toRadians(lon2-lon1)
lat1 = self.toRadians(lat1)
lat2 = self.toRadians(lat2)
@werebus
werebus / add-key.rb
Created November 25, 2012 17:59
An example SSH-key-adding class for Github
require 'rubygems'
require 'httparty'
require 'io/console'
class GithubApi
include HTTParty
base_uri 'https://api.github.com'
def initialize(username, password)
@auth = {:username => username, :password => password}
@werebus
werebus / stops_to_json.rb
Created June 27, 2013 17:24
gtfs 'stops.txt' file to geojson file
require 'json'
require 'csv'
json = { 'type' => 'FeatureCollection',
'crs' => { 'type' => 'name',
'properties' => { 'name' => 'urn:ogc:def:crs:OGC:1.3:CRS84' } },
'features' => []
}
CSV.open('stops.txt', 'r') do |csv|
@werebus
werebus / memo.tex
Last active December 19, 2015 14:48
Basic Memo LaTeX layout
\documentclass[12pt]{letter}
\usepackage{fullpage} %1in margins on every page
\usepackage{parskip} %no paragraph indents, put a space inbetween instead
\begin{document}
\pagestyle{empty}
\centerline{\Large \bf MEMO}
\bigskip
\begin{description}
\setlength{\itemsep}{0pt}
@werebus
werebus / letter.tex
Created July 11, 2013 00:39
Business letter - basically letter.cls, but with everything left-aligned
\documentclass[12pt]{letter}
\usepackage{fullpage} %1in margins on every page
\longindentation=0pt
\renewcommand*{\opening}[1]{\thispagestyle{empty}%
{\raggedright \fromaddress \\*[2\parskip]%
\today \\*[2\parskip]%
\toname \\ \toaddress \par}%
\vspace{2\parskip}%
#!/usr/bin/env ruby -w
# brew-services(1) - Easily start and stop formulas via launchctl
# ===============================================================
#
# ## SYNOPSIS
#
# [<sudo>] `brew services` `list`<br>
# [<sudo>] `brew services` `restart` <formula><br>
# [<sudo>] `brew services` `start` <formula> [<plist>]<br>
@werebus
werebus / spells.sql
Last active August 29, 2015 13:56
Pathfinder spells -> postgres
CREATE TABLE spells (
name varchar(255) unique not null,
school varchar(255),
subschool varchar(255),
descriptor varchar(255),
spell_level varchar(255),
casting_time varchar(255),
components varchar(255),
costly_components boolean,
range varchar(255),