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
/** | |
* This code is licensed under the terms of the MIT license | |
* | |
* Deep diff between two object, using lodash | |
* @param {Object} object Object compared | |
* @param {Object} base Object to compare with | |
* @return {Object} Return a new object who represent the diff | |
*/ | |
function difference(object, base) { | |
function changes(object, base) { |
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 WebSocket = require('ws'); | |
var Protocol = require('pomelo-protocol'); | |
var Package = Protocol.Package; | |
var Message = Protocol.Message; | |
var EventEmitter = require('events').EventEmitter; | |
var protobuf = require('pomelo-protobuf'); | |
var util = require('util'); | |
var thunkify = require("thunkify"); | |
var JS_WS_CLIENT_TYPE = 'js-websocket'; | |
var JS_WS_CLIENT_VERSION = '0.0.1'; |
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
## vim /etc/X11/xorg.conf and add | |
Section "ServerFlags" | |
Option "BlankTime" "0" | |
Option "StandbyTime" "0" | |
Option "SuspendTime" "0" | |
Option "OffTime" "0" | |
Option "DontZap" "false" | |
Option "dpms" "false" | |
EndSection |
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 int2ip (ipInt) { | |
return ( (ipInt>>>24) +'.' + (ipInt>>16 & 255) +'.' + (ipInt>>8 & 255) +'.' + (ipInt & 255) ); | |
} |
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 node | |
"use strict"; | |
var debug = require('_debugger'); | |
var c = new debug.Client(); | |
function main() { | |
console.log('requesting trace'); | |
c.reqBacktrace(function(err,trace) { | |
if (!err) { |
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
#include <vector> | |
#include <assert.h> | |
#include <stdio.h> | |
#include <stdint.h> | |
#include <stdlib.h> | |
typedef int32_t Score; | |
typedef int32_t UserId; | |
typedef int32_t Rank; | |
const Score kInvalidScore = -1; |
NewerOlder