using mocha/chai/sinon for node.js unit-tests? check out my utility: mocha-stirrer to easily reuse test components and mock require dependencies
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 server = require('net').createServer(); | |
| server.listen(5000, function() { | |
| console.log('Telnet server running on port', server.address().port); | |
| }); | |
| server.on('connection', function(socket) { | |
| console.log('connected.') | |
| socket.setEncoding('utf8'); |
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 _ = require('underscore'), | |
| util = require('util'); | |
| // intercept stdout, passes thru callback | |
| // also pass console.error thru stdout so it goes to callback too | |
| // (stdout.write and stderr.write are both refs to the same stream.write function) | |
| // returns an unhook() function, call when done intercepting | |
| module.exports = function interceptStdout(callback) { | |
| var old_stdout_write = process.stdout.write, | |
| old_console_error = console.error; |
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 _ = require('underscore'), | |
| util = require('util'); | |
| // intercept stdout, passes thru callback | |
| // also pass console.error thru stdout so it goes to callback too | |
| // (stdout.write and stderr.write are both refs to the same stream.write function) | |
| // returns an unhook() function, call when done intercepting | |
| module.exports = function interceptStdout(callback) { | |
| var old_stdout_write = process.stdout.write, | |
| old_console_error = console.error; |
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 _ = require('lodash'), | |
| util = require('util'); | |
| // intercept stdout, passes thru callback | |
| // also pass console.error thru stdout so it goes to callback too | |
| // (stdout.write and stderr.write are both refs to the same stream.write function) | |
| // returns an unhook() function, call when done intercepting | |
| module.exports = function interceptStdout(callback) { | |
| var old_stdout_write = process.stdout.write, | |
| old_console_error = console.error; |
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 server = require('net').createServer(); | |
| server.listen(5000, function() { | |
| console.log('Telnet server running on port', server.address().port); | |
| }); | |
| server.on('connection', function(socket) { | |
| // pipe logs to telnet for the duration of connection | |
| var unhookStdout = require('./intercept-stdout')(function intercept(string){ | |
| socket.write(string); |
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
| <!DOCTYPE html> | |
| <html lang="en"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
| <meta http-equiv="X-UA-Compatible" content="ie=edge"> | |
| <title>Document</title> | |
| </head> | |
| <body> | |
| <form id="form"> |
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
| <!DOCTYPE html> | |
| <!-- | |
| Created using JS Bin | |
| http://jsbin.com | |
| Copyright (c) 2017 by anonymous (http://jsbin.com/xemiqelalu/1/edit) | |
| Released under the MIT license: http://jsbin.mit-license.org | |
| --> | |
| <meta name="robots" content="noindex"> |
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
| /* | |
| PoC WhatsApp enumeration of phonenumbers, profile pics, about texts and online statuses | |
| Floated div edition | |
| 01-05-2017 | |
| (c) 2017 - Loran Kloeze - loran@ralon.nl | |
| This script creates a UI on top of the WhatsApp Web interface. It enumerates certain kinds | |
| of information from a range of phonenumbers. It doesn't matter if these numbers are part | |
| of your contact list. At the end a table is displayed containing phonenumbers, profile pics, | |
| about texts and online statuses. The online statuses are being updated every |
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
| <template> | |
| <div> | |
| <md-pagination md-pages="6" md-active-page.bind="activePage"></md-pagination> | |
| </div> | |
| <div> | |
| active page: ${activePage} | |
| </div> | |
| </template> |
NewerOlder