Skip to content

Instantly share code, notes, and snippets.

View harrisonmalone's full-sized avatar

Harrison Malone harrisonmalone

View GitHub Profile
class Allergy
attr_reader :score
@@allergies = {
eggs: 1,
peanuts: 2,
shellfish: 4,
strawberries: 8,
tomatoes: 16,
chocolate: 32,
pollen: 64,
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Document</title>
<style>
body {
margin: 0px;
height: 100vh;
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link rel="stylesheet" href="./style.css" />
<title>Flexbox Cards</title>
</head>
<body>
<div class="container">

what are the pillars of the web?

  1. HTML, provides for structure, markup language
  2. CSS, make a page pretty, styles
  3. JavaScript, makes your page dynamic, think about the gmail example where a new email pops up without you refreshing

what is front end vs back end?

front end => you can see all of the code from the browser

# .each drills
# 1. The following array will be used in the .each challenges
# beatles = ['george harrison', 'ringo starr', 'john lennon', 'paul mccartney']
# a. Using .each print each of the beatles to the screen
# b. Using .each print each of the beatles to the screen except for john lennon
class Artist
def initialize(name)
@name = name
@albums = []
end
def add_album(album)
@albums.push(album)
end
end
class Dog
attr_reader :name, :age, :breed # etc
def initialize(name, age, breed)
@name = name
@age = age
@breed = breed
end
def name
@name
users = [
{
username: "emma",
email: "[email protected]",
address: "1 Bourke Street, Melbourne"
},
{
username: "paul",
email: "[email protected]",
address: "120 Spencer Street, Melbourne"
# def random_method(num, num2)
# num * 10
# # => 100
# end
# p random_method(10, 100)
# while true
# p "hello"
# end
# Arrays
# 1. Make an array of 3 different colours.
# 2. How do I access "blue" using an index.
# 3. Store the string blue (which you accessed with an index) in a variable.
# 4. Create an array called four_letter_animals with the following animals (in this order):
# "calf", "duck", "elephant", "goat", "lamb", "lion", "mule", "dog".