Related Setup: https://gist.github.com/hofmannsven/6814278
Related Pro Tips: https://ochronus.com/git-tips-from-the-trenches/
| require 'active_support/all' | |
| @candidates = [ | |
| { | |
| id: 5, | |
| years_of_experience: 4, | |
| github_points: 293, | |
| languages: ['C', 'Ruby', 'Python', 'Clojure'], | |
| date_applied: 5.days.ago.to_date, | |
| age: 26 |
| ### SETUP | |
| require 'rspec' | |
| ### LOGIC (fix me) | |
| def hello(who) | |
| "hello #{who}!" | |
| end | |
| ### TEST CODE (don't touch me) |
| 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 |
| # 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 |
| -- 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 |
| -- 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 |
| var myArray = [] | |
| var i = 0 | |
| var arrayOfLight = function(x) { | |
| while(i < x + 1) { | |
| myArray.push(i) | |
| i++; | |
| } | |
| } |
| <!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> |
Related Setup: https://gist.github.com/hofmannsven/6814278
Related Pro Tips: https://ochronus.com/git-tips-from-the-trenches/
window, navigator
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.document
window.document represents all content as nodes - tags, text, images, and so on.