- TDD Test Driven Development. Write examples before implementation.
- BDD Behaviour-Driven Development is about implementing an application by describing its behavior from the perspective of its stakeholders. (The Rspec Book)
- RSpec (mention alternatives, write a simple hand sewn test)
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 String | |
| def to_bool | |
| return true if self == true || self =~ (/(true|t|yes|y|1)$/i) | |
| return false if self == false || self.blank? || self =~ (/(false|f|no|n|0)$/i) | |
| raise ArgumentError.new("invalid value for Boolean: \"#{self}\"") | |
| end | |
| 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
| $(document).ready(function () { | |
| // PSEUDO-CODE: | |
| // 1- intercept the form submission event using jQuery | |
| // 2- prevent the default action for that event from happening | |
| // 3- generate a random number between 1 and 6 using JavaScript | |
| // 4- use jQuery to submit an AJAX post to the form's action | |
| // 5- when the AJAX post is done, replace the contents of the "#die" DIV in the DOM using jQuery | |
| $('form').on('submit', function(e){ | |
| e.preventDefault(); |
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
| //------------------------------------------------------------------------------------------------------------------ | |
| // YOUR CODE: Create your Zoo "object literal" and Animal "constructor" and "prototypes" here. | |
| //------------------------------------------------------------------------------------------------------------------ | |
| function Animal (name, length) { | |
| this.name = name; | |
| this.length = length; | |
| } |
You've just been hired by a SF tech company that is looking to expand operations into new cities. Your first task: launch Salt Lake City. To launch into a new city of this size...
- 1 general manager
- 3 salespeople
- 2 customer support agents
- 1 office manager
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
| // Use Gists to store code you would like to remember later on | |
| console.log(window); // log the "window" object to the console |