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
| ... | |
| /** | |
| * Routes | |
| */ | |
| app.use('/', require('./routers/main').router); | |
| app.use('/', require('./routers/auth').router); | |
| app.use('/', require('./routers/signup').router); | |
| app.use('/', require('./routers/charts').router); | |
| app.use('/plugin', require('./routers/plugin').router); |
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 waiter(){ | |
| var ready = false, | |
| food, | |
| cbs = []; | |
| var w = function(val){ | |
| food = val; | |
| ready = true; | |
| cbs.forEach(function(cb){ cb(food); }); | |
| }; |
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 util = require('util'); | |
| var path = require('path'); | |
| var chromesMinimumByteFix = " "; | |
| var server = http.createServer(function(req, res){ | |
| var pathParts = req.url.split('/'); | |
| pathParts.shift(); | |
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
| ReferenceError: module is not defined | |
| at IncomingMessage.anonymous (eval at <anonymous> (/usr/local/lib/node/.npm/ejs/0.3.0/package/lib/ejs/index.js:139:14)) | |
| at IncomingMessage.<anonymous> (/usr/local/lib/node/.npm/ejs/0.3.0/package/lib/ejs/index.js:141:19) | |
| at Object.render (/usr/local/lib/node/.npm/ejs/0.3.0/package/lib/ejs/index.js:176:13) | |
| at ServerResponse.render (/usr/local/lib/node/.npm/express/1.0.7/package/lib/express/view.js:334:22) | |
| at ServerResponse.partial (/usr/local/lib/node/.npm/express/1.0.7/package/lib/express/view.js:200:17) | |
| at Object.<anonymous> (/usr/local/lib/node/.npm/express/1.0.7/package/lib/express/view.js:311:25) | |
| at IncomingMessage.anonymous (eval at <anonymous> (/usr/local/lib/node/.npm/ejs/0.3.0/package/lib/ejs/index.js:139:14)) | |
| at IncomingMessage.<anonymous> (/usr/local/lib/node/.npm/ejs/0.3.0/package/lib/ejs/index.js:141:19) | |
| at Object.render (/usr/local/lib/node/.npm/ejs/0.3.0/package/lib/ejs/index.js:176: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
| $ npm update | |
| npm info it worked if it ends with ok | |
| npm info using npm@0.3.0-6 | |
| npm info using node@v0.4.0 | |
| npm info updates connect@0.5.10 resware@0.0.3 qs@0.0.6 | |
| npm info preupdate connect@0.5.10 | |
| npm info preupdate resware@0.0.3 | |
| npm info preupdate qs@0.0.6 | |
| npm ERR! gzip "--decompress" "--stdout" "/usr/local/lib/node/.npm/.cache/resware/0.0.3/package.tgz" | |
| npm ERR! gzip "--decompress" "--stdout" "/usr/local/lib/node/.npm/.cache/resware/0.0.3/package.tgz" gzip: /usr/local/lib/node/.npm/.cache/resware/0.0.3/package.tgz: unexpected end of file |
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
| # Run each statement separately, not all at once | |
| CREATE TABLE `posts` ( | |
| `post_id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, | |
| `user_id` int(10) unsigned NOT NULL DEFAULT '0', | |
| `date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', | |
| `active` tinyint(2) NOT NULL DEFAULT '0', | |
| PRIMARY KEY (`post_id`) | |
| ) ENGINE=InnoDB AUTO_INCREMENT=190 DEFAULT CHARSET=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
| $ node test.js | |
| 0.5961614400148392 | |
| 0.5961614400148392 |
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 mysql = require('mysql'); | |
| var db = new mysql.Client({ | |
| user: 'root', | |
| password: '', | |
| database: 'main' | |
| }); | |
| db.connect(); |
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 mysql = require('mysql'); | |
| var db = mysql.createClient({ | |
| user: 'root', | |
| password: 'password', | |
| database: 'db1' | |
| }); | |
| db.query("BEGIN"); // Start first transaction |
OlderNewer