Skip to content

Instantly share code, notes, and snippets.

@yunnysunny
yunnysunny / zeromq-vs-redis.md
Created November 30, 2017 04:17 — forked from hmartiro/zeromq-vs-redis.md
Comparison of ZeroMQ and Redis for a robot control platform

ZeroMQ vs Redis

This document is research for the selection of a communication platform for robot-net.

Goal

The purpose of this component is to enable rapid, reliable, and elegant communication between the various nodes of the network, including controllers, sensors, and actuators (robot drivers). It will act as the core of robot-net to create a standardized infrastructure for robot control.

Requirements:

@yunnysunny
yunnysunny / reconnect.js
Created October 30, 2017 06:05 — forked from carlhoerberg/reconnect.js
How to build reconnect logic for amqplib
var amqp = require('amqplib/callback_api');
// if the connection is closed or fails to be established at all, we will reconnect
var amqpConn = null;
function start() {
amqp.connect(process.env.CLOUDAMQP_URL + "?heartbeat=60", function(err, conn) {
if (err) {
console.error("[AMQP]", err.message);
return setTimeout(start, 1000);
}
@yunnysunny
yunnysunny / index.html
Created June 1, 2016 14:15 — forked from anonymous/index.html
New Document // source http://jsbin.com/kobakih
<!doctype html>
<html lang="zh-CN">
<head>
<title> New Document </title>
<meta name="Generator" content="NPP-Plugin">
<meta name="Author" content="">
<meta name="Keywords" content="">
<meta name="Description" content="">
<style type="text/css">
*{
// sets globals __line, __file, __ext, __dir
// copied and tweaked from: http://goo.gl/wwjGVV and http://goo.gl/umq4s1
// todo: __function and __method?
// begin setting magic properties into global
Object.defineProperty(global, '__stack', {
get: function(){
var orig = Error.prepareStackTrace;
Error.prepareStackTrace = function(_, stack){ return stack; };
var err = new Error;