Skip to content

Instantly share code, notes, and snippets.

@brooksreese
brooksreese / gist:a7533da01f410ed623df
Last active August 29, 2015 14:01
refactoring example
def set_gmap_markers
markers = {
:ddtcs => ActionController::Base.helpers.asset_path('marker_DDTCS.png'),
:chms => ActionController::Base.helpers.asset_path('marker_CHMS.png'),
:all => ActionController::Base.helpers.asset_path('marker_CHMS-DDTCS.png')
}
@hash = Gmaps4rails.build_markers(@locations) do |location, marker|
marker.lat location.latitude
marker.lng location.longitude
@brooksreese
brooksreese / .bash_profile
Last active December 17, 2015 18:29
Bash config
alias db="cd ~/Dropbox && pwd"
alias rr="cd ~/Dropbox/Rails && pwd"
alias recreate="bundle exec rake db:drop db:create db:migrate db:seed"
alias rmt="bundle exec rake db:migrate db:test:prepare"
alias calc="open /Applications/Calculator.app"
@brooksreese
brooksreese / model_spec.rb
Created March 17, 2013 03:54
Basic model test using RSpec
require 'spec_helper'
describe "Provider Locations" do
before(:each) do
@provider_location = FactoryGirl.create(:provider_location)
end
it "is valid with valid attributes" do
@provider_location.should be_valid