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
FROM node:8-alpine | |
COPY entrypoint.sh /usr/bin/entrypoint.sh | |
# create npmrc with enviroment variable | |
RUN echo "\$NPM_TOKEN" > /root/.npmrc | |
# entrypoint script performs envsubst on npmrc | |
RUN printf '#!/bin/sh\n\ | |
sed -i "s~\$NPM_TOKEN~$NPM_TOKEN~" /root/.npmrc\n\ | |
$@' > /usr/bin/entrypoint.sh \ |
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
#blacklist top level folder | |
/* | |
#whitelist files & folders | |
!.gitignore | |
!README.md | |
!.i3/ | |
!.i3status.conf |
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
#!/bin/bash | |
#wait (in seconds) for background to change | |
wait=$((60 * 60)) | |
#in the future, could load files from a general bin/config file | |
#sed -c -i "s/\($TARGET_KEY *= *\).*/\1$REPLACEMENT_VALUE/" $CONFIG_FILE | |
dir="$(cat /home/andrew/bin/data/slideshow_all.txt)" | |
#finds the image files in $dir, optionally can add --max-depth 1 to keep from searching subdirs | |
files=$(find "$dir" -regex ".*\.\(jpg\|gif\|png\|jpeg\)" | sort -n) |
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
#!/bin/bash | |
N=50 | |
i=1 | |
down_dir="$HOME/wget/Kingdom/" | |
while [ $i -lt $N ]; do | |
echo -==: downloading chapter $i :==- | |
# old locations |
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) |
NewerOlder