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
$tdc="D:\uncategorized\" | |
do { | |
$dirs = Get-ChildItem $tdc -Directory -Recurse | Where { (Get-ChildItem $_.FullName).count -eq 0 } | Select -ExpandProperty FullName | |
foreach($dir in $dirs) { | |
Remove-Item "$dir" # Use -Force for removing hidden items | |
} | |
} while ($dirs.count -gt 0) |
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 replaceHashComment(line: string): string { | |
const makeInlineComment = (comment: string) => { | |
const value = comment?.trim(); | |
if (!value) { | |
return '<##>'; | |
} | |
return `<# ${value} #>`; | |
}; | |
const parts = line.split('#'); | |
if (parts.length === 1) { // No hash |
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 bash | |
readonly TARGET_ENCODING='UTF-8' # unicode | |
readonly FILE_EXTENSION='srt' | |
# readonly TARGET_ENCODING='UTF-16' | |
files=$(find . -type f -iname "*.$FILE_EXTENSION") | |
for file in $files | |
do | |
echo "Processing \"$file\"." |
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 bash | |
# https://privacy.sexy — v0.12.2 — Fri, 08 Sep 2023 14:58:37 GMT | |
if [ "$EUID" -ne 0 ]; then | |
script_path=$([[ "$0" = /* ]] && echo "$0" || echo "$PWD/${0#./}") | |
sudo "$script_path" || ( | |
echo 'Administrator privileges are required.' | |
exit 1 | |
) | |
exit 0 | |
fi |
OlderNewer