This file contains hidden or 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
someFunction: (date) -> | |
startOfMonth = date.beginningOfMonth() | |
endOfMonth = date.endOfMonth() | |
console.log startOfMonth.format('{MM}-{DD}-{YYYY}') | |
console.log endOfMonth.format('{MM}-{DD}-{YYYY}') | |
console.log '---' | |
# I call someFunction() with the SugarJS Date objects representing "12-09-2011" and "01-09-2012" and get this in the console: |
This file contains hidden or 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
class Deal < ActiveRecord::Base | |
belongs_to :store | |
has_many :categories, :as => :categorizable | |
end | |
class Store < ActiveRecord::Base | |
has_many :deals | |
has_many :categories, :as => :categorizable | |
has_many :coupons, :through => :categories | |
end |
This file contains hidden or 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
class MeetingDates | |
def initialize | |
@crb_dates = [] | |
@jam_dates = [] | |
calc_meeting_dates | |
end | |
def calc_meeting_dates | |
start_date = Date.today.beginning_of_year | |
(0..12).inject([]){|s, num| dates_for_month(start_date + num.months)} |
This file contains hidden or 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
GameRouter = new Backbone.Router.extend | |
routes: | |
"draw": "draw" | |
initialize: -> | |
this.gameView = new GameView() | |
Backbone.history.start() | |
draw: -> | |
this.gameView.draw(); |
This file contains hidden or 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
And I add all of the following vehicles | SerialNumber | Year | Make | Model/Body/Type | Vehicle Type | Cost | Vehicle Used For | Gross Weight | Usage | Radius | Type Operation | Additional Insured Apply | | 5FNRL386X7B036167 | 2007 | Honda | Odyssey Exl | Private Passenger | 31095 | Business Purposes | | | | | No | | 5TEUU42N88Z573326 | 2008 | Toyota | Tacoma Acces | Private Passenger | 23110 | Business Purposes | | | | | No | |
This file contains hidden or 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
And I add all of the following vehicles | |
| SerialNumber | Year | Make | Model/Body/Type | Vehicle Type | Cost | Vehicle Used For | Gross Weight | Usage | Radius | Type Operation | Additional Insured Apply | | |
| 5FNRL386X7B036167 | 2007 | Honda | Odyssey Exl | Private Passenger | 31095 | Business Purposes | | | | | No | | |
| 5TEUU42N88Z573326 | 2008 | Toyota | Tacoma Acces | Private Passenger | 23110 | Business Purposes | | | | | No | |
This file contains hidden or 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
set list " Show special characters | |
set backspace=indent,eol,start " Make backspace behave | |
set nohidden " Close the buffer when I close the tab | |
set splitright " Open vertical splits to the right | |
set splitbelow " Open horizontal splits to the bottom | |
set foldmethod=syntax " Fold based on the code at hand | |
set foldnestmax=20 " Only fold three levels | |
set autoread " Read in changed files | |
set magic " Better regexes | |
set nobackup " Dont' worry about backing up files |
This file contains hidden or 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
Given I am on "page_name" | |
When I go to "page_name" | |
When I press "button" | |
When I follow "link" | |
When I follow "link" within "area" | |
When I fill in "text_field" with "text" | |
When I fill in "text" for "text field" | |
When I select "value" from "select box" | |
When I check "check_box" | |
When I uncheck "check_box" |
This file contains hidden or 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
class Car | |
attr_accessor :vin_number | |
end | |
my_car = Car.new | |
my_car.to_s => "Car#<79860879878>" | |
# to_s is already defined via Object.to_s. Since Car inherits from Object, we get it for free. | |
# We can also redefine it to make it more useful too: |
This file contains hidden or 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
set guioptions=aAce " Turn of MacVim's toolbar, scrollbars, etc. | |
set transparency=0 " No transparency | |
set guifont=Monaco:h12 " Default font | |
set list " Show special characters | |
set backspace=indent,eol,start " Make backspace behave | |
set nohidden " Close the buffer when I close the tab | |
set splitright " Open vertical splits to the right | |
set splitbelow " Open horizontal splits to the bottom | |
set foldmethod=syntax " Fold based on the code at hand | |
set foldnestmax=3 " Only fold three levels |