Skip to content

Instantly share code, notes, and snippets.

View thatkid02's full-sized avatar
🦸‍♂️
.

Nelson DSouza thatkid02

🦸‍♂️
.
View GitHub Profile
@thatkid02
thatkid02 / utility.ts
Created May 15, 2024 13:10
Utility Snippets
const getAcronym = (str: string) =>
[...(str.trim().match(/\b(\w)/g) || '')].join('').toUpperCase();
console.log(getAcronym('nelson dsouza'))
@thatkid02
thatkid02 / requirements.txt
Created April 19, 2024 11:55
Learn how RSA private key works
pycryptodome==3.20.0
@thatkid02
thatkid02 / skipAds.js
Created April 18, 2024 10:10
Skip Youtube Ads
/**
* 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);
}
@thatkid02
thatkid02 / getOTP.js
Last active December 25, 2025 23:57
Implementing 2FA in javascript for 101
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);
}
@thatkid02
thatkid02 / getSubtitleText.js
Created April 16, 2024 13:33
Fetching the subtitle from youtube
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('');