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
| RSpec.configure do |config| | |
| config.treat_symbols_as_metadata_keys_with_true_values = true | |
| config.run_all_when_everything_filtered = true | |
| config.filter_run :focus | |
| config.order = 'random' | |
| end |
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 promise = new Promise(function(resolve, reject) { | |
| resolve("Everlane"); | |
| }); | |
| promise.then(function(result) { | |
| console.log(result) | |
| }).catch(function(error){ | |
| console.log(error.message); | |
| }); |
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
| /* Here is your chance to take over Socrates! | |
| Spend 10 minutes on each of the following hacks to the socrates website. | |
| Enter them in the console to make sure it works and then save | |
| your results here. | |
| Choose a new pair for each. Add your names to the section you complete. | |
| */ |
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> | |
| <head> | |
| <link rel="stylesheet" href="http://cdn.jsdelivr.net/normalize/2.1.0/normalize.css"> | |
| <link rel="stylesheet" href="main.css"> | |
| <link rel="stylesheet" href="http://fonts.googleapis.com/css?family=Open+Sans:300,400,600,700,800"> | |
| <link rel="stylesheet" href="http://fonts.googleapis.com/css?family=Lato:100,900"> | |
| <link rel="stylesheet" href="http://cdnjs.cloudflare.com/ajax/libs/font-awesome/3.0.2/css/font-awesome.min.css"> | |
| </head> |
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
| class Vehicle | |
| @@INFLATED_WHEELS = 4 | |
| def initialize(args) | |
| @color = args[:color] | |
| @wheels_needed = 4 | |
| end | |
| def drive | |
| @status = :driving | |
| end |
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
| class Vehicle | |
| @@WHEELS= 4 | |
| def initialize(args) | |
| @color = args[:color] | |
| @num_wheels = 4 | |
| end | |
| def drive | |
| @status = :driving | |
| end |
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
| class Car | |
| @@WHEELS = 4 | |
| def initialize(args) | |
| @color = args[:color] | |
| @wheels = @@WHEELS | |
| end | |
| def drive | |
| @status = :driving | |
| end | |
| def brake |
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
| Create a method leap_year? that accepts an integer representing a year as input. | |
| It should return true if the year input is a leap year and false otherwise. | |
| For example, | |
| leap_year?(2000) # => true | |
| leap_year?(2001) # => false | |
| def leap_year?(year) |
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
| Create a method get_grade that accepts an average in the class and returns the letter grade as a String. | |
| It should only return one of 'A', 'B', 'C', etc. Don't worry about + and - grades. | |
| For example, | |
| get_grade(89) # => returns "B", *not* "B+" | |
| get_grade(70) # => returns "C" | |
| def get_grade(average) |
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: Triangle side lengths | |
| Write a method valid_triangle? which takes as its input three non-negative numbers. It should return true if the three numbers could form the side lengths of a triangle and false otherwise. | |
| The arguments don't correspond to specific sides. Don't worry about handling negative inputs — garbage in, garbage out. | |
| For example, | |
| valid_triangle?(0,0,0) # => false, because a triangle can't have 0-length sides | |
| valid_triangle?(1,1,1) # => true, an equilateral triangle |