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 puppeteer = require("puppeteer"); | |
const fs = require("fs"); | |
const breakpoints = { | |
mobile: [320, 768], | |
mobileMedium: 375, | |
mobileLandscape: 480, | |
phablet: 660, | |
tablet: 740, | |
desktop: 980, |
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 input = Deno.readTextFileSync("./input.txt"); | |
const priority = (code: number) => | |
code < 97 ? code - 38 : code - 96; | |
const findDuplicate = (first: string, second: string, third: string) => { | |
const map = new Map(); | |
const update = (c, mask) => map.set(c, (map.get(c) ?? 0) | mask); | |
first.split('').map((c) => update(c, 0x001)); | |
second.split('').map((c) => update(c, 0x010)); | |
third.split('').map((c) => update(c, 0x100)); | |
return ([...map].find(([k,v]) => v === 0x111))[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 targets = ['cj', 'dl', 'ei', 'jk', 'rl', 'sa', 'sb']; | |
const bullet = Math.floor(Math.random() * targets.length); | |
const shot = targets[bullet]; | |
console.log(shot); |
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
# list all remotes | |
git remote -v | |
# delete a remote | |
git remote remove repoalias | |
# push a repo to another repo | |
git remote add newrepo git@... | |
git push newrepo main |
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
git subtree push --prefix dist origin gh-pages |
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
{ | |
"version": "0.2.0", | |
"configurations": [ | |
{ | |
"type": "node", | |
"request": "launch", | |
"name": "Jest watch current file", | |
"program": "${workspaceFolder}/node_modules/jest/bin/jest", | |
"args": [ | |
"${fileBasename}", |
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
find . -type f -print0 | xargs -0 ls -l | sort -k5,5rn > ~/files.txt |
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
aws s3 ls s3:// | awk '{ count +=1; size += $3 } END { print "Count:", count, "Size:", size, "bytes" }' |
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 | |
while read -r line | |
do | |
printf "attempting: $line > " | |
tmpfile=./tmp/$line.xml | |
aws s3 cp s3://*****/$line $tmpfile > /dev/null | |
if grep -q "<???????:para>" $tmpfile; then | |
printf "ABSTRACT: Y > " | |
xmlstarlet sel -t -o "{ @@@@id@@@@ : @@@@" -v "//?????:eid" -o "@@@@, @@@@abstract@@@@ : @@@@" -t -v "//abstract/?????" -o "@@@@}" $tmpfile > $tmpfile.json | |
sed -i -e 's/"/\\"/g' $tmpfile.json |
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
diff file1 file2 | awk '{if ( $2 != "") print $2}' |
NewerOlder