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
| /** | |
| * String encoder/decoder using AES-CBC encryption | |
| * by Marc Robledo | |
| * | |
| * Usage: | |
| * const myKey=await StringEncoder.buildKey('my secret password'); | |
| * const encodedString=await StringEncoder.encode('my secret string', myKey); | |
| * const decodedString=await StringEncoder.decode(encodedString, myKey); | |
| * console.log(decodedString); | |
| * |
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
| /** | |
| * Array.shuffle() JS implementation using Fisher-Yates algorithm | |
| * | |
| * by Marc Robledo | |
| * Released under no license | |
| * | |
| * Usage: | |
| * | |
| * const numbers = [1, 2, 3, 4, 5]; | |
| * const shuffledNumbers = numbers.shuffle(); |
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
| /** | |
| * Web worker adaptation of pure JS image bilinear rescaler from https://stackoverflow.com/a/19144434 | |
| * | |
| * by Marc Robledo | |
| * Released under no license | |
| * | |
| * Usage: | |
| * | |
| * const webWorkerImageResizer = new Worker('image-resizer.webworker.js'); | |
| * webWorkerImageResizer.onmessage = event => { // listen for events from the worker |
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
| /** | |
| * JavaScript functions to transform strings to: | |
| * - slug | |
| * - camelCase | |
| * - PascalCase | |
| * - snake_case | |
| * - kebab-case | |
| * | |
| * Usage: ' *** This is just a test! *** '.slug(); //returns 'this-is-just-a-test' | |
| * 'Do you like jalapeños and Pokémon!?'.slug(true); //returns 'do_you_like_jalapenos_and_pokemon' |
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
| /** | |
| * JavaScript functions to turn Number objects into formatted number strings: | |
| * - zero padded | |
| * - hex bytes | |
| * | |
| * Usage: (1).toStringZeroPadded(); //returns '01'; | |
| * (10).toStringZeroPadded(3); //returns '010'; | |
| * (0x0f).toStringHexBytes(); //returns '0f'; | |
| * (0x0100).toStringHexBytes(); //returns '0100'; | |
| * (0x010200).toStringHexBytes(); //returns '00010200'; |
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
| /** | |
| * JavaScript function that enables or disables warning before closing | |
| * page | |
| * Usage: warnOnLeave(true|false); | |
| * | |
| * by Marc Robledo | |
| * Released under no license | |
| */ | |
| const warnOnLeave=(function(){ |
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
| // ==PREPROCESSOR== | |
| // @name "Now Playing exporter" | |
| // @author "Marc Robledo" | |
| // @version "1.0" | |
| // ==/PREPROCESSOR== | |
| // for use with https://github.com/jscript-panel | |
| /* CONFIGURATION */ |