Topic | Code | Video |
---|---|---|
Hashketball Review | [Code][hashket-code] | [Video][hashket-vid] |
Hashes and the Internet | [Code][hashy-code] | [Video][hashy-vid] |
Star Wars API Review | [Code][swapi-code] | [Video1][swapi-vid], [Video2][swapi-vid2] |
Intro to OO | [Code][oo-code] | [Video][oo-vid] |
Has Many & Belongs To | [Code][hasmany-code] | [Video][hasmany-vid] |
Animal & Zoo Review | [Code][zoo-code] | [Video][zoo-vid] |
Selector name | Return shape | Return type | Live? | Reference | can i call forEach? |
---|---|---|---|---|---|
document.getElementById() |
Single element | Element | N/A | https://goo.gl/8cHGoy | N/A |
element.getElementsByClassName() |
Collection | HTMLCollection | Yes | https://goo.gl/qcAhcp | No |
element.getElementsByTagName() |
Collection | HTMLCollection | Yes | https://goo.gl/QHozSh | No |
element.querySelector() |
Single element | Element | N/A | https://goo.gl/6Pqbcc | N/A |
element.querySelectorAll() |
Collection | NodeList | No | https://goo.gl/vTfXza | Yes |
- Replicate the bug (multiple times). Investigate: When does it happen? Describe the bug:
- When I do X
- Y happens
- But I expected (wanted) Z to happen
- Form a hypothesis or educated guess about WHY the bug is happening
- Read any errors, carefully — use debugging tools to fully understand what the error is telling you
- Use your past experience with similar bugs to come up with ideas
- Pick the most likely hypothesis
- If you have a reason, a gut feeling, or a favorite, use those to guide you
CRUD | SQL | ActiveRecord | HTTP Verb | URL | |
---|---|---|---|---|---|
Create | INSERT | Dog.create | POST | /dogs | ⤺ |
↳ form | - | - | GET | /dogs/new | ⤴ |
Read | |||||
↳ list | SELECT | Dog.all | GET | /dogs | |
↳ one | SELECT | Dog.find | GET | /dogs/:id | |
Update | UPDATE | @fido.update | PUT (PATCH) | /dogs/:id | ⤺ |
↳ form | - | - | GET | /dogs/:id/edit | ⤴ |
Delete | DELETE | @fido.destroy | DELETE | /dogs/:id |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# wot = [1,2,3,4,5,6,7,8].map do |number| | |
# number * 5 | |
# end | |
# p wot | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# The code that follows is a Dog class with a multitude of class methods | |
# that filter and transform Dog.all for various purposes. Unfortunately, | |
# the author of these methods used .each to accomplish the iteration in | |
# all cases, when .map (or .collect), .find, or .select would have been | |
# a better choice. Read the code, run it with some test data (create a | |
# runner file!) and understand what the methods are doing. Refactor to | |
# use a different array method. | |
class Dog |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
dogs = [ | |
{ | |
name: "fido", | |
age: 4, | |
likes: ["play fetch", "bark", "piddle"] | |
}, | |
{ | |
name: "spot", | |
age: 10, | |
likes: ["sleep"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<li class="js--horseListItem list-item col-1-2"> | |
<a class="js--horseLink big fancy-text light-link" href="/horses/<%= andreea.id%>"><%= andreea.name %></a> | |
<span class="js--horseDetails"></span> | |
</li> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'net/http' | |
require 'net/https' | |
require 'json' | |
require "open-uri" | |
class CacheMonetGif | |
attr_reader :remote_path |