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
console.lol = function () { | |
var args = Array.prototype.slice.call(arguments); | |
args.unshift('such-log!'); | |
console.log.apply(console, args); | |
}; |
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.exports = function(grunt) { | |
// Project configuration. | |
grunt.initConfig({ | |
concat: { | |
dist: { | |
src: ['main.js', 'ctrl1.js'], //source files goes here |
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.exports = function(grunt) { | |
// Project configuration. | |
grunt.initConfig({ | |
s3: { | |
options: { | |
region: 'us-east-1', | |
endpoint: 's3.amazonaws.com', |
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.exports = function(grunt) { | |
// Project configuration. | |
grunt.initConfig({ | |
concat: { | |
dist: { | |
src: ['main.js', 'ctrl1.js'], //source files goes here | |
dest: 'build/lib.js' //concatenated file goes here |
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
server.get('/', [ | |
restify.bodyParser(), | |
function (req, res, next) { | |
console.log('done') | |
res.send('okay ' + req.whatever) | |
return next() | |
} | |
]); |
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
function* naturalNumbers(){ | |
var n = 1; | |
while (true){ | |
yield n++; | |
} | |
} | |
var numbers = naturalNumbers(); | |
console.log (numbers.next()); |
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 koa = require('koa'); | |
var app = koa(); | |
app.use(function *responseTime(next){ | |
var start = new Date; | |
yield next; | |
var ms = new Date - start; | |
this.set('X-Response-Time', ms + '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
{ | |
"username": "XXX", | |
"key": "XXX", | |
"test_path": "test/angular/protractor.conf.js", | |
"test_framework": "mocha", | |
"browsers": [ | |
{ | |
"browser": "firefox", | |
"browser_version": "latest", | |
"os": "OS X", |
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
[program:PROJECT_NAME] | |
command=/home/risingstack/.nvm/v0.10.29/bin/node /home/risingstack/PROJECT_NAME/app.js | |
autostart=true | |
autorestart=true | |
environment=NODE_ENV=production | |
stderr_logfile=/var/log/PROJECT_NAME.err.log | |
stdout_logfile=/var/log/PROJECT_NAME.out.log |
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
// not written by me, found at unicredit's spectranet :) | |
// now I feel a lot safer | |
function parseBug(m){ | |
if (m == '08') return '8'; | |
if (m == '09') return '9'; | |
return m | |
} | |
var dp_y=parseInt(parseBug(v.substring(0,4))); |
OlderNewer