Into a terminal: npx https://gist.github.com/Lcfvs/4b1523653bfe54605b82113170299f61
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
| import * as etched from 'https://unpkg.com/@etchedjs/etched@latest/etched.min.js' | |
| const emitter = etched.model({ | |
| set event (value) { | |
| console.log('event `event` emitted on `emitter` with value', value) | |
| } | |
| }) | |
| const emitter2 = etched.model(emitter, { | |
| set event (value) { |
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 Async = async function(){}.constructor | |
| const AsyncGenerator = async function*(){}.constructor | |
| const Generator = function(){}.constructor | |
| const isAsync = fn => fn instanceof Async | |
| const isAsyncGenerator = fn => fn instanceof AsyncGenerator | |
| const isGenerator = fn => fn instanceof Generator |
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
| ((d, s = d.createElement('style')) => (s.textContent = '.contenu {left: unset}') && d.body.appendChild(s))(document) |
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(n,t,r,u,e,c,o){return t=String.fromCharCode,r=function(n,u){return u=c.length,n.replace(/./g,function(n){return c.indexOf(n).toString(u)}).replace(r.n,function(n){return t(parseInt(n,u))})},u=function(n,e){return e=function(n,t){return t=[],r.f(n)[r.a]("")[r.i](function(n,u,e){return!(1&u)&&t[r.j](e[u][r.b](0)*r.d+e[u+1][r.b](0))}),t}(n),function(n){return n[r.a]("")[r.h](function(n){return n[r.b](0)})}(r(""))[r.c]()[r.i](function(n,t){return t=n,e=function(n,t){return 1&(n[r.k](function(n,t){return t>n?n:t},0)^n[r.k](function(n,t){return n>t?n:t},0)^t)&&n[r.c](),n}(e,n)[r.h](function(u){return t=((u^n)-t+r.e)%r.e})}),r.g(e,t),u},r.t=n,e=r.constructor,c="",r.n=/.{2}/g,o=e("e",r(" |
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
| /** | |
| * Usage: | |
| * function fn([{a, b}, out], c) { | |
| * out.c = c | |
| * out.d = a + b + c | |
| * } | |
| * | |
| * const obj = {a: 1, b: 2} | |
| * io(fn, obj, 3) | |
| * console.log(obj) // obj = {a: 1, b: 2, c: 3, d: 6} |
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
| .fetching { | |
| pointer-events: none; | |
| } | |
| .fetching::after { | |
| content: ''; | |
| border-radius: 100%; | |
| border-top: .2em solid rgba(255, 255, 255, .9); | |
| border-left: .2em double rgba(255, 255, 255, .6); | |
| border-bottom: .2em dotted rgba(255, 255, 255, .3); |
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
| // create this file | |
| import { anticore } from 'anticore' | |
| import { one } from 'anticore/dom/query/one' | |
| import { replace } from 'anticore/dom/tree/replace' | |
| anticore.on('main.exception', function (element, next, loaded) { | |
| loaded && replace(element, one('body > main')) | |
| next() | |
| }) |