Improved .visually-hidden
Theorically bulletproof CSS class for visually hide anything and keep it accessible to ATs.
| new Date(seconds * 1000).toISOString().substr(11, 8) |
| // more minimal version of https://github.com/olahol/scrollparent.js/blob/master/scrollparent.js | |
| const regex = /(auto|scroll)/; | |
| const style = (node, prop) => | |
| getComputedStyle(node, null).getPropertyValue(prop); | |
| const scroll = (node) => | |
| regex.test( | |
| style(node, "overflow") + | |
| style(node, "overflow-y") + |
| 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!') | |
| } |
A non-exhaustive list of WebGL and WebGPU frameworks and libraries. It is mostly for learning purposes as some of the libraries listed are wip/outdated/not maintained anymore.
| Name | Stars | Last Commit | Description |
|---|---|---|---|
| three.js | ![GitHub |
| { | |
| "jest": { | |
| "setupFiles": [ | |
| "<rootDir>/test-setup.js" | |
| ] | |
| } | |
| } |
Vue events don't bubble the component tree on their own. However when writing wrapper components this can be the desired behaviour.
This code registers a global bubble directive which allows to re-emit all given events:
Let's say we want to bubble events start, accelerate and brake of our component Car.
Without any help, we'd roughly have to do this:
| // This is an example of how to fetch external data in response to updated props, | |
| // If you are using an async mechanism that does not support cancellation (e.g. a Promise). | |
| class ExampleComponent extends React.Component { | |
| _currentId = null; | |
| state = { | |
| externalData: null | |
| }; |
| # Synchronize history between bash sessions | |
| # | |
| # Make history from other terminals available to the current one. However, | |
| # don't mix all histories together - make sure that *all* commands from the | |
| # current session are on top of its history, so that pressing up arrow will | |
| # give you most recent command from this session, not from any session. | |
| # | |
| # Since history is saved on each prompt, this additionally protects it from | |
| # terminal crashes. |