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 getAcronym = (str: string) => | |
| [...(str.trim().match(/\b(\w)/g) || '')].join('').toUpperCase(); | |
| console.log(getAcronym('nelson dsouza')) |
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
| pycryptodome==3.20.0 |
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
| /** | |
| * It works until ad element ids are changed | |
| * | |
| **/ | |
| // Helper function to safely execute a function on an element | |
| function safeExecute(element, callback) { | |
| if (element) callback(element); | |
| } |
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 crypto = require("crypto"); | |
| /** | |
| * Convert decimal to hexadecimal. | |
| * @param {number} s - Decimal number to convert. | |
| * @returns {string} Hexadecimal representation of the decimal number. | |
| */ | |
| function dec2hex(s) { | |
| return (s < 15.5 ? '0' : '') + Math.round(s).toString(16); | |
| } |
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 getSubtitleText(url) { | |
| function fetchData(url) { | |
| return fetch(url) | |
| .then(response => response.json()) | |
| .then(data => data); | |
| } | |
| return fetchData(url) | |
| .then(subtitle => { | |
| const text = subtitle.events.flatMap(event => event.segs?.map(seg => seg.utf8)).join(''); |