type EventsGeneric = { [eventName: string]: any }
type ServiceGeneric = { [fn: string]: (requestData: any) => any}
type FunctionsGeneric = { [fn: string]: (requestData: any) => any}
type ResolvePubbe...
View ts play example.md
View pnpm-debug.log
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": { |
View api-extractor.test.md
Home > scrape-pages > scrape
scrape variable
scrape is the entrypoint for this library
Signature:
View api-extractor.test.md
Home > scrape-pages > scrape
scrape variable
scrape is the entrypoint for this library
Signature:
View optional_chaining.py
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: |
View timing-utils.js
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) |
View api-proposal.js
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: { |
View example-log-transport.js
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 | |
*/ |
View placeholder magic.js
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; |
View example-defs-scraper.config.yml
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
input: 'username' | |
defs: | |
- name: 'home' | |
download: 'https://ifunny.co/user/{{ username }}' | |
parse: | |
name: 'batch-id' | |
selector: '.stream__item:first-child' | |
attribute: 'data-next' | |
- name: 'gallery' |
NewerOlder