Skip to content

Instantly share code, notes, and snippets.

View OfTheDelmer's full-sized avatar

Delmer OfTheDelmer

View GitHub Profile
# We want a method that splits an array on an index and
# removes everything afterward
# Example: myArray = [1, 2, 3, 4, 5, 6]
# splice(3, myArray) => [1,2,3,4]
myArray = [1,2,3,4,5,6]
puts "Give my an index"
index = gets.chomp().to_i
# User list holds a list of names
# and their shopping items
# Expecting [name, [item1, item2]] style
user_list = []
# Prompting the user if they want to start
puts "Would you like to start a nested list?[y/n]"
response = gets.chomp
my_hash = {"jackie"=>"I like bowling", "Luke"=>"likes riding his bike", "imogen"=>"I have a cold", "sara"=>"I ride bart"}
puts "Want to start a hash?"
response = gets.chomp
while response == "y"
puts "Give us your name"
key = gets.chomp

Day 4:

Intro to Classes

Objective
To be able to create simple classes and methods

Prev Work:

  • Common Datatypes
class Person
def initialize(name="no name")
@name = name
end
# Set method it
def name=(other_name)
@name = other_name
class Person
attr_reader :name, :age
def initialize(name="no name", age)
@name = name
@age = age
end

CSS and JS Lab

Select, Position, et cetera

Some reference for later el and el2 just denote any two element tagnames

Selector Use
* selects all
#name selects by id

#Debugging (Use The Duck… )

Find the errors in the following

1.)

#Debugging (Use The Duck… )

Find the errors in the following

1.)

Intro to JQuery and AJAX

Pracitce with promises

Prev. Covered:

  • jQuery
    • Selectors
      • show, hide,