This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
parse_git_branch(){ | |
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/' | |
} | |
parse_home_dir(){ | |
pwd -P | sed -e "s/^$(echo $HOME | sed -e 's/\//\\\//g')/~/" -e 's/~\/Development/~\/dev/' | |
} | |
PS1="\$(parse_home_dir)\$(parse_git_branch) $ " |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
lower_bound = (ARGV.shift || 2).to_i | |
upper_bound = (ARGV.shift || 35).to_i | |
iterations = (ARGV.shift || 20_000).to_i | |
(lower_bound..upper_bound).each do |person_count| | |
matches = 0 | |
iterations.times do | |
matches += 1 if (1..person_count).map{|p| rand(365)}.uniq! | |
end | |
puts "Person count: %3d Success: %3.1f" % |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
' MACRO NAME: | |
' AddQuantity | |
' AUTHOR: | |
' Bradley Grzesiak | |
' FUNCTION: | |
' Increments the quantity of one or many dimensions in a drawing | |
' INSTALL: | |
' Create a "New Macro Button" via Tools->Customize->Commands->Macro in a toolbar. | |
' It is highly recommended that you assign a keystroke to this macro. I use "q" | |
' COMPATIBILITY: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper') | |
describe "/users/index.html.haml" do | |
include UsersHelper | |
fixtures :users | |
before(:each) do | |
assigns[:users] = users | |
print "\nuser size: #{users.size}\n" | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require File.expand_path(File.dirname(__FILE__) + '/../spec_helper') | |
describe StoriesController do | |
def mock_story(stubs={}) | |
@mock_story ||= mock_model(Story, stubs) | |
end | |
def mock_errors(stubs={}) | |
unless @mock_errors | |
@mock_errors = mock(:errors, stubs) | |
@mock_errors.should_receive(:on).with(:text).and_return("error on :text") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Shoes.setup do | |
gem 'activeresource' | |
end | |
require 'activeresource' | |
class Person < ActiveResource::Base | |
self.site = 'http://0.0.0.0:3000' | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Submethods | |
def self.included(base) | |
base.extend ClassMethods | |
end | |
module ClassMethods | |
def submethods type = :public | |
if self.class.name == "Object" | |
return nil | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
STRIPPED_PS1="$(echo "$PS1" | sed -e 's/\$ $//')" | |
function prompt_with_success { | |
previous_return_value=$? | |
RED="\[\033[0;31m\]" | |
GREEN="\[\033[0;32m\]" | |
COLOR_NONE="\[\e[0m\]" | |
if [ $previous_return_value -eq 0 ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
source :rubygems | |
gem 'activerecord', '2.3.5' | |
gem 'sqlite3-ruby' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
source :rubygems | |
gem 'rails' | |
# Or find something else that returns true | |
# locally, but false on heroku | |
if RbConfig::CONFIG['host_os'] =~ /darwin/ | |
group :test do | |
# heroku fails hard on this gem | |
gem 'specjour' |
OlderNewer