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
| { | |
| "name": "myweb", | |
| "version": "0.0.1", | |
| "dependencies": { | |
| "jquery": "~1.8.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
| npm install -g bower |
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
| npm install -g bower-installer |
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
| bower install angular --save |
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
| bower install angular-mocks --save-dev |
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
| Array.prototype.where = function (query) { | |
| if (!query) { | |
| return this; | |
| } | |
| if (typeof(query) == 'function') { | |
| return this.filter(query); | |
| }; | |
| return this.filter(function (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
| // Option A | |
| var threes = _.map([1, 2, 3], function(num){ return num * 3; }); | |
| // threes => [3, 6, 9] | |
| var odds = _.filter(threes, function(num) { return num % 2 != 0; }); | |
| // oddss => [3, 9] | |
| // Option B | |
| var odds = _.filter(_.map([1, 2, 3], function(num){ return num * 3; }), function(num) { return num % 2 != 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
| var stooges = [{name: 'moe', age: 40}, {name: 'larry', age: 50}, {name: 'curly', age: 60}]; | |
| var names = _.pluck(stooges, 'name'); | |
| // names => ["moe", "larry", "curly"] |
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
| npm install -g express | |
| npm install -g express-generator | |
| express nodeapps | |
| cd nodeapps | |
| npm install | |
| npm start |
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 router = require('express').Router(); | |
| /* GET home page. */ | |
| router.get('/', function(req, res) { | |
| res.render('index', { title: 'Express' }); | |
| }); | |
| module.exports = router; |
OlderNewer