π¨βπ»
This file contains hidden or 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
/** | |
* Shuffles array in place. ES6 version | |
* @param {Array} a items An array containing the items. | |
* https://stackoverflow.com/questions/6274339/how-can-i-shuffle-an-array | |
*/ | |
shuffle(a: Array<any>) { | |
for (let i = a.length - 1; i > 0; i--) { | |
const j = Math.floor(Math.random() * (i + 1)); | |
[a[i], a[j]] = [a[j], a[i]]; | |
} |
This file contains hidden or 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 events = [download, download2]; | |
const promises = events.map((event) => { | |
return new Promise((resolve) => { | |
event.on("end", (paths) => { | |
resolve(paths); | |
}); | |
}); | |
}); | |
Promise.all(promises).then((result) => {}); |
This file contains hidden or 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
export NODE_VER=14.15.1 | |
if ! node --version | grep -q ${NODE_VER}; then | |
(cat /proc/cpuinfo | grep -q "Pi Zero") && if [ ! -d node-v${NODE_VER}-linux-armv6l ]; then | |
echo "Installing nodejs ${NODE_VER} for armv6 from unofficial builds..." | |
curl -O https://unofficial-builds.nodejs.org/download/release/v${NODE_VER}/node-v${NODE_VER}-linux-armv6l.tar.xz | |
tar -xf node-v${NODE_VER}-linux-armv6l.tar.xz | |
fi | |
echo "Adding node to the PATH" | |
PATH=$(pwd)/node-v${NODE_VER}-linux-armv6l/bin:${PATH} | |
fi |
OlderNewer