<%* let title = tp.file.title if (title.startsWith("Untitled")) { title = await tp.system.prompt("Title"); await tp.file.rename(title); } tR += "---" %> Status: #inbox Title: <%* tR += title %>
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
youtube-dl -i -r 3M -s --prefer-free-formats --embed-thumbnail --yes-playlist https://www.youtube.com/playlist?list=PLZ_57qANz90qDJS1MeqMrXtaR7y4hwhOC | |
yt-dlp -F https://www.youtube.com/playlist?list=PLZ_57qANz90qDJS1MeqMrXtaR7y4hwhOC | |
yt-dlp -f 299 --embed-thumbnail https://www.youtube.com/playlist?list=PLZ_57qANz90qDJS1MeqMrXtaR7y4hwhOC | |
https://www.youtube.com/watch?v=_9aUy56n-yI&list= |
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
# Source: https://stackoverflow.com/questions/3953645/ternary-operator-in-bash | |
[[ $b = 5 ]] && a="$c" || a="$d" | |
# or | |
a=$([ "$b" == 5 ] && echo "$c" || echo "$d") |
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
read USERNAME | |
echo $USERNAME | |
# Hidden | |
read -s PASSWORD | |
echo $PASSWORD |
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
# Source: https://stackoverflow.com/questions/6561072/why-wont-bash-wait-for-read-when-used-with-curl | |
read git_name < /dev/tty # per-command I/O redirection | |
#read git_name < /dev/console # alternative | |
exec 0</dev/tty # script-wide I/O redirection | |
read git_name |
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
STATUSCODE=$(curl --silent --output result.txt --write-out "%{http_code}" --request GET URL) | |
cat result.txt | |
if test $STATUSCODE -ne 200; then | |
exit 1 | |
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
ffmpeg -i "<name>.flac" -acodec alac "<name>.m4a" |
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
if [[ $? -eq 22 ]]; | |
then | |
// code | |
else | |
// code | |
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
export const asyncWrap = (promise: Promise<any>) => | |
promise.then((res) => ({ res, error: null })).catch((error) => ({ res: null, error })); |
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
import { IBasicObject } from './objects'; | |
export interface IValidator<T> { | |
run: IValidatorRun<T>; | |
concat: (other: IValidator<T>) => IValidator<T>; | |
} | |
export type ValidatorTypes = [] | undefined | string; | |
export type IValidatorRun<T> = (key: string, x: T, rec: IBasicObject) => IValidator<T>; |
NewerOlder