This file contains hidden or 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
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <meta charset="utf-8" /> | |
| <script type="module"> | |
| const createAction = (el, initialState, name, action) => { | |
| let currentState = initialState; | |
| document.body.addEventListener(name, (e) => { | |
| el.render(e.detail.state); | |
| }); |
This file contains hidden or 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
| const allCustomElements = []; | |
| function isCustomElement(el) { | |
| const isAttr = el.getAttribute('is'); | |
| // Check for <super-button> and <button is="super-button">. | |
| return el.localName.includes('-') || isAttr && isAttr.includes('-'); | |
| } | |
| function findAllCustomElements(nodes) { | |
| for (let i = 0, el; el = nodes[i]; ++i) { |
This file contains hidden or 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
| var str = 'class ಠ_ಠ extends Array {constructor(j = "a", ...c) {const q = (({u: e}) => {return { [`s${c}`]: Symbol(j) };})({});super(j, q, ...c);}}' + | |
| 'new Promise((f) => {const a = function* (){return "\u{20BB7}".match(/./u)[0].length === 2 || true;};for (let vre of a()) {' + | |
| 'const [uw, as, he, re] = [new Set(), new WeakSet(), new Map(), new WeakMap()];break;}f(new Proxy({}, {get: (han, h) => h in han ? han[h] ' + | |
| ': "42".repeat(0o10)}));}).then(bi => new ಠ_ಠ(bi.rd));'; | |
| try { | |
| eval(str); | |
| } catch(e) { | |
| alert('Your browser does not support ES6!') | |
| } |
This file contains hidden or 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
| //https://developer.mozilla.org/en-US/docs/Web/Events/resize | |
| ; | |
| (function() { | |
| var throttle = function(type, name, obj_) { | |
| var obj = obj_ || window; | |
| var running = false; | |
| var func = function() { | |
| if (running) { | |
| return; | |
| } |
This file contains hidden or 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
| /* tslint:disable-next-line */ | |
| let stringifyObj = function (obj: object): any {}; | |
| if (!DEBUG) { | |
| stringifyObj = (obj: object): string => { | |
| const placeholder = "____PLACEHOLDER____"; | |
| const fns: Function[] = []; | |
| let json = JSON.stringify( | |
| obj, | |
| function (_, value: any): any { |
This file contains hidden or 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 timeoutify(fn,delay) { | |
| var intv = setTimeout( function(){ | |
| intv = null; | |
| fn( new Error( "Timeout!" ) ); | |
| }, delay ) | |
| ; | |
| return function() { | |
| // timeout hasn't happened yet? | |
| if (intv) { |
This file contains hidden or 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
| man -P 'less -p ^READLINE' bash |
This file contains hidden or 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
| groff -man -T html $(man -w man) > $TMPDIR/man.html | open -f -a 'Google Chrome' $TMPDIR/man.html |
This file contains hidden or 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
| # From http://vim.wikia.com/wiki/Using_vim_as_a_man-page_viewer_under_Unix | |
| export MANPAGER='col -bx | vim -c ":set ft=man nonu nolist" -R -' |