Skip to content

Instantly share code, notes, and snippets.

View dreamofabear's full-sized avatar

William Chou dreamofabear

View GitHub Profile
@dreamofabear
dreamofabear / gist:9d91834ce633ac1dd2f3dc969d67cc7c
Created March 15, 2019 23:02
Preact browser test results @ 0c8984b
willchou$ npm run test:workerdom
> preact@10.0.0-alpha.1 test:workerdom /Users/willchou/preact
> mocha --recursive --require babel-register test/browser
cloneElement
✓ should clone components
✓ should merge new props
@dreamofabear
dreamofabear / gist:d44d5291ddddbcbe824349abceacf319
Created March 1, 2019 20:11
preact test/browser on worker-dom
willchou$ npm run test:workerdom
> preact@8.4.2 test:workerdom /Users/willchou/preact
> mocha --recursive --require sinon --require chai --require sinon-chai --require babel-register test/browser
Components
✓ should render components
✓ should render functional components
@dreamofabear
dreamofabear / gist:17ef671676273166653bc19f212372f4
Last active February 22, 2019 17:32
window.document properties (Chrome, Safari, Firefox)
"ATTRIBUTE_NODE|"
"CDATA_SECTION_NODE|"
"COMMENT_NODE|"
"DOCUMENT_FRAGMENT_NODE|"
"DOCUMENT_NODE|"
"DOCUMENT_POSITION_CONTAINED_BY|"
"DOCUMENT_POSITION_CONTAINS|"
"DOCUMENT_POSITION_DISCONNECTED|"
"DOCUMENT_POSITION_FOLLOWING|"
"DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC|"
@dreamofabear
dreamofabear / react-dates.rollup.bundle.js
Created October 9, 2018 16:28
Sample rollup bundle of react-dates
This file has been truncated, but you can view the full file.
'use strict';
var commonjsGlobal = typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
function commonjsRequire () {
throw new Error('Dynamic requires are not currently supported by rollup-plugin-commonjs');
}
function unwrapExports (x) {
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
@dreamofabear
dreamofabear / array_empty_object.json
Created July 17, 2018 22:54
Array with empty object
[{}]
@dreamofabear
dreamofabear / gist:85795aec306fb5e4cabdd60c937ee8d5
Created May 22, 2018 20:26
Results of DOMPurify test suite on AMP's sanitizer.js
SUMMARY:
● 115 tests completed
● 75 tests failed
FAILED TESTS:
DOMPurify-based
DOMPurify test suite
● Don't remove data URIs from SVG imaged (see #205)
Chrome 66.0.3359 (Mac OS X 10.13.4)
Error: [sanitizer] Removing "style" attribute with invalid value in <image style="border-color: rgb(51, 51, 51); box-sizing: border-box; color: rgb(51, 51, 51); cursor: move; font-family: sans-serif; font-size: 14px; line-height: 20px; outline-color: rgb(51, 51, 51); text-size-adjust: 100%; column-rule-color: rgb(51, 51, 51); -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); -webkit-text-emphasis-color: rgb(51, 51, 51); -webkit-text-fill-color: rgb(51, 51, 51); -webkit-text-stroke-color: rgb(51, 51, 51); user-select: none; vector-effect: non-scaling-stroke;">.'
@dreamofabear
dreamofabear / report.json
Created April 28, 2017 00:06
AMP-PWA Lighthouse JSON
{
"lighthouseVersion": "1.6.5",
"generatedTime": "2017-04-27T21:24:02.407Z",
"initialUrl": "https://choumx.github.io/amp-pwa/",
"url": "https://choumx.github.io/amp-pwa/",
"audits": {
"is-on-https": {
"score": true,
"displayValue": "",
"rawValue": true,