This file contains 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
/** | |
* Test foreach loops by 10KK interations: | |
* | |
* Chrome 30.0.1599.101 | |
* f1: 7775 ms | |
* f2: 22541 ms | |
* f3: 20917 ms | |
* | |
* Node v0.10.17 | |
* f1: 8440 ms |
This file contains 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 strict'; | |
/** | |
* Module dependencies. | |
*/ | |
var config = require('../lib/util').config; | |
var log = require('../lib/util').log(module); | |
var util = require('util'); | |
var fs = require('fs'); | |
var Clinch = require('clinch'); |
This file contains 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
Available tasks | |
lvrld Alias for "livereload-start", "connect", "regarde" tasks. | |
main Alias for "clean:dst", "copy:main", "clean:ignore", | |
"concat:main", "ect", "less:browser" tasks. | |
browser Alias for "main", "lvrld" tasks. | |
phonegap Alias for "clean:dst", "copy:main", "clean:ignore", | |
"concat:main", "less:phonegap", "ect" tasks. | |
deploy Alias for "main", "rsync:deploy" tasks. | |
default Alias for "browser" task. | |
rsync Performs rsync tasks. * |
This file contains 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
➜ jpr grunt build | |
Running "clean:dist" (clean) task | |
Cleaning public_html/.htaccess...OK | |
Cleaning public_html/css...OK | |
Cleaning public_html/favicon.ico...OK | |
Cleaning public_html/fonts...OK | |
Cleaning public_html/js...OK | |
Cleaning public_html/robots.txt...OK | |
Running "useminPrepare:html" (useminPrepare) task |
This file contains 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.__defineGetter__('0', function () {return false}); | |
undefined = !undefined |
This file contains 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
exports.get = function(req, res){ | |
User.find(null, 'email -_id', function(err, users) { | |
if (err) return res.json(500, err); | |
var retobj = {}; | |
var keys = Object.keys(users); | |
var i = keys.length; | |
while (i--) retobj[i] = users[keys[i]] && users[keys[i]].email; |
This file contains 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 express = require('express'); | |
var credentials = "admin:password"; | |
var basicAuthMw = express.basicAuth.apply(null, credentials.split(':')); |
This file contains 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
// vendor | |
var express = require('express'); | |
var router = new express.Router(); | |
// routes also have the .param method to allow for easier resource loading | |
// in this case we will make sure all our routes load the post | |
router.param('post_id', function(req, res, next, post_id) { | |
// simulate loading a post | |
setTimeout(function() { |
This file contains 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
/** | |
* Abstract | |
*/ | |
var obj = { | |
wrapped: function(a,b) { | |
console.log('this:', this); | |
console.log('a:', a); | |
console.log('b:', b); | |
} | |
} |