Skip to content

Instantly share code, notes, and snippets.

def initialize( points, rafter_spacing, region )
self.points = points
ensure_points_are_geo_ruby_points
ensure_at_least_3_points
self.region = region
self.rafter_spacing = rafter_spacing
self.polygon = Polygon.from_points( [self.points] )
def initialize( points, rafter_spacing, region )
self.points = points
ensure_points_are_geo_ruby_points
ensure_at_least_3_points
self.region = region
self.rafter_spacing = rafter_spacing
self.polygon = Polygon.from_points( [self.points] )
@dreamr
dreamr / gist:1115011
Created July 30, 2011 00:12
TextMate Ruby Bundle Snippets - def .. end
# todo, doc me
def ${1:method_name}
$0
end
require 'spec_helper'
describe Layout do
describe "#generate(rafter_spacing, rafter_x_width,
mounting_length, mounting_width)" do
before(:each) do
@topic = Factory.build(:layout).generate
end
export z=$w'/zep_solar/'
export zp=$z'/zepulator'
export zs=$z'/zep_solar'
# Prompt Setup
function minutes_since_last_commit {
now=`date +%s`
last_commit=`git log --pretty=format:'%at' -1`
seconds_since_last_commit=$((now-last_commit))
minutes_since_last_commit=$((seconds_since_last_commit/60))
echo $minutes_since_last_commit
}
git_prompt() {
tests = [ { :disabled_panels => [] },
{ :disabled_panels => [ [0, 0], [0, 1], [1, 0], [1, 1] ] }
]
tests.each do |test|
context "disabled panels at: #{test[:disabled_panels]}" do
setup do
obj = valid_builder.get_instance
index_states = [
[0,0,false],
[0,1,true],
d=["2x4","2x6","4x4","4x10","2x8", "2x10"]
d.sort {|a,b| a.split("x") <=> b.split("x")} # doesnt work, nor any variations I can think of
# expected
["2x4","2x6","2x8","2x10","4x4", "4x10"]
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Maintainer: amix the lucky stiff
" http://amix.dk - [email protected]
"
" Version: 3.6 - 25/08/10 14:40:30
"
" Blog_post:
" http://amix.dk/blog/post/19486#The-ultimate-vim-configuration-vimrc
" Syntax_highlighted:
" http://amix.dk/vim/vimrc.html
" Vimrc file, http://phuzz.org
set nocompatible " use vim defaults
set ls=2 " allways show status line
set tabstop=4 " numbers of spaces of tab character
set shiftwidth=4 " numbers of spaces to (auto)indent
set scrolloff=3 " keep 3 lines when scrolling
set showcmd " display incomplete commands
set hlsearch " highlight searches
set incsearch " do incremental searching