A Pen by Jasper Chang on CodePen.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function () { | |
const XHR = window.XMLHttpRequest; | |
function newXHR () { | |
var xhr = new XHR(); | |
xhr.addEventListener("readystatechange", () => { | |
if (xhr.readyState === 4) { | |
var originalResponse = JSON.parse(xhr.responseText); // store first | |
Object.defineProperty(xhr, "responseText", { writable: true }); // make it writable, careful it will also clear it |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Client { | |
/** | |
* constructor | |
* @param host | |
* @param port | |
*/ | |
constructor (host, port) { | |
this.io = null; | |
this.socket = null; | |
this.config = { host, port } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Implement hex2bin and bin2hex in JavaScript | |
* https://gist.github.com/jasperck | |
* | |
* Copyright 2017, JasperChang <[email protected]> | |
* Licensed under The MIT License | |
* http://www.opensource.org/licenses/mit-license | |
*/ | |
const hex2bin = str => str.match(/.{1,2}/g).reduce((str, hex) => str += String.fromCharCode(parseInt(hex, 16)), ''); |
主要講這家公司怎麼串接一堆 google cloud service 來打造一個 logger 加值應用服務,前因後果:
該公司一部份本業在開發 hybrid app,他們有一套 app 更新日誌的機制放在 google cloud,所以串了一個
bucket -> (定時生)access log -> (pub/sub) -> app engine -> data flow -> big query / visualization / etc 的流程,
主要強調這不僅讓他的 RD 練功,業務有武器去打仗,也讓客戶相信他們是熟悉 GCP 的公司,
雖然 ... speaker demo 的 POC 和架構在後面第三場 session 被 Google speaker 吐槽到不行...