Skip to content

Instantly share code, notes, and snippets.

View thelinuxlich's full-sized avatar
🐉
Here be dragons

Alisson Cavalcante Agiani thelinuxlich

🐉
Here be dragons
View GitHub Profile
@thelinuxlich
thelinuxlich / subl.json
Created June 23, 2015 18:41
Sublime User settings
{
"always_show_minimap_viewport": true,
"color_scheme": "Packages/Material Theme/schemes/Material-Theme.tmTheme",
"font_face": "Source Code Pro Light",
"font_size": 10,
"highlight_line": true,
"ignored_packages":
[
"Markdown",
"Vintage"
@thelinuxlich
thelinuxlich / client.js
Created June 2, 2015 19:21
axon_client
"use strict";
const axon = require("axon"),
rep = axon.socket("rep");
rep.connect("tcp://127.0.0.1:7000");
rep.on("message", function(msg, reply) {
reply("OK");
console.log(msg);
@thelinuxlich
thelinuxlich / axon.js
Created June 2, 2015 19:20
axon_server
"use strict";
const axon = require("axon"),
req = axon.socket("req");
req.bind("tcp://127.0.0.1:7000");
let count = 1;
const makeid = function() {
let text = "";
@thelinuxlich
thelinuxlich / client.js
Created June 2, 2015 18:47
Client impl
"use strict";
const nano = require("nanomsg"),
rep = nano.socket("rep");
rep.connect("tcp://127.0.0.1:7000");
rep.on("message", function(buf) {
console.log(buf.toString());
});
@thelinuxlich
thelinuxlich / server.js
Created June 2, 2015 18:46
Server impl
"use strict";
const nano = require("nanomsg"),
req = nano.socket("req", {
reconn: 10,
linger: 1
});
req.bind("tcp://127.0.0.1:7000");
let count = 1;
@thelinuxlich
thelinuxlich / timeout.js
Created June 1, 2015 21:50
Timeout test for nanomsg
"use strict";
const nano = require("nanomsg"),
req = nano.socket("req", {
reconn: 1,
maxreconn: 2,
sndtimeo: 1,
linger: 1,
rcvtimeo: 1
});
"use strict";
const nano = require("nanomsg"),
req = nano.socket("rep");
req.connect("tcp://127.0.0.1:7000");
req.on("message", function(buf) {
console.log(buf.toString());
});
"use strict";
const nano = require("nanomsg"),
req = nano.socket("req");
req.bind("tcp://127.0.0.1:7000");
let count = 1;
var timer = setInterval(function() {
@thelinuxlich
thelinuxlich / bench.js
Last active August 29, 2015 14:22 — forked from yyx990803/bench.js
// vue internals
var _ = require('../util')
var Path = require('../parsers/path')
// original implementation using native sort
var original = function (arr, sortKey, reverse) {
if (!sortKey) {
return arr
}
var order = 1
ioredis:redis write command[0] -> multi() +2s
ioredis:redis write command[0] -> lrange(processing_batch:pageviews,0,99) +0ms
ioredis:redis write command[0] -> ltrim(processing_batch:pageviews,100,-1) +0ms
ioredis:redis write command[0] -> exec() +0ms
ioredis:redis write command[0] -> multi() +0ms
ioredis:redis write command[0] -> lrange(processing_batch:devices,0,99) +0ms
ioredis:redis write command[0] -> ltrim(processing_batch:devices,100,-1) +0ms
ioredis:redis write command[0] -> exec() +0ms
ioredis:redis write command[0] -> multi() +0ms
ioredis:redis write command[0] -> lrange(processing_batch:events,0,99) +0ms