Skip to content

Instantly share code, notes, and snippets.

View tpai's full-sized avatar
🌴
On vacation in Spain

Tony Pai tpai

🌴
On vacation in Spain
View GitHub Profile
@tpai
tpai / 0.output.js
Last active December 12, 2017 12:57
webpack bundle analyze 3
webpackJsonp([0],[,,,,,
/* ./chunk.js */,
/* ./style2.css */,
/* (webpack)/node_modules/css-loader!./style2.css */,
/* ./image2.png */
]);
@tpai
tpai / interviews.md
Last active November 6, 2019 04:23
2017 interviews

Taroko Software

Team Member、技術含量、公司產品、背景、未來計畫、人員組成、周邊環境、面試流程、相關人員積極度以及 Package 都達標,沒什麼好說的了。

  • 12/12 HR 來信
  • 12/13 Onsite RD => CTO
  • 12/14 Offer 當天回信接受

Codementor

@tpai
tpai / reduce.js
Last active September 25, 2017 04:52
polyfill
var reducePolyfill = function(callback) {
var k = [], key, t = this;
for(key in t) {
if (hasOwnProperty.call(t, key)) {
k.push(key);
}
}
var isArray = Object.prototype.toString.call(t) === '[object Array]';
var len = k.length >>> 0;
var argLen = arguments.length;
@tpai
tpai / references.md
Last active September 21, 2017 10:44
reselect quick implementation
@tpai
tpai / output.js
Last active September 20, 2017 15:37
webpack bundle analyze 2
((function(modules) {
__webpack_require__.e = function requireEnsure(chunkId) {/* ... */}
__webpack_require__.d = function(exports, name, getter) {/* ... */}
__webpack_require__.n = function(module) {/* ... */}
__webpack_require__.o = function(object, property) {/* ... */}
})([ /* ... */,
(function(module, exports, __webpack_require__) {
var map = {/* ... */};
function webpackAsyncContext(req) {/* ... */}
module.exports = webpackAsyncContext;
@tpai
tpai / vendor.js
Last active September 20, 2017 04:35
webpack bundle analyze
((function(modules) {
window["webpackJsonp"] = function webpackJsonpCallback(chunkIds, moreModules, executeModules) { /* ... */ }
var installedModules = {};
var installedChunks = {4: 0};
function __webpack_require__(moduleId) { /* ... */ }
return __webpack_require__(__webpack_require__.s = 2);
})([ /* ... */ ]);
@tpai
tpai / formula.js
Last active September 14, 2017 03:56
Common formula
function factorial(m) {
return m <= 1 ? m : m * factorial(m - 1);
}
function fibonacci(n) {
return n < 2 ? n : fibonacci(n - 1) + fibonacci(n - 2);
}
function prime(p) {
return p >= 1 ? isPrime(p) ? prime(--p).concat([p + 1]) : prime(--p) : [];
@tpai
tpai / solution.md
Last active February 24, 2023 06:03
facebook plugin init error: init not called with valid version

Solution

js.src = "//connect.facebook.net/zh_TW/all.js";

instead of

js.src = "//connect.facebook.net/zh_TW/sdk.js";

Causing

@tpai
tpai / og.md
Last active September 6, 2017 09:17
og protocol

Scenario

Sometimes, facebook url debugger can not crawl exact meta data from the code like below and LINE neither.

<head>
  <meta httpEquiv="Content-Type" content="text/html; charset=utf-8" />
  <title>Page Title</title>
  <!-- massive inline CSS style -->
  <style>...</style>