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 matrixFactory(n) { | |
return (new Array(n)).map(function() { | |
return (Math.random() > 0.5) ? 1 : 0; | |
}); | |
}; |
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 Scheduler() { | |
this._i = 0 | |
} | |
Scheduler.prototype = { | |
tick: function() { | |
this._i++ | |
} | |
} | |
var scheduler = new Scheduler | |
setInterval(scheduler.tick, 1000) |
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 A = function() { }; | |
A.prototype.func = function() { | |
console.log('#1'); | |
} | |
var a = new A(); |
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
100['toString']['length'] |
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 x = 10; | |
var foo = { | |
x: 20, | |
bar: function () { | |
var x = 30; | |
return this.x; | |
} | |
}; | |
foo.bar() |
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 x = 10; | |
var y = (function() { | |
var x = 20; | |
var a = function() { | |
return x; | |
}; | |
return a; |
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) { | |
grunt.registerTask('dev', 'setup development enviroment', function() { | |
require('shelljs/global'); | |
groupCheck(); | |
rootDir(); | |
serverDir(); | |
staticDir(); |
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
dev:: | |
@if [ -f ./.init.sh ]; then echo "'make init' must be runned before 'make dev'" ; exit 1 ; fi | |
@if [ ! `$(id -u)` == "0" ] && [ ! `groups | grep -o "www-data"` ]; then echo "You must be in www-data group to run 'make dev' (or root)" ; echo "To add yourself in www-data type:"; echo "sudo usermod -a -G www-data $(USER)"; echo "After that logout and login. You should see www-data in output of 'groups' command" exit 1 ; fi | |
@if [ "$(INRIGHTDIR)" == "" ]; then echo "Project should be developed at /home/$(USER)/www/{PROJECTNAME}" ; exit 1 ; fi | |
npm install --registry=http://npm.yandex-team.ru | |
@(cd server ; \ | |
npm install --registry=http://npm.yandex-team.ru ; \ |
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
#!/opt/nodejs/0.10/bin/node | |
var Vow = require("vow"); | |
var promises = require("cocaine/lib/client/methods/promises_shim").Vow(Vow); | |
var methods = require("cocaine/lib/client/methods/promises")(promises); | |
var cocaine = require("cocaine"); | |
var argv = require("optimist").argv; | |
var Worker, handle, http; |
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
Logger: connecting to service logging | |
resolve done: [ [ '37.9.124.200', 32778 ], | |
1, | |
{ '0': 'start_app', '1': 'pause_app', '2': 'list' } ] | |
something done 1 | |
Logger: connected to service logging | |
something done 2 | |
so what's in store? | |
there's something for us: [ 'dench_did_cocaine-project-stub_at_b2348ed354cf92b709affb9733f6e42700aeaf7d', | |
'skimmer', |
OlderNewer