Skip to content

Instantly share code, notes, and snippets.

@chrismahon
chrismahon / _queries.rb
Last active February 14, 2016 21:35
Appointment Scheduler
# Show me all available TimeSlots for a Staff member for a Service on a Day
@staff_member.available_time_slots.where( service=1, day=Today )
# Show me all available TimeSlots for a Service on a Day
@service.available_time_slots.where( day=Today )
# Show me all available TimeSlots for a Staff member for a Service between 2 Days grouped by Day
@staff_member.available_time_slots.where( service=1, day=>Today, day<=Today+5 ).grouped_by_day()
# Show me all available TimeSlots for a Service between 2 Days grouped by Day
def create
@article = Article.new(article_params)
@article.save
redirect_to @article
end
var x = 42;
var y = "42";
if (x ===y) {
document.write("x is equal to y with a strict test.");
} else {
document.write("x is not equal to y");
}
iMac:mysite chris$ cd /Users/chris/Sites/test
iMac:test chris$ sudo python -m SimpleHTTPServer 80
Password:
Serving HTTP on 0.0.0.0 port 80 ...