Discover gists
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
async function importCss(url) { | |
try { | |
return await (new Function(`return import("${url}", { with: { type: "css" } })`))(); | |
} catch { | |
try { | |
return await (new Function(`return import("${url}", { assert: { type: "css" } })`))(); | |
} catch { | |
return fetch(url).then(res => res.text()).then(cssText => { | |
const stylesheet = new CSSStyleSheet(); |
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
[ | |
{ "text": "0️⃣", "name": "0", "keyword": ":0:" }, | |
{ "text": "1️⃣", "name": "1", "keyword": ":1:" }, | |
{ "text": "🔟", "name": "10", "keyword": ":10:" }, | |
{ "text": "💯", "name": "100", "keyword": ":100:" }, | |
{ "text": "🥇", "name": "1st Place Medal", "keyword": ":1st-place-medal:" }, | |
{ "text": "2️⃣", "name": "2", "keyword": ":2:" }, | |
{ "text": "🥈", "name": "2nd Place Medal", "keyword": "2nd-place-medal:" }, | |
{ "text": "3️⃣", "name": "3", "keyword": ":3:" }, | |
{ "text": "🥉", "name": "3rd Place Medal", "keyword": ":3rd-place-medal:" }, |
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
httpProxy = require('http-proxy') | |
init_http_proxy_server = () => | |
_remember_me_check_for_write_access_to_project = (opts) -> | |
opts = defaults opts, | |
project_id : required | |
remember_me : required | |
cb : required # cb(err, has_access) | |
account_id = undefined |
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
#!/usr/bin/env node | |
import * as fs from 'fs'; | |
import * as path from 'path'; | |
// https://gist.github.com/lovasoa/8691344 | |
async function* walk(dir) { | |
for await (const d of await fs.promises.opendir(dir)) { | |
const entry = path.join(dir, d.name); | |
if (d.isDirectory()) { |
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
export default async (url, module = {exports:{}}) => | |
(Function('module', 'exports', await (await fetch(url)).text()).call(module, module, module.exports), module).exports |
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 Ember from 'ember'; | |
export default Ember.Controller.extend({ | |
appName: 'Ember Twiddle' | |
}); |
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
export default class HTMLImport extends HTMLElement { | |
#abortController = new AbortController() | |
async connectedCallback() { | |
let src = this.getAttribute("src") | |
if (src === null) { | |
console.warn("<html-import> element requires attribute \"src\"") | |
this.remove() | |
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
export default function () { | |
return window.location.toString(); | |
} |
NewerOlder