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
/* 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 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 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 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 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 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 filter = Function.prototype.call.bind(Array.prototype.filter) | |
filter([1,2,3], (x) => x > 1 ) |
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
defaults write com.microsoft.VSCode ApplePressAndHoldEnabled -bool false # For VS Code | |
defaults write com.microsoft.VSCodeInsiders ApplePressAndHoldEnabled -bool false # For VS Code Insider | |
defaults write md.obsidian ApplePressAndHoldEnabled -bool false # For Obsidian | |
defaults delete -g ApplePressAndHoldEnabled |
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 isError(value) { | |
switch (Object.prototype.toString.call(value)) { | |
case '[object Error]': | |
return true; | |
case '[object Exception]': | |
return true; | |
case '[object DOMException]': | |
return true; |
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
import { fileURLToPath } from 'url' | |
const __filename = fileURLToPath(import.meta.url) | |
const __dirname = path.dirname(__filename) |
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
javascript:void((function(w, d)%7B/*begin*/import(%27https://unpkg.com/query-selector-shadow-dom%400.8.0/src/querySelectorDeep.js%27).then((%7BquerySelectorAllDeep: %24%24%7D) %3D> console.log(%5B...%24%24(%27*:defined%27)%5D.filter(e %3D> e.tagName.indexOf(%27-%27) > -1)))/*end*/%7D)( window, document ))%3B |