Skip to content

Instantly share code, notes, and snippets.

View chenghaoc's full-sized avatar
🌴
On vacation

Howard chenghaoc

🌴
On vacation
  • Stockholm, Sweden
View GitHub Profile
@chenghaoc
chenghaoc / SketchSystems.spec
Created February 28, 2019 12:32
My Awesome Sketch
My Awesome Sketch
First State
some event -> Second State
Second State
another event -> First State
// For browser not complete support ES6, should transpile to ES5 using Babel
function flatten(input, output = []) {
if (Array.isArray(input)) {
input.forEach(ele => {
if (Array.isArray(ele)) {
flatten(ele, output)
} else {
output.push(ele)
}
@chenghaoc
chenghaoc / gist:74f99ee50eb714e60a6dd60dfa399d44
Created June 27, 2016 02:46
Ringcentral-web-phone with CommonJS module bundler
var RingCentral = require('ringcentral')
var WebPhone = require('ringcentral-web-phone')
var appKey = '...';
var appSecret = '...';
var appName = '...';
var appVersion = '...';
var sdk = new RingCentral({
appKey: appKey,
appSecret: appSecret,