Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am vikiann on github.
  • I am viki_ann (https://keybase.io/viki_ann) on keybase.
  • I have a public key ASBMAMHjBeacXqK08EbrObbZrsu_poZCPBlQK8-4P4AnKAo

To claim this, I am signing this object:

1. What's the difference between a cookie and a session?
Maybe cookies are more complicated. A session starts when a user logs in, and maybe you don't need a logged-in state for a cookie?
2. What's serialization and how does it come into play with cookies?
I have no idea.
3. Can a cookie be shared by more than one user? How/why?
I don't think so... a cookie is stored on a machine, isn't it? Or in the browser? Maybe if you have two people using the same machine, but it'd still be a different cookie if they had different browsers and stuff...
4. What would it mean to store a shopping cart in a cookie?
@VikiAnn
VikiAnn / SQL Notes
Created November 3, 2014 17:35
SQL notes
What are database tables, column, and rows? What's the purpose of each?
Table is a collection of data organized into columns and rows.
Rows are usually one record. Usually horizontal.
Columns are usually vertical, and contain similar information about multiple records.
How's a database similar and different from a spreadsheet?
def add(*numbers)
numbers.sum
end
def subtract(number, *more_numbers)
more_numbers.each do |i|
number -= i
end
number
end
@VikiAnn
VikiAnn / gist:8756686
Created February 1, 2014 18:45
grab method
def grab(piece)
candies.any? do |candy|
if candy.type == piece
piece
end
end
end
@VikiAnn
VikiAnn / README.md
Last active August 29, 2015 13:55
jumpstartlab objects-and-methods exercise

Note from Viki: working on exercise 2. I'm on bag.rb. Tests were provided, I'm running bag_test.rb and running into issues on line 90, which is testing my method take in bag.rb starting on line 34.

Objects and Methods

Exercise 1

If you'd like to be walked through the exercise, check out the Objects and Methods workshop on the Jumpstart Lab tutorials site.

Make the tests pass in the following sequence:

@VikiAnn
VikiAnn / candy.rb
Created January 22, 2014 02:29
candy in sugar
class Candy
def initialize(candy, *sugar)
@candy = candy
@sugar = sugar
end
def type
@candy
end