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
| #!/usr/bin/env bash | |
| set -euo pipefail | |
| # -------------------------------------------------------------------- | |
| # Configuration | |
| # -------------------------------------------------------------------- | |
| # Directory where temporary files will be stored | |
| WORKDIR="${HOME}/garmin_map_update" | |
| mkdir -p "${WORKDIR}" |
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
| mapkey('P', '#1Paste from clipboard', function() { | |
| // Grab the latest clipboard entry | |
| const clipboardText = Clipboard.get(); | |
| // Get all input elements on the page | |
| const inputs = $$('input, textarea'); | |
| // Check how many inputs there are | |
| if (inputs.length === 0) { | |
| alert("No input fields found."); |
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
| #!/usr/bin/env nix-shell | |
| #!nix-shell -p curl fd pdftk | |
| MASECHTA=${MASECHTA:-berachos} | |
| DAFIM=${DAFIM:-200} | |
| mkdir -p "$MASECHTA" | |
| for daf in $(seq 2 "$DAFIM"); do | |
| for amud in {a..b}; do |
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
| #!/usr/bin/env python3 | |
| import json | |
| import math | |
| import os | |
| import requests | |
| from bs4 import BeautifulSoup | |
| # Function to calculate the distance between two latitude/longitude points |
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
| ffmpeg -i INPUT.MOV -vf 'setpts=0.5*PTS,fps=30' OUTPUT.GIF |
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
| read tr_url && curl -I -s $tr_url | rg location | cut -d' ' -f2 | tr -d '\r\n' | read url && response=$(curl -s "$(echo $url | sed -E 's@(http.*)(www\.)?torah@\1api.torah@')") && video_url=$(echo "$response" | jq -r '.video_url') && title=$(echo "$response" | jq -r '.title') && extension="${video_url##*.}" && filename="${title}.${extension}" && curl "$video_url" -o "$filename" |
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
| # Download in m4a format | |
| --format="ba" | |
| --extract-audio | |
| --audio-format m4a | |
| # Continue downloading if the download failed previously | |
| --continue | |
| --no-overwrites | |
| # Set track number, album name, and artist name metadata tags |
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
| 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" |
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
| (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 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
| # 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 |
NewerOlder