This file contains 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 () { let minutes = parseInt(prompt("How many minutes?", "15")); setTimeout(() => document.body.innerHTML = '', minutes * 60 * 1000); })() |
This file contains 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
# Boilerplate for PHP class | |
let @p='i%dawO<?" | |
onamespaceJ:s~Äku | |
/wdf\....~AÄkb {}F\s; | |
class ' | |
# Turn a test name comment into a snake-cased class method (PHPUnit) | |
let @t=':s#[^/ ]\zs #_#g | |
^ciwpublic functionA()o{ |
This file contains 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
#!/usr/bin/env nix-shell | |
#! nix-shell -i bash -p yt-dlp | |
# | |
# Download shiur from [Rabbi Uri Lati's YouTube channel](https://www.youtube.com/@UriLati) and convert it into something | |
# [my phone's podcast player](https://www.kaiostech.com/store/apps/?bundle_id=com.kaiostech.podkast) can use | |
usage () { | |
echo "USAGE:" | |
echo "uri-lati-dl.sh <url>" | |
} |
This file contains 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
This is where I mounted my FAT32 USB drive on MacOS Ventura when it didn't want to automatically. | |
Had to run this command: | |
``` | |
sudo mount -t msdos <device> ~/fat_mount | |
``` | |
<device> is obtainable by running |
This file contains 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
// Calculate the overlap for a single row | |
const row = (len, nums) => { | |
let overlap = len - (nums.reduce((a, n) => a + n) + nums.length - 1); | |
return nums.some((n) => n > overlap) ? overlap : Infinity; | |
}; | |
// Calculate the overlap for many rows | |
const rows = (len, rows) => | |
rows.map((nums) => ({ |
This file contains 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
# Make sure these lines are added to your /etc/zshrc | |
# Enable Nix daemon | |
if [ -e '/nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh' ]; then | |
source '/nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh' | |
fi |
This file contains 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 () => { | |
lang = location.pathname.split('/')[1]; | |
selects = document.querySelectorAll('.customSelect'); | |
level = `${selects[1].value}-${selects[2].value}`; | |
document.querySelector('span.customSelect').click(); | |
setTimeout(async () => { | |
categories = Array.from(document.querySelectorAll('.multiSelectDropdown input')).filter((node) => node.checked).map(node => node.nextSibling.nextSibling.nodeValue).join("|"); | |
bookUrl = await fetch('https://readlang.com/api/books?' + new URLSearchParams({ | |
language: lang, | |
firstLanguage: 'en', |
This file contains 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
lang = location.pathname.split('/')[1]; | |
await fetch(`https://readlang.com/api/books?language=${lang}&firstLanguage=en&tag=completed`, { | |
"credentials": "include", | |
"headers": { | |
"Accept": "application/json, text/javascript, */*; q=0.01", | |
"X-Requested-With": "XMLHttpRequest", | |
}, | |
"referrer": `https://readlang.com/${lang}/library`, | |
"method": "GET", | |
"mode": "cors" |