type EventsGeneric = { [eventName: string]: any }
type ServiceGeneric = { [fn: string]: (requestData: any) => any}
type FunctionsGeneric = { [fn: string]: (requestData: any) => any}
type ResolvePubbe...
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
Benchmarking sqlite drivers against PRAGMA journal_mode=DELETE | |
CPU | Apple M1 Max | |
Runtime | Deno 2.2.1 (aarch64-apple-darwin) | |
file:///Users/andrew.kaiser/Code/scratchwork/deno-sqlite-benchmark/bench2.ts | |
benchmark time/iter (avg) iter/s (min … max) p75 p99 p995 | |
---------------- ----------------------------- --------------------- -------------------------- | |
group insert random data |
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
{ | |
"0 debug pnpm:scope": { | |
"selected": 1, | |
"workspacePrefix": null | |
}, | |
"1 debug pnpm": { | |
"isCaseSensitive": false, | |
"store": "/Users/andrew/.pnpm-store/2" | |
}, | |
"2 debug pnpm:package-manifest": { |
Home > scrape-pages > scrape
scrape is the entrypoint for this library
Signature:
Home > scrape-pages > scrape
scrape is the entrypoint for this library
Signature:
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
empty = None | |
deep = dict(a=dict(b='c')) | |
def chain_optional(func, default_value=None): | |
try: | |
return func() | |
except AttributeError: | |
return default_value | |
except TypeError: |
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 | |
const timeout = n => new Promise(resolve => setTimeout(resolve, n)) | |
// sync | |
const sleep = n => Atomics.wait(new Int32Array(new SharedArrayBuffer(4)), 0, 0, n) | |
// async | |
const scheduleAsync = startAtEpoch => async fn => { | |
const now = Date.now() | |
const millisecondsTillStartAt = startAtEpoch - now | |
await timeout(millisecondsTillStartAt) |
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
// current design | |
import ScrapePages from '../src' | |
import { normalizeConfig } from '../lib/normalize-config' | |
const config = { scrape: {} } | |
const options = { | |
input: { | |
username: 'bob' | |
}, | |
optionsEach: { | |
gallery: { |
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 * as Rx from 'rxjs' | |
import * as ops from 'rxjs/operators' | |
import fs from 'fs' | |
import VError from 'verror' | |
/** | |
* for now, there can only be one transport at a time | |
* the cli will have to handle an option to directly log to terminal while also including a | |
* "terminal ui" output default (progress bars, queued, in progress, completed, etc) | |
* this can be accomplished by log options being done directly as command line args | |
*/ |
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
// index.js | |
const objectPath = Symbol("object-path"); | |
const objectCrawler = Symbol("object-crawler"); | |
const handler = { | |
get: (object, prop) => { | |
if (prop === objectPath) { | |
return object[objectPath]; | |
} else if (String(prop) === "Symbol(util.inspect.custom)") { | |
return object; |
NewerOlder