This file contains 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
{ | |
"webhosts": { | |
"example.com": { | |
"aliases": ["www.example.com"], | |
"docroot": "/var/www/example.com", | |
"ports": [80,443] | |
}, | |
"foo.example.com": { | |
"aliases": ["www.foo.example.com"], | |
"docroot": "/var/www/foo.example.com", |
This file contains 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
#!/bin/bash | |
for f in $(find jpm/cloud0/ -type f) | |
do | |
if [ -e `echo $f | sed 's/^jpm\/cloud0/jpm\/cloud1/'` ] | |
then | |
#echo "Testing $f" >&2 | |
diff $f `echo $f | sed 's/^jpm\/cloud0/jpm\/cloud1/'` | |
fi | |
done |
This file contains 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'); | |
var events = require('events'); | |
function JSONBuffer(sock) { | |
if (false === this instanceof JSONBuffer) { | |
return new JSONBuffer(); | |
} | |
events.EventEmitter.call(this); | |
this.sock = sock; |
This file contains 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 logger() { | |
if (false === (this instanceof logger)) { | |
return new logger(); | |
} else { | |
var logString = process.env.FQDEBUG || ""; | |
logLevels = logString.split(','); | |
for (var l in logLevels) { | |
this.logLevel[logLevels[l]] = true; | |
} | |
console.log(this.logLevel); |
This file contains 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("/gamevil/privacy", function(req, res) { | |
if (cache.privacy && cache.privacy.timestamp > moment().unix() - 3600) { | |
res.end(cache.privacy.data); | |
} else { | |
cache.privacy = {"timestamp": moment().unix()}; | |
http.get("http://us.gamevil.com/news.php?m=policy", function(r) { | |
var page = ""; | |
r.on('data', function(chunk) { | |
page += chunk; | |
}); |
This file contains 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 a = [1, 2, 3, 4, 5]; | |
var b = function() { | |
if (null) { | |
var a = [1, 2, 3]; | |
} | |
console.log(a); | |
} | |
console.log(a); | |
b(); |
This file contains 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
#!/usr/bin/env ruby | |
# Tweakable knobs | |
# Which statuses constitute a success? | |
acceptable_statuses = ["200", "404", "403"] | |
# How much past history do we consider for each run, in seconds? | |
history = 60 |
This file contains 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
Assuming a log file of entries like: | |
============================================================ | |
user_id = SIEZYTIEROGHEC4BCXYU9A | |
request_id = 5c119b8a-73f5-4e98-86ce-f6755c60d256 | |
operation = GET | |
request_timestamp = 1402072887926 | |
key = path/to/my/object | |
response = 200 | |
bytes = 34591 |
This file contains 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 eventAccumulator = function(event, eventsList, queue, callback) { | |
// logger.log("arena","eventAccumulator(%s,%s,%s,callback)",event, JSON.stringify(eventsList), JSON.stringify(queue)); | |
logger.log("arena","eventAccumulator queue: " + queue + " event: " + event); | |
if (typeof eventAccumulator[queue] === 'undefined' || typeof eventAccumulator[queue].eventList === 'undefined') { | |
eventAccumulator[queue] = {}; | |
eventAccumulator[queue].eventList = []; | |
for (var i in eventsList) { | |
eventAccumulator[queue].eventList.push(eventsList[i]) | |
} | |
} |
This file contains 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
// Set up the event accumulator to fire when all users have been saved. | |
var arenaStartEvents = []; | |
for (var p in this.players) { | |
arenaStartEvents.push(this.players[p].userID); | |
this.players[p].on('leaveArena', (function(arena, player) { | |
return (function() { | |
arena.playerLeftArenaInProgress(player); | |
}); | |
})(this, this.players[p])); | |
} |
OlderNewer