window
,navigator
- BOM - Browser Object Model
navigator
represents the the browser basic code (or kernel) and properties, like version, user agent string, language, geolocation options and so on.window
is a "god object" containing all browser components, such as the address bar (window.location
), modal dialogues (alert()
,prompt()
) and the window being displayed on screen itself. It's also the top object where all global variables are assigned to.
- BOM - Browser Object Model
document
- DOM - Document Object Model
- Contains all of the content being displayed - in other words, whatever is inside the
window
.
- The
document
represents all content as nodes - tags, text, images, and so on.
This file contains hidden or 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
// Future versions of Hyper may add additional config options, | |
// which will not automatically be merged into this file. | |
// See https://hyper.is#cfg for all currently supported options. | |
module.exports = { | |
config: { | |
// choose either `'stable'` for receiving highly polished, | |
// or `'canary'` for less polished but more frequent updates | |
updateChannel: "canary", |
Related Setup: https://gist.github.com/hofmannsven/6814278
Related Pro Tips: https://ochronus.com/git-tips-from-the-trenches/
This file contains hidden or 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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js"></script> | |
</head> | |
<body> | |
<h1>Welcome to the <em>Fancy Betting Game</em>!</h1> | |
<p id='wallet'></p> |
This file contains hidden or 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
var myArray = [] | |
var i = 0 | |
var arrayOfLight = function(x) { | |
while(i < x + 1) { | |
myArray.push(i) | |
i++; | |
} | |
} |
This file contains hidden or 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
-- Exercise 1 | |
SELECT book_id | |
FROM editions | |
WHERE publisher_id = 59; | |
-- Excercise 2 | |
SELECT b.id, b.title, e.book_id | |
FROM books AS b, editions AS e |
This file contains hidden or 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
-- Exercise 1 | |
SELECT book_id | |
FROM editions | |
WHERE publisher_id = 59; | |
-- Excercise 2 | |
SELECT b.id, b.title, e.book_id | |
FROM books AS b, editions AS e |
This file contains hidden or 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
# Define 8 empty classes: Animal, Mammal, Amphibian, Primate, Frog, Bat, Parrot, and Chimpanzee. | |
class Animal | |
attr_reader :num_legs | |
def warm_blooded? | |
@warm_blooded | |
end | |
end | |
module Flight | |
attr_reader :speed |
This file contains hidden or 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
def letter_count(string) | |
counting = Hash.new(0) | |
indexing = Hash.new { |hash, key| hash[key] = [] } | |
string.split('').each_with_index do |letter, index| | |
next if letter == ' ' | |
counting[letter] += 1 | |
indexing[letter] << index | |
end | |
puts counting | |
puts indexing |
This file contains hidden or 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
### SETUP | |
require 'rspec' | |
### LOGIC (fix me) | |
def hello(who) | |
"hello #{who}!" | |
end | |
### TEST CODE (don't touch me) |