Skip to content

Instantly share code, notes, and snippets.

View mikedao's full-sized avatar
🤷

Michael Dao mikedao

🤷
View GitHub Profile
@mikedao
mikedao / b2_intermission_work.md
Last active April 25, 2024 23:18 — 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?

#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.

  • What do you know about modules already? If little, what would you guess modules are all about?
  • Golf and basketball both use a ball. But if you're on a basketball court and ask for "the ball," no one is going to throw you a golf ball. Why? If you were as dumb as a computer, why would a golfd ball be an acceptable response?
  • You've learned about the object model and method lookups. What would the imapct be of injecting an additional ancestor into a class' lookup chain?

Module 1 Week 1 Diagnostic

This exercise is intended to help you assess your progress with the concepts and techniques we've covered during the week.

For these questions, write a short snippet of code that meets the requirement. Fill in your answers on a second sheet of paper or in your notebook. In cases where the question mentions a "given" data value, use the variable given to refer to it (instead of re-writing the information).

Linked Lists

What is a Linked List?

A linked list is a data structure used for storing collections of data. A linked list has the following properties.

  • Successive elements are connected by pointers.
  • Last element points to nil
  • Can grow or shrink in size during execution of a program.
  • Can be made just as long as required (until system memory is exhausted)

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:

Codebreakers

We're going to be writing a program to do some basic text encryption through everyone's friend, the command line.

Iteration 1 - Initials

We're first going to start with an exercise to figure out how we can get code entered on the command line.

Create a file called initials.rb.

Create VPC
Create Security Group
Create incoming and outgoing rules for SSH, HTTP, Sinatra and Rackup, 443
Create Key Pair
cd ~/.ssh
mv ~/Downloads/Turing.pem .
chmod 400 Turing.pem
ssh-add -k Turing.pem
Launch Instance
ubuntu 14.04

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.