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
#!/bin/bash | |
url="https://github.com/<owner>/<repo>/releases/latest/download/<file_name_with_extension>" | |
current_file="<filename>.<extension>" | |
if [ -f "$current_file" ]; then | |
new_checksum=$(curl -L "$url.sha256" | cut -d " " -f 1) | |
current_checksum=$(shasum -a 256 "$current_file" | cut -d " " -f 1) | |
# Compare the two checksums |
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
const planCards = document.querySelectorAll('#service-list .uk-card'); | |
const cardDetails = []; | |
function convertPersianNumbersToEnglish(text) { | |
return text.replace(/[۰-۹]/g, (char) => String.fromCharCode(char.charCodeAt(0) - '۰'.charCodeAt(0) + '0'.charCodeAt(0))); | |
} | |
planCards.forEach(card => { | |
const title = convertPersianNumbersToEnglish(card.querySelector('.uk-card-title').textContent.trim()); | |
const description = convertPersianNumbersToEnglish(card.querySelector('.uk-card-body p').textContent.trim()); |
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
# Sort first by Word Count and then Characters count - only if it's is <String, String> | |
jq 'to_entries | map({ key: .key, value: .value, word_count: (.value | split(" ") | length), char_count: (.value | length) }) | sort_by(.word_count, .char_count) | from_entries' en.json > sorted_en.json && mv sorted_en.json en.json | |
# Sort first by Word Count, then by Characters count, and then alphabetical - skips collections that are at end | |
jq '. | to_entries | reduce .[] as $entry ( {}; if $entry.value | type == "object" then .collections += [$entry] else .non_collections += [$entry] end ) | (.non_collections | map({ key: .key, value: .value, word_count: (.value | split("\n") | map(split(" ")) | map(length) | add), char_count: (.value | length) }) | sort_by(.word_count, .char_count, .key)) + .collections | from_entries' en.json > sorted_en.json && mv sorted_en.json en.json |
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
#!/bin/bash | |
ARIA_URL="http://127.0.0.1:6800/jsonrpc" | |
SECRET="secret" | |
# Step 1: Retrieve GIDs of failed downloads | |
response=$(curl -s -X POST $ARIA_URL \ | |
-H "Content-Type: application/json" \ | |
-d '{ | |
"jsonrpc": "2.0", |
OlderNewer