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 i18n(t) { | |
| for (var o = [t[0]], i = 1, l = arguments.length; i < l; i++) | |
| o.push(arguments[i], t[i]); | |
| return o.join(''); | |
| } |
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 _url from 'url'; | |
| const builtins = new Set( | |
| Object.keys(process.binding('natives')).filter(str => | |
| /^(?!(?:internal|node|v8)\/)/.test(str)) | |
| ); | |
| const esmIfExplicit = url => { | |
| const eof = url.slice(-5); | |
| 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
| const camelPatched = (() => {'use strict'; | |
| /*! (c) 2017 Andrea Giammarchi - @WebReflection (ISC) */ | |
| const GIRepository = imports.gi.GIRepository; | |
| const rep = GIRepository.Repository.get_default(); | |
| const patched = new Set; | |
| return Class => { | |
| if (!patched.has(Class)) { | |
| patched.add(Class); | |
| const path = Class.name.split('_'); | |
| if (path.length === 2) { |
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 hash(str) { | |
| var hval = 0x811c9dc5, i = 0, length = str.length; | |
| while (i < length) { | |
| hval ^= str.charCodeAt(i++); | |
| hval += (hval << 1) + (hval << 4) + (hval << 7) + (hval << 8) + (hval << 24); | |
| } | |
| return hval >>> 0; | |
| } |
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 (document, TEMPLATE) { | |
| var container = document.createElement(TEMPLATE); | |
| if ('content' in container) return; | |
| var createElement = document.createElement; | |
| var descriptor = { | |
| get: function () { return this.content ? this.content.innerHTML : ''; }, | |
| set: function (html) { | |
| var el = createElement.call(document, TEMPLATE); | |
| if (/^[^\S]*?<(t(?:head|body|foot|r|d|h))/i.test(html)) { | |
| var selector = RegExp.$1; |
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
| // this is now part of hyperHTML package | |
| // https://github.com/WebReflection/hyperHTML/blob/master/no.js |
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 lang="en"> | |
| <head> | |
| <title>hyperHTML & Firebase</title> | |
| <meta charset="utf-8"> | |
| <meta name="viewport" content="width=device-width,initial-scale=1.0"> | |
| <style> | |
| html { font-family: sans-serif; } | |
| html, body, ul, p { padding: 0; margin: 0; } | |
| ul, li { list-style: none; } |
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 borrowedState = require('flatstate').setState; | |
| class HyperElement extends HTMLElement { | |
| constructor(...args) { | |
| super(...args); | |
| this.html = hyperHTML.bind(this); | |
| } | |
| render() {} |
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 any = $ => new Promise((D, E, A, L) => { | |
| A = []; | |
| L = $.map(($, i) => Promise | |
| .resolve($) | |
| .then(D, O => (((A[i] = O), --L) || E(A))) | |
| ).length; | |
| }); |
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
| // a slightly modified DelegatedListener | |
| // it sends itself while triggering the event | |
| class DelegatedListener { | |
| constructor(delegated) { | |
| this.delegated = delegated; | |
| } | |
| handleEvent(event) { | |
| this.delegated['on' + event.type](event, this); |