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 bot = new irc.Client('irc.freenode.net', 'nick', { | |
| debug: false, | |
| channels: [ channel ], | |
| floodProtection: true | |
| }); |
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
| // CreativeMUD by whiskers75 | |
| // Licenced under the GPLv2. | |
| var sockets = []; | |
| var players = []; | |
| var repl = require('repl'); | |
| var net = require('net'); | |
| var len = 0; |
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
| function readfile(callback) { | |
| // read your file here | |
| filedata = nonexistantmethod(filename); | |
| callback(filedata); | |
| } |
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 http = require('http'); | |
| var express = require('express'); | |
| var ejs = require('ejs'); | |
| var app = express(); | |
| app.set('view engine', 'ejs'); | |
| app.use(express.bodyParser()); | |
| app.get('/', function(req, res) { |
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
| /* Consumer.js */ | |
| var Consumer = function() {}; | |
| Consumer.prototype.findById = function(id) { | |
| this.emit('done', this); | |
| }; | |
| util.inherits(Consumer, EventEmitter); | |
| module.exports = Consumer; | |
| /* index.js */ |
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
| 3093) Later.dayOfYear prev should return first date before Mon Sep 04 2017 10:31:22 GMT+1000 (EST) with val 264: | |
| actual expected | |
| truefalse | |
| at Object.Assertion.eql (/tmp/later/node_modules/should/lib/should.js:285:10) | |
| at Context.<anonymous> (/tmp/later/test/constraint/runner.js:99:45) | |
| at Test.Runnable.run (/tmp/later/node_modules/mocha/lib/runnable.js:211:32) | |
| at Runner.runTest (/tmp/later/node_modules/mocha/lib/runner.js:355:10) |
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
| app.get('/reset/:token', function(req, res) { | |
| var token = req.params.token; | |
| // check token is valid and render reset page | |
| }); |
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
| ➜ /tmp npm install gender | |
| npm http GET https://registry.npmjs.org/gender | |
| npm http 200 https://registry.npmjs.org/gender | |
| npm http GET https://registry.npmjs.org/gender/-/gender-0.0.1.tgz | |
| npm http 200 https://registry.npmjs.org/gender/-/gender-0.0.1.tgz | |
| gender@0.0.1 node_modules/gender | |
| ➜ /tmp node | |
| > require('gender')('adam') | |
| Error: Unknown encoding | |
| at Buffer.toString (buffer.js:440:13) |
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
| ➜ ~ echo "console.log(__dirname)" > /tmp/hello.js | |
| ➜ ~ node /tmp/hello.js | |
| /tmp | |
| ➜ ~ mkdir /tmp/lol | |
| ➜ ~ echo "require('../hello')" > /tmp/lol/hello.js | |
| ➜ ~ node /tmp/lol/hello.js | |
| /tmp |
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 i = { | |
| num: 1, | |
| valueOf: function() { | |
| return this.num++; | |
| } | |
| } | |
| undefined | |
| > i == 1 && i == 2 && i == 3 | |
| true |
OlderNewer