$ git clone https://github.com/google/flatbuffers.git
$ cd flatbuffers
$ cmake -G "Unix Makefiles"
$ make
$ ./flattests # this is quick, and should print "ALL TESTS PASSED"
$ sudo make install #install
$ sudo ldconfig #Configuring a dynamic link library
$ flatc --version #Check if FlatBuffers is installed successfully
- Install Xcode (Avaliable on the Mac App Store)
- Install Xcode Command Line Tools (Preferences > Downloads)
- Install depot_tools
git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git
sudo nano ~/.bash_profile
- Add
export PATH=/path/to/depot_tools:"$PATH"
(it's important that depot_tools comes first here)
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
Per https://code.google.com/p/v8/codesearch#v8/trunk/src/runtime.cc | |
%CreateSymbol | |
%CreatePrivateSymbol | |
%CreateGlobalPrivateSymbol | |
%NewSymbolWrapper | |
%SymbolDescription | |
%SymbolRegistry | |
%SymbolIsPrivate |
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 os = require("os"); | |
//Create function to get CPU information | |
function cpuAverage() { | |
//Initialise sum of idle and time of cores and fetch CPU info | |
var totalIdle = 0, totalTick = 0; | |
var cpus = os.cpus(); | |
//Loop through CPU cores |
using mocha/chai/sinon for node.js unit-tests? check out my utility: mocha-stirrer to easily reuse test components and mock require dependencies
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
const router = [{ | |
path: '*', | |
method: '*', | |
handle: function(req, res) { | |
res.writeHead(200, {'Content-Type': 'text/plain'}); | |
res.end('404'); | |
} | |
}]; |
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
listen(port, cb) { | |
const server = http.createServer((req, res) => { | |
res.statusCode = 200; | |
res.setHeader("Content-Type", "text/plain"); | |
res.end("Hello World\n"); | |
}); | |
return server.listen.apply(server, arguments); | |
} |
NewerOlder