$ yarn
$ mkdir -p ssl/
$ openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout ssl/foobar.key -out ssl/foobar.crt
$ node server

- GitHub Staff
- https://marais.io
- @slightlycode
- @htm.io
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
function makePromisibleStream(streamable) { | |
return { | |
async then(resolve) { | |
const stream = streamable(); | |
const returns = []; | |
for await (const i of stream) { | |
returns.push(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
import { Octokit } from '@octokit/rest'; | |
const client = new Octokit({ | |
auth: process.env.GITHUB_TOKEN, | |
}); | |
const repos = await client.repos.listForUser({ | |
username: 'maraisr', | |
per_page: 200, | |
}); |
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
type FileType = string | Buffer | URL; | |
type DataType = string | Buffer; | |
declare function writeFile(path: FileType, body: DataType, content_type?: string): Promise<void>; | |
declare function writeFileSync(path: FileType, body: DataType, content_type?: string): void; | |
export { writeFile, writeFileSync }; |
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 localeMap = { | |
AU: "/au", | |
US: "/us", | |
GB: "/uk", | |
NZ: "/nz", | |
MX: "/es-mx", | |
"*": "/au", | |
}; | |
addEventListener( |
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 { useEffect, useRef } from 'react'; | |
function getItem(storage, key) { | |
const value = storage.getItem(key); | |
if (!value) return null; | |
try { | |
return JSON.parse(value); | |
} catch (error) { |
While the public API intended for users to use is the scheduler
package, the reconciler currently
does not use scheduler
's priority classes internally.
ReactFiberScheduler
has its own internal "mini-scheduler" that uses the scheduler
package
indirectly for its deadline-capable scheduleCallback.
This is kind of a documentation of implementation details that I suppose will be gone by the end of the year, but what can you do.
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
{ | |
main: "cjs", | |
module: "esm node", | |
browser: "esm browser", | |
unpkg: "umd", | |
"exports": { | |
".": { | |
"browser": { | |
"import": "esm browser", | |
"require": "cjs browser" |
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
type Deferred<T> = { | |
resolve: (value: T) => void; | |
reject: (value: unknown) => void; | |
promise: Promise<T>; | |
}; | |
function createDeferred<T>(): Deferred<T> { | |
const d = {} as Deferred<T>; | |
d.promise = new Promise<T>((resolve, reject) => { |
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
/* | |
Makes your remote containers low level API accessible via: | |
import accessFederatedContainer from "access-federated-containers"; | |
accessFederatedContainer("app2") | |
*/ | |
/** @typedef {import("webpack").Compiler} Compiler */ | |
/** @typedef {import("webpack").Compilation} Compilation */ |
NewerOlder