Skip to content

Instantly share code, notes, and snippets.

@bookis
bookis / product-spec.md
Created Feb 29, 2016
Product Specification
View product-spec.md

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

View keybase.md

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:

View dateedge-api.json
{
"users": [{
"id": 1
}, {
"id": 2
}, {
"id": 3
}]
}
View markets.csv
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
View transaction.rb
class Transaction
attr_accessor :amount, :success
def initialize(amount, success)
@amount = amount
@success = success
end
def success?
@success
View sums.rb
# 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|
View ApplicationController.rb
#...
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 Dec 28, 2015
Supporting class for Canvas Methods quiz
View comment.rb
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 / notes.mdown
Created Dec 13, 2012
Notes for Norawas
View notes.mdown

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
You can’t perform that action at this time.