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
// First run this to start your instance of Chromium. This could be done for Firefox or Edge as well. | |
// I use the ones that Playwright installs to "<user>\AppData\Local\ms-playwright" since I normally use Chrome, and | |
// I don't want the script to mess with my regular profile. The debug port is important to include. | |
// > cd "path\to\chromium\install" | |
// > .\chrome.exe --remote-debugging-port=9222 | |
// Once the browser is running, use NodeJS or whatever flavor of Playwright (python, C#, etc) you are using to run the script and connect: | |
// > node your-compiled-script.js | |
// your-pre-compiled-script.ts |
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 requestMoneyLocation() { | |
return Object.values(`where's the money?`).reduce((acc, curr) => { | |
return acc + (Math.random() > 0.5 ? curr.toUpperCase() : curr); | |
}, ''); | |
} |
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 displayMotivation(currentLevel, maxLevel, title, unitValue, emptyValue){ | |
const negativeMotivationLevel = currentLevel < 0 ? Math.abs(currentLevel) : 0; | |
const negativeMotivation = new Array(negativeMotivationLevel).fill(unitValue || '#'); | |
const excessMotivationLevel = currentLevel > maxLevel ? currentLevel - maxLevel : 0; | |
const excessMotivation = new Array(excessMotivationLevel).fill(unitValue || '#'); | |
const motivationLevel = Math.max(currentLevel - negativeMotivationLevel - excessMotivationLevel, 0); | |
const motivation = new Array(maxLevel) | |
.fill(unitValue || '#', 0, motivationLevel) |
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
Set-Location ".\dist\production" | |
Function Format-FileSize() { | |
Param ([int]$size) | |
If ($size -gt 1TB) {[string]::Format("{0:0.00} TB", $size / 1TB)} | |
ElseIf ($size -gt 1GB) {[string]::Format("{0:0.00} GB", $size / 1GB)} | |
ElseIf ($size -gt 1MB) {[string]::Format("{0:0.00} MB", $size / 1MB)} | |
ElseIf ($size -gt 1KB) {[string]::Format("{0:0.00} kB", $size / 1KB)} | |
ElseIf ($size -gt 0) {[string]::Format("{0:0.00} B", $size)} | |
Else {""} |