import { Tabs } from "ui-library";
import { css } from "ui-library/stitches.config";
import { useRouter } from "next/router";
export function OptionA() {
const router = useRouter();
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
const path = require("path") | |
const ROOT = process.cwd() | |
const ENV_PATH = path.resolve(path.join(ROOT, ".env")) | |
module.exports.dotenv = function dotenv() { | |
fs.readFileSync(ENV_PATH) | |
.toString() | |
.split("\n") | |
.filter((i) => i.length > 0) | |
.forEach((i) => { |
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
/** | |
* @param {RequestInfo} opts | |
* @param {number} maxRetries | |
* @param {number} retryDelay | |
*/ | |
const fetchRetry = async (opts, maxRetries, retryDelay) => { | |
let error | |
for (let i = 0; i < maxRetries; i++) { | |
try { | |
if (i > 0) { |
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
const { renderToStaticMarkup } = require("react-dom/server.node"); | |
const { createElement } = require("react"); | |
const { default: Jazzicon, jsNumberForAddress } = require("react-jazzicon"); | |
const { JSDOM } = require("jsdom"); | |
const el = createElement(Jazzicon, { | |
diameter: 100, | |
seed: Math.round(Math.random() * 10000000), | |
}); |
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
/* Ultra lightweight Github REST Client */ | |
// original inspiration via https://gist.github.com/v1vendi/75d5e5dad7a2d1ef3fcb48234e4528cb | |
const token = 'github-token-here' | |
const githubClient = generateAPI('https://api.github.com', { | |
headers: { | |
'User-Agent': 'xyz', | |
'Authorization': `bearer ${token}` | |
} | |
}) |
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
const sizeToTimeEstimate = { | |
xs: 1, | |
s: 2, | |
m: 4, | |
l: 12, | |
xl: 24, | |
}; | |
const timeMap = Object.entries( | |
Array.from( |
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
{ | |
"$schema": "http://json-schema.org/draft-07/schema#", | |
"title": "Generated schema for Root", | |
"type": "object", | |
"properties": { | |
"port": { | |
"type": "number" | |
}, | |
"db": { | |
"type": "object", |
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
const getVideoThumbnails = (src: string) => { | |
let w: number, h: number; | |
const aspectRatioDivisionMultiple = 2.5; | |
let screenshotCount = 0; | |
const screenshots: string[] = []; | |
const canvas = document.createElement("canvas"); | |
const video = document.createElement("video"); | |
video.autoplay = false; | |
video.muted = true; | |
video.src = src; |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
OlderNewer