This file contains hidden or 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@server:~$ traceroute 192.81.210.154 | |
| traceroute to 192.81.210.154 (192.81.210.154), 30 hops max, 60 byte packets | |
| 1 192.168.252.2 (192.168.252.2) 0.184 ms 0.056 ms 0.065 ms | |
| 2 * * * | |
| 3 * * * | |
| 4 * * * | |
| 5 * * * | |
| 6 * * * | |
| 7 * * * | |
| 8 * * * |
This file contains hidden or 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 async = require('async'); | |
| var collections = {}; | |
| collections.model1 = require('../model/model1'); | |
| collections.model2 = require('../model/model2'); | |
| // .. infinitamente quantos desejar | |
| var filtro = function(collection, callback){ | |
| collections[collection].count().exec(function(err, count){ | |
| if(err) | |
| return callback(err); |
This file contains hidden or 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 parametro = 'ID da categoria'; | |
| this.find({}).populate({ | |
| path : 'grpcategoria', | |
| match : { | |
| _id : parametro | |
| } | |
| }).exec(function(err, docs){ | |
| console.log(err, docs); | |
| }); |
This file contains hidden or 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
| <?php | |
| function mongo(){ | |
| $connection = "mongodb://mongo1:27017,mongo2:27017"; | |
| //$connection = null; | |
| return new MongoClient($connection, [ | |
| "replicaSet" => "nodeware", | |
| "w" => 0, | |
| "journal" => false |
This file contains hidden or 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 net = require('net'); | |
| var server = net.createConnection(99, 'localhost'); //modificar a porta e o host | |
| var filePath = __dirname + '/read.json'; //caminho do arquivo a ser lido, o arquivo precisa existir | |
| var file = require('fs').createReadStream(filePath); | |
| server.on('connect', function(socket) { | |
| file.pipe(server); | |
| }); |
This file contains hidden or 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 price = -1; | |
| var userId = 'some user provided value'; | |
| var sql = 'SELECT max(price) FROM users WHERE id = ' + connection.escape(userId); | |
| server = http.createServer(function (request, response) { | |
| handler(request); //response depend on price | |
| }); | |
| connection.query(sql, function(err, results) { | |
| price = results.price; |
This file contains hidden or 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
| modal('show'); | |
| setTimeout(function(){ | |
| ....replot() | |
| }, 2000) |
This file contains hidden or 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
| <div class="modal-dialog" style="width: 800px"> |
This file contains hidden or 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
| :reg + | |
| --- Registers --- | |
| "+ has("gui_running") | |
| Press ENTER or type command to continue |
This file contains hidden or 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 cheerio = require('cheerio'); | |
| var request = require('request'); | |
| request.get('http://gshow.globo.com/programas/na-moral/videos/feed.atom', function(err, headers, body){ | |
| if(err) | |
| throw err; | |
| if(headers.statusCode !== 200) | |
| throw new Error('Resposta não OK.'); |