Skip to content

Instantly share code, notes, and snippets.

//npm install ioredis
//npm install bluebird
//change endpoint to any two of your clusters
var Redis = require('ioredis');
var Promise = require('bluebird');
var cluster = new Redis.Cluster([{
port: 30001,
host: '127.0.0.1'
}, {

mwaysolutions

{
  "errors": [
   {
    "userMessage": "Sorry, the requested resource does not exist",
    "internalMessage": "No car found in the database",
    "code": 34,
    "more info": "http://dev.mwaysolutions.com/blog/api/v1/errors/12345"
   }
/**
* New Relic agent configuration.
*
* See lib/config.defaults.js in the agent distribution for a more complete
* description of configuration variables and their potential values.
*/
exports.config = {
/**
* Array of application names.
*/
{
"id": "55bab768822e034a7945a3ee",
"created_at": "2015-07-30T23:46:48+00:00",
"updated_at": "2015-07-30T23:46:55+00:00",
"last_updated_at": "2015-07-30T23:46:55+00:00",
"tracking_number": "9505510977185211034638",
"slug": "usps",
"active": true,
"android": [
"APA91bGpwXA4hCvKy0qghtSIVF9V5OgwXkDGK-Ds0ClZIeqUS2BVWhdk5HIsue9gMXucDd2RM3ltmTDoVzxKVX5j-bspnldkr3IG-V0Je2OB5xpGyM81t6XyYEQjLQ_3luLrRyq7uS4Z"
'use strict';
var Number = require("./index");
var DBS = require('@aftership/postmen-datastorage').dbs;
var RedisCache = require('@aftership/postmen-datastorage').adaptor.redis;
var Dynamodb = require('@aftership/postmen-datastorage').adaptor.dynamodb;
DBS.configStore("number", {
db: new Dynamodb({
region: 'ap-northeast-1',

class: center, middle

Title


Agenda

  1. Introduction
  2. Deep-dive

class: left

Title

var redis = require("redis");
var mongo = require("mongodb");

class DataStore {		
	constructor(){

Top 10 javascript developer in HK rated by activities

SELECT actor_attributes_email, count(*) as cnt
FROM [githubarchive:github.timeline]
where actor_attributes_location like "%Hong%" and repository_language = "JavaScript"
group by actor_attributes_email
order by cnt desc
LIMIT 10;
'use strict';
const co = require("./co.js");
const co_nothrow = require("./co-nothrow");
var boom = ()=> {
return new Promise((resolve, reject)=>{
setTimeout(()=>{
reject("boom");
}, 1000);
'use strict';
const util = require("util");
let foo = {};
let bar = {};
foo.ref = bar;
bar.ref = foo;
console.log(JSON.stringify(foo));