Skip to content

Instantly share code, notes, and snippets.

View tlowrimore's full-sized avatar

Tim Lowrimore tlowrimore

View GitHub Profile
@tlowrimore
tlowrimore / text_layout.rb
Created March 9, 2012 17:14
Layout Plain-text with columns and shit. (Ruby 1.9)
# Quickly thrown together, but it works, and maybe it'll get YOU started on
# a better solution to the problem. Enjoy!
class TextLayout
attr_reader :page_width, :tab_width
def initialize(tab_width=4, page_width=80)
@tab_width, @page_width = tab_width, page_width
end
# Takes a title and an optional character which will be used
@tlowrimore
tlowrimore / play.rb
Created March 1, 2012 00:26
Ruby Golf - Hole 3: Rock, Paper, Scisors
def play(m)
a,c=%w(Rock Scissors Paper),rand(4);[a[c%3],%w(Draw Lose Win)[a.index(m)-c]]*','
end
@tlowrimore
tlowrimore / init.el
Created February 4, 2012 20:13
my emacs init.el
;; emacs configuration
(push "/usr/local/bin" exec-path)
(add-to-list 'load-path "~/.emacs.d")
(setq make-backup-files nil)
(setq auto-save-default nil)
(setq-default tab-width 2)
(setq-default indent-tabs-mode nil)
(setq inhibit-startup-message t)