Skip to content

Instantly share code, notes, and snippets.

@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

Keybase proof

I hereby claim:

  • I am bookis on github.
  • I am bookis (https://keybase.io/bookis) on keybase.
  • I have a public key whose fingerprint is B13D 02A2 3B45 C0A8 19EB B24D DD94 A361 4A5D AC98

To claim this, I am signing this object:

{
"users": [{
"id": 1
}, {
"id": 2
}, {
"id": 3
}]
}
1 People's Co-op Farmers Market 30th and Burnside Portland Multnomah Oregon 97202
2 Silverdale Farmers Market 98383 Silverdale Kitsap Washington 98383
3 Dolgeville Farmer's Market (Parking Lot) Between Main St. and Helmer Ave Dolgeville Herkimer New York 13329
4 Preston Farmers’ Market #1 Route 164 Preston New London Connecticut
5 Quincy Farmers Market 0 Denis Ryan Parkway Quincy Norfolk Massachusetts 2169
6 Jefferson City Farmer's Market 000 Main Street Jefferson City Cole Missouri 0
7 Petaluma Evening Farmers' Market 1 2nd Street Petaluma Sonoma California 94952
8 Charlestown Farmers Market 1 Austin Street, Thompson Square at Austin & Main Streets Boston Massachusetts 2129
9 Farmers Market at Christopher Newport University 1 Avenue of the Arts Newport News Newport News Virginia 23606
10 Saratoga Farmers' Market 1 Bayberry Drive Ballston Sp Saratoga New York 12020
class Transaction
attr_accessor :amount, :success
def initialize(amount, success)
@amount = amount
@success = success
end
def success?
@success
# method that takes two inputs (an array, a target sum)
# outputs an array of pairs that sum to the target sum
# ([1,2,3,4], 5) => [[1,4], [2,3]]
def sum_pairs(array, target)
matches = []
i = 0
array.each do |first|
i += 1
array[i..-1].each do |second|
#...
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 / 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
@bookis
bookis / resume.md
Created August 26, 2013 03:34
Resume

Resume

@bookis
bookis / notes.mdown
Created December 13, 2012 19:26
Notes for Norawas

Norawas Notes

Website

  • What components are needed now?
  • What components will be desired in the next 2 years?
    • Editable content
    • Blog
    • Take Donations
  • Photo Gallery