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
Stability ratings: 0-5 | |
0 - Deprecated. This feature is known to be problematic, and changes are | |
planned. Do not rely on it. Use of the feature may cause warnings. Backwards | |
compatibility should not be expected. | |
1 - Experimental. This feature was introduced recently, and may change | |
or be removed in future versions. Please try it out and provide feedback. | |
If it addresses a use-case that is important to you, tell the node core team. |
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
#!/bin/bash | |
IFNET="eth0" | |
IPNET="8.8.8.8" | |
PORTS="20 21 25 80 8000 8888 12000 12001 12002 12003" | |
BANLIST="64.205.0.18" | |
if [ "$1" = "start" ]; then | |
echo "Starting firewall..." |
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
/** | |
* Expose `Batch`. | |
*/ | |
module.exports = Batch; | |
/** | |
* Create a new Batch. | |
*/ |
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 app = require('../app'); | |
console.log(); | |
app.routes.all().forEach(function(route){ | |
console.log(' \033[90m%s \033[36m%s\033[0m', route.method.toUpperCase(), route.path); | |
}); | |
console.log(); | |
process.exit(); |
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 (name, definition) { | |
if (typeof define == 'function' && define.amd) define(name, definition) | |
else if (typeof module != 'undefined') module.exports = definition() | |
else this[name] = definition() | |
}('thing', function () { | |
// codes | |
return module | |
}) |
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
mongoose.Types.DocumentArray.prototype.sortByDir = function(direction, path) { | |
this.sort(function(a, b) { | |
var aVal = a.get(path), | |
bVal = b.get(path); | |
if (!aVal && !bVal) return 0; | |
if (!aVal) return 1; | |
if (!bVal) return -1; | |
if (direction > 0) return !(aVal < bVal); | |
return (aVal < bVal); | |
}); |
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 stitch = require('stitch'); | |
var express = require('express'); | |
options = { | |
paths : [__dirname + '/lib', __dirname + '/vendor'], | |
compilers: { | |
jade: function(module, filename) { | |
var jade = require('jade'); | |
var source = require('fs').readFileSync(filename, 'utf8'); |
A database where you PUT/POST documents to trigger replications and you DELETE to cancel ongoing replications. These documents have exactly the same content as the JSON objects we used to POST to /_replicate/ (fields "source", "target", "create_target", "continuous", "doc_ids", "filter", "query_params".
Replication documents can have a user defined "_id". Design documents (and _local documents) added to the replicator database are ignored.
The default name of this database is _replicator. The name can be changed in the .ini configuration, section [replicator], parameter db.