I hereby claim:
- I am MatthaeusHarris on github.
- I am matthaeus (https://keybase.io/matthaeus) on keybase.
- I have a public key whose fingerprint is 5CA4 F9D3 FD31 452C 4586 F29D 6302 355C DC4F BDBA
To claim this, I am signing this object:
var LCD = {}; | |
LCD.connect = function(/*=SPI*/_spi, /*=PIN*/_dc, /*=PIN*/_ce, /*=PIN*/_rst, callback) { | |
var LCD = Graphics.createArrayBuffer(84,48,1,{vertical_byte:true}); | |
var spi = _spi; | |
var dc = _dc; | |
var ce = _ce; | |
var rst = _rst; | |
setTimeout(function() { | |
digitalWrite(dc,0); // cmd | |
digitalPulse(rst, 0, 10); // pulse reset low |
I hereby claim:
To claim this, I am signing this object:
// 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])); | |
} |
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]) | |
} | |
} |
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 |
#!/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 |
var a = [1, 2, 3, 4, 5]; | |
var b = function() { | |
if (null) { | |
var a = [1, 2, 3]; | |
} | |
console.log(a); | |
} | |
console.log(a); | |
b(); |
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; | |
}); |
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); |
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; |