| ⌘T | go to file |
| ⌘⌃P | go to project |
| ⌘R | go to methods |
| ⌃G | go to line |
| ⌘KB | toggle side bar |
| ⌘⇧P | command prompt |
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
| <html> | |
| <head> | |
| <title>Ajax Example</title> | |
| </head> | |
| <body> | |
| <section> | |
| <h1>Recent Posts</h1> | |
| <article> | |
| <h2>Post 1</h2> | |
| <p>This is post 1.</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
| function arrayOfLight(x){ | |
| myArray = []; | |
| for var(i = 0; i<=x; i++){ | |
| myArray[i] = i | |
| } | |
| return myArray; | |
| } |
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
| SELECT title, name, stock.isbn, stock, | |
| CASE WHEN type = 'h' THEN 'Hardcover edition' | |
| WHEN type = 'p' THEN 'Paperback edition' | |
| ELSE 'Unkown' | |
| END AS cover | |
| FROM editions JOIN publishers ON (editions.publisher_id = publishers.id) | |
| JOIN books ON (editions.book_id = books.id) | |
| JOIN stock ON (stock.isbn = editions.isbn) | |
| WHERE (publishers.name = 'Random House') AND (stock.stock > 0); |
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
| gem 'rspec' | |
| gem 'pry' | |
| gem 'byebug' |
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
| There are two distinct cases that I will refer to in order to explain the behaviour of 'self' in ruby | |
| First is within class 'instances'. When self is called within a class instance (instance of an object of said class), self is | |
| in this case referring to that particular instance. | |
| For example: | |
| def my_method | |
| p self | |
| end | |
| my_object = Object_Class.new | |
| my_object.my_method | |
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
| module Flight | |
| def fly | |
| if (self.can_fly?) | |
| puts "I'm a #{self.class}! I'm flying!" | |
| else | |
| puts "Don't be stupid. #{self.class}'s can't fly." | |
| end | |
| end | |
| end |