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
// Actually, this is not going to work. Please ignore it. | |
function isMeasurable(target, array) { | |
if (array.length < 1) { return false; } | |
if (array.indexOf(target) >= 0) { return true; } | |
var weights = array.concat(target); | |
var length = 1 << weights.length; | |
for (var i = 0; i < length; i++) { |
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
require('./module') | |
console.log(test); |
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
crontab.load(function(err, tab) { | |
require('npm').load(function (err, npm) { | |
if (err) { console.log(err); process.exit(1); } | |
var path = require('path'); | |
var util = require('util'); | |
var uuid = '322ed3d0-6869-11e1-b86c-0800200c9a66'; | |
var npmPrefix = npm.config.get('prefix'); | |
var npmBinRoot = path.join(npmPrefix, 'bin'); | |
var nodePath = process.execPath.split('/').slice(0, -1).join('/'); |
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
require('crontab').load(cronLoaded); | |
function cronLoaded(err, tab) { | |
if (err) { console.log(err); process.exit(1); } | |
var command = '/usr/bin/env echo "starting some service..."'; | |
tab.remove(tab.findCommand(command)); | |
var item = tab.create(command); | |
item.everyReboot(); |
NewerOlder