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
/** | |
* Waits for an array of promises to finish, and returns an array of the results. | |
* | |
* If one or more Promises are rejected, throws a RejectionCollection. | |
* | |
* This is very similar to `Promise.all`, except it throws ALL errors, instead of just the FIRST error. | |
* | |
* @param {Array<Promise<T>>} promises | |
* @throws {RejectionCollection} | |
* @return {Promise<Array<T>>} |
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
function calculatePerpendicularIntersect(centerPosition, startPosition, endPosition) { | |
const { x: cX, y: cY } = centerPosition; | |
const { x: sX, y: sY } = startPosition; | |
const { x: eX, y: eY } = endPosition; | |
const slopeStart = (cX - sX) / (cY - sY); | |
const slopePerp = 1 / slopeStart; | |
const intersectX = (slopeStart * sX - slopePerp * eX + eY - sY) / (slopeStart - slopePerp); |
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
async function main() { | |
// Do the thing: | |
console.log(` | |
This script copies settings and sign-in creds from prod to dev. | |
It should prompt you for your system creds (twice), to access the prod creds. | |
`); | |
await copyPassword('credentials', 'InVision Studio', 'InVision Studio (Dev)'); | |
await copyAppDataFolder('InVision Studio', 'InVision Studio (Dev)'); |
OlderNewer