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 waitFor(condition, callback, waitMs = 100, timeoutMs = -1) { | |
if (condition()) { | |
callback(); | |
} else { | |
let interval = setInterval(() => { | |
if (condition()) { | |
clearInterval(interval); | |
callback(); | |
} | |
}, waitMs); |
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
/** @OnlyCurrentDoc */ | |
/* Globals */ | |
let sheetDataRanges = {}; | |
let sheetVals = {}; | |
let skuParentInfo = {}; | |
/* This is the launch point! */ | |
function buildNewList() { | |
Logger.log('Building parent SKU info...'); |
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
// PACKAGES | |
const winston = require('winston'); | |
const { format } = require('logform'); | |
require('winston-daily-rotate-file'); | |
const simpleTimestampAndLevel = format.printf(({ level, message, timestamp }) => { | |
return `${timestamp} ${level}: ${message}`; | |
}); | |
const simpleLevel = format.printf(({ level, message }) => { |
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
# killscreens() | |
# close alls screens with name | |
# based on answer by joschi from question here https://unix.stackexchange.com/questions/20435/killing-multiple-gnu-screen-sessions-with-the-same-name | |
# | |
# [ USAGE ] | |
# killscreens <screen-name> Kill all screens with name | |
# killscreens -h Displays help menu | |
killscreens() { | |
if [[ "$1" == "" || "$1" == "-h" || "$1" == "--help" || "$1" == "help" || "$2" != "" ]]; then | |
echo "Usage: killscreens <screen-name>" |
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
# USAGE | |
# get-js-imports [relativeDirectory = '.'] [js var suffix = ''] | |
# EXAMPLES | |
# get-js-imports | |
# get-js-imports ../components | |
# get-js-imports ../media Img | |
# DESCRIPTION | |
# A quick way to bulk import a bunch of files (Javascript, Typescript, Images, etc.) into a Node.js app |
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
// class EventEmitterCancelable | |
// | |
// EventEmitterCancelable is a subclass of the built-in Node.js EventEmitter | |
// class. Three additional functions are exposed: cancelActiveEvent(), | |
// ignoreNext(e), and cancelActiveEvent(). | |
// | |
// During an 'event' listener callback, the listener can cancel further callback | |
// processing by calling either cancelActiveEvent() or cancelEvent('event'). | |
// This is similar to stopImmediatePropogation() from the Event class. | |
// |
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
all: excellon.html excellon.pdf | |
excellon.html: excellon.md | |
@pandoc $< -o $@ | |
excellon.pdf.md: excellon.md | |
@cat $< | sed 's/\.png/\.pdf/g' > $@ | |
excellon.pdf: excellon.pdf.md | |
@pandoc $< --latex-engine=pdflatex -o $@ |