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 fs = require("fs") | |
const missings = []; | |
fs.readFile('./tlds_by_tld.json', 'utf-8', (err, file1) => { | |
fs.readFile('./tld.json', 'utf-8', (err, file2) => { | |
fs.readFile('./myjsonfile.json', 'utf-8', (err, file3) => { | |
const tlds1 = JSON.parse(file1) | |
const tlds2 = JSON.parse(file2) | |
const tlds2_obj = tlds2.reduce((res, { Domain, ...tld }) => { | |
res[Domain.toUpperCase().replace('.', '')] = tld; |
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
<template> | |
<div class="story"> | |
<h1 v-refs:sequence>opt out the yellow pages</h1> | |
<p | |
v-refs:sequence | |
>Before Internet, one mean to contact people in different places of the world was using the phone.</p> | |
<p v-refs:sequence>Each individuals were connected to each others by copper cables.</p> | |
<img | |
src="https://www.thisiscolossal.com/wp-content/uploads/2014/09/tower-1.jpg" | |
v-refs:sequence |
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 { computed, ref, createElement as h } from "/vue.js"; | |
export default { | |
props: { | |
lang: { type: String, default: "js" }, | |
content: { type: String, default: "your code..." } | |
}, | |
setup(props, { emit, refs }) { | |
const content = ref(props.content); | |
const highlighted = computed(() => |
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 { ref, onMounted, h, onUnmounted } from "../vue.esm-browser.js"; | |
const getVmax = () => | |
window.innerHeight < window.innerWidth | |
? window.innerHeight | |
: window.innerWidth; | |
export default { | |
props: { | |
width: { type: Number, default: "210mm" }, |
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
let log_verbose = 0; | |
export const log = (...args) => { | |
if (log_verbose) { | |
const div = document.createElement("div"); | |
div.innerText = args.join(", "); | |
document.body.appendChild(div); | |
console.log(...args); | |
} | |
}; |
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
<style> | |
html, | |
body { | |
height: 100%; | |
margin: 0; | |
} | |
</style> | |
<script type="x-shader/x-vertex" id="vertex-shader"> | |
#version 450 |
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
// Fastest | |
// Marsaglia (1972) | |
// https://stackoverflow.com/a/5408344 | |
const randomOnUnitSphere = N => { | |
const vectors = new Float32Array(N * 3); | |
for (let i = 0; i < N; i++) { | |
let x, y, z, norm; | |
while (true) { | |
x = 0.5 - Math.random(); |
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 net from "net"; | |
export default (port) => | |
new Promise((resolve) => { | |
const remove = (client) => { | |
client.removeAllListeners("connect"); | |
client.removeAllListeners("error"); | |
client.end(); | |
client.destroy(); | |
client.unref(); |
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
export const classs = (...args) => | |
args | |
.flatMap((object) => | |
object | |
? typeof object === "string" | |
? object | |
: Object.entries(object).reduce( | |
(str, [name, bool]) => (bool && name ? [...str, name] : str), | |
[] | |
) |
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 React, { useState } from "react"; | |
const classs = (object) => | |
Object.entries(object).reduce( | |
(str, [name, bool]) => `${str}${bool ? ` ${name}` : ""}`, | |
"" | |
); | |
const Tabs = ({ children }) => { | |
const [active, setActive] = useState(0); |