Skip to content

Instantly share code, notes, and snippets.

@bookis
bookis / resume.md
Created August 26, 2013 03:34
Resume

Resume

@bookis
bookis / comment.rb
Last active December 28, 2015 05:39
Supporting class for Canvas Methods quiz
class Comment
attr_accessor :content, :created_at
attr_reader :post_id, :author_id
def initialize(row)
@content = row[0]
@created_at = row[1]
@post_id = row[2]
@author_id = row[3]
end
#...
def current_visitor # This could be any name, `current_visitor` is just descriptive
if session[:visitor_id] # checking if the session hash has a key of :visitor_id
Visitor.find(session[:visitor_id]) # If there is a visitor id, find the Visitor by what is in the value of session[:visitor_id]
else
visitor = Visitor.create(ip_address: request.remote_ip) # If no session visitor id, create a new visitor assigning the ip_address
session[:visitor_id] = visitor.id # set the session hash visitor_id key to be the id of the record just created
visitor # return the visitor object that you just created, otherwiet the line above would be the last thing returned, but we want a Visitor object to be returned
end
@bookis
bookis / product-spec.md
Created February 29, 2016 20:03
Product Specification

Objective

  • What is the broad purpose of the product?
  • What are the specific goals of the product?

Audience

  • What groups of people would this product?

Competitors