Skip to content

Instantly share code, notes, and snippets.

View mikedao's full-sized avatar
🤷

Michael Dao mikedao

🤷
View GitHub Profile
require "minitest/autorun"
require "minitest/pride"
require "./lib/patron"
class PatronTest < Minitest::Test
def test_patron_has_attributes
patron = Patron.new("Bob")
assert_equal "Bob", patron.name

Exercise, Part One: The Presidents

For this exercise, we're going to use a table of the Presidents of the United States of America.

Let's try out a few things, just to get our hands dirty. We'll use the console in the Chrome developer tools to validate our work.

  • Select each tr element.
  • Select the first tr element only.
@mikedao
mikedao / b2_intermission_work.md
Last active September 26, 2024 15:57 — forked from BrianZanti/b2_intermission_work.md
B2 Intermission Work Submission

B2 Intermission Work

Answer these Check for Understanding questions as you work through the assignments.

HTML

  1. What is HTML?
  2. What is an HTML element?
  3. What is an HTML attribute?
  4. What is the difference between a class and an id? When would you use one vs. the other?

Challenge Part 1:

A fun exercise which is always good Ruby practice is to re-implement an existing Ruby method. This morning, we are going to be re-implementing #reverse.

Create a file in a folder using touch reverse.rb

In that file, write a method that will take a string as an argument and return that string reversed. Something like this:

#Authorization

So yesterday we learned about authentication and today we are going to talk about its partner, authorization.

  • How would you define authentication?
  • With that definition in mind, how would you define authorization?

I like to think of authentication as being able to prove that you are who you say you are, but authorization is being allowed where you are allowed.

Example, I can show up to the White House with my photo ID and passport and I can prove to the people there that I am who I am, but they’re not going to let me into the Oval Office. Probably the best I can swing is going to be a public restroom and the gift shop.