Skip to content

Instantly share code, notes, and snippets.

View bobbywilson0's full-sized avatar

Bobby Wilson bobbywilson0

View GitHub Profile
(ns noc.core
(:use quil.core))
(defn setup []
(background 255)
(no-loop))
(defn draw []
(pixels)
(doseq [x (range 0 (width))
def pending_total
return 0.00 if not_needed?
# everyone gets the member pricing
daily_rate = ACCOMMODATION_RATES[room_type][:member]
departure_date = departure.to_date
arrival_date = arrival.to_date
total_days = departure_date - arrival_date
before_discounted_days = [[start_date - arrival_date, 3].min, 0].max
after_discounted_days = [[departure_date - end_date, 3].min, 0].max
discounted_days = before_discounted_days + after_discounted_days
class Post
include Mongoid::Document
field :title, :type => String
has_many :comments
end
class Comment
include Mongoid::Document
field :body, :type => String
belongs_to :post, :inverse_of => :comments
# mongo_template.rb
# fork of Ben Scofield's Rails MongoMapper Template (http://gist.github.com/181842)
# fork of Kyle Banker's Rails MongoMapper Template (http://gist.github.com/219223)
# remove unneeded defaults
run "rm public/index.html"
run "rm public/images/rails.png"
run "rm public/javascripts/controls.js"
run "rm public/javascripts/dragdrop.js"
run "rm public/javascripts/effects.js"
class Appointment < ActiveRecord::Base
attr_reader :availability
def full?
availability < 1
end
end
# And then in your view