Skip to content

Instantly share code, notes, and snippets.

View ipc103's full-sized avatar

Ian Candy ipc103

  • 18:56 (UTC -04:00)
View GitHub Profile

Unit 6 Lesson 0 Problem Set

  1. Describe, in as much detail as you can, what happens when you open up Google Chrome, type "marcylabschool.org" into the address bar, and press enter.

  2. HTTP is a "stateless" protocol - what does this mean?

  3. Given that HTTP is a stateless protocol, how do we build "stateful" web applications.

  4. What is the difference between HTTP and HTTPS?

class Person
attr_accessor :name
end
class Players < ActiveRecord::Base
end
class CreatePlayers ActiveRecord::Migration
def change
create_table :players do |p|
p.string :name
p.string :team
p.string :position
p.timestamps null: false #the timestamp simply keeps track of when our database was updated.
end
end
@ipc103
ipc103 / gist:898dcb88d4ee4f294ca5
Created February 11, 2015 21:57
an awesome method
def an_awesome_method
puts "This method is not awesome"
end
check_a_random_number(make_a_random_number)
The random number is 61
That's a big number!
=> nil
def make_a_random_number
number = rand(1..100)
puts "The random number is #{number}"
number
end
@ipc103
ipc103 / error
Last active August 29, 2015 14:15
check_a_random_number(make_a_random_number)
The random number is 4
NoMethodError: undefined method `>' for nil:NilClass
from (irb):23:in `check_a_random_number'
from (irb):27
def check_a_random_number(number)
puts "That's a big number!" if number > 50
puts "That number's not that big!" if number <= 50
end
def make_a_random_number
number = rand(1..100)
puts "The random number is #{number}"
end