Skip to content

Instantly share code, notes, and snippets.

View tylerlong's full-sized avatar

Tyler Liu tylerlong

View GitHub Profile
@tylerlong
tylerlong / index.js
Created December 27, 2018 01:14
RingCentral call control API PubNub to get sessionId and partyId
import RingCentral from 'ringcentral-js-concise'
import PubNub from 'ringcentral-js-concise/src/pubnub.es5'
import delay from 'timeout-as-promise'
const rc = new RingCentral(
process.env.RINGCENTRAL_CLIENT_ID,
process.env.RINGCENTRAL_CLIENT_SECRET,
process.env.RINGCENTRAL_SERVER_URL
)
@tylerlong
tylerlong / index.js
Created December 6, 2018 07:50
PubNub incoming call demo
import RingCentral from 'ringcentral-js-concise'
import PubNub from 'ringcentral-js-concise/src/pubnub.es5'
import delay from 'timeout-as-promise'
const rc = new RingCentral(
process.env.RINGCENTRAL_CLIENT_ID,
process.env.RINGCENTRAL_CLIENT_SECRET,
process.env.RINGCENTRAL_SERVER_URL
)
@tylerlong
tylerlong / Result.md
Last active November 22, 2018 04:11
update device emergency address
updating device 803480313004
{ uri:
   'http://api-xmnup.lab.nordigy.ru/restapi/v1.0/account/225033004/device/803480313004',
  id: '803480313004',
  type: 'HardPhone',
  sku: 'HP-52',
  model: { id: '52', name: 'Cisco SPA-122 ATA', addons: [] },
  name: 'Phone',
  serial: 'HELL803480313004-225033004',
@tylerlong
tylerlong / README.md
Last active January 19, 2022 16:05
Why is SubX more developer-friendly than Redux & MobX?

Why is SubX more developer-friendly than Redux & MobX?

First of all, what is SubX?

SubX, Subject X, Reactive Subject. Pronunciation: [Sub X]

SubX is next generation state container. It could replace Redux and MobX in our React apps.

Features of SubX

@tylerlong
tylerlong / index.js
Last active February 7, 2018 07:58
My awesome bot
const RingCentral = require('ringcentral')
const dotenv = require('dotenv')
dotenv.config()
const token = JSON.parse(process.env.token)
const rc = new RingCentral({
server: RingCentral.server.sandbox,
appKey: '',
appSecret: ''
})
@tylerlong
tylerlong / callcenter.xml
Created August 26, 2017 02:07
Salesforce Open CTI RingCentral integration
<callCenter>
<section sortOrder="0" name="reqGeneralInfo" label="General Information">
<item sortOrder="0" name="reqInternalName" label="Internal Name">RingCentralAdapterOpenCTI</item>
<item sortOrder="1" name="reqDisplayName" label="Display Name">RingCentral Call Center Adapter Open CTI</item>
<item sortOrder="2" name="reqAdapterUrl" label="CTI Adapter URL">/apex/RCPhone</item>
<item sortOrder="3" name="reqUseApi" label="Use CTI API">true</item>
<item sortOrder="4" name="reqSoftphoneHeight" label="Softphone Height">550</item>
<item sortOrder="5" name="reqSoftphoneWidth" label="Softphone Width">300</item>
<item sortOrder="6" name="reqSalesforceCompatibilityMode" label="Salesforce Compatibility Mode">Lightning</item>
</section>
@tylerlong
tylerlong / README.md
Last active June 29, 2017 12:04
List filter & map performance comparision

Environment

  • Node v8.1.2
  • macOS 10.12.5
  • MacBook Pro (Retina, 15-inch, Mid 2015)

Speed (faster come first)

Ramda > Lodash > reduce > filter > for

@tylerlong
tylerlong / README.md
Last active March 7, 2017 08:06
岭兜二里退房
  • 押金 3000

  • 物业费 11月8号 - 3月7号 共 4 个月,每月 47.5 元, 共 190

  • 电费 已通过支付宝生活缴费缴清3月份之前的,本月 1-7 号酌情给 20

  • 水费 支付宝生活缴费最近几个月一直显示未欠费

  • 煤气费 支付宝生活缴费一开始两个月显示未欠费,后来显示的数额比较大,相当之前半年多的费用。

故对以上水费、煤气费另外计算。

  • 上一次抄表是11月10号,水表 0009, 煤气表 269.5
@tylerlong
tylerlong / passed.json
Created February 22, 2017 05:53
Travis sample payloads
{
"payload": "{\"id\":201403814,\"repository\":{\"id\":12072164,\"name\":\"travis-webhook-demo\",\"owner_name\":\"tylerlong\",\"url\":null},\"number\":\"5\",\"config\":{\"language\":\"node_js\",\"node_js\":[\"7.5\"],\"notifications\":{\"webhooks\":{\"urls\":[\"http://devproxy-public.asialab.glip.net/webhook-tyler.liu/ea7f2d9e-91a1-4ae4-bd9b-1737c39908ec\"],\"on_success\":\"always\",\"on_failure\":\"always\",\"on_start\":\"always\"}},\".result\":\"configured\",\"group\":\"stable\",\"dist\":\"precise\"},\"status\":0,\"result\":0,\"status_message\":\"Passed\",\"result_message\":\"Passed\",\"started_at\":\"2017-02-14T05:55:49Z\",\"finished_at\":\"2017-02-14T05:56:19Z\",\"duration\":30,\"build_url\":\"https://travis-ci.org/tylerlong/travis-webhook-demo/builds/201403814\",\"commit_id\":57662095,\"commit\":\"7a079a2999a54981d1e5ba4c668a90441234da2f\",\"base_commit\":null,\"head_commit\":null,\"branch\":\"master\",\"message\":\"Add one more test case\",\"compare_url\":\"https://github.com/tylerlong/travis-webhook
@tylerlong
tylerlong / reamde.md
Last active March 2, 2017 01:29
校招讲座

Topic

聊天机器人(Chatbot)简介。Chatbot 无疑是当前非常火的一个研究领域和产品方向。Chatbot 是场交互革命,也是一个多技术融合的平台。 Chatbot 从形式上讲是电脑程序利用人工智能去和人类对话。其最原始的形式是电脑和人类通过文字进行交互。借助语音识别和文字转语音服务,可以实现类似真人之间的语言交互效果。Chatbot 的输入形式基本上是文字或者语音,输出形式却可以多种多样,比如文字、语音、图片、视频等等。

Chatbot 技术方兴未艾,Apple 公司的 Siri,Microsoft 公司的小冰,Amazon 的 Echo,谷歌公司前不久收购了api.ai……国际巨头纷纷在这一领域布局。另外一家不得不提的公司是 Slack,这家公司在成立不到一年的时候估值已经超过了30亿,众多第三方公司围绕 Slack 打造了一个 Chatbot 生态。种种迹象表明,Chatbot 技术绝对是未来 5 到 10 年最值得投资的技术。

Lectuer