Calling Visual Studio Code from command line. source
# VS Code
## old version
code() {
if [[ $# = 0 ]];
then
echo $PWD
open -a "Visual Studio Code" $PWD
else
[[ $1 = /* ]] && F="$1" || F="$PWD/${1#./}"
echo $F
open -a "Visual Studio Code" $F
fi
}
## newer version
code () {
VSCODE_CWD="$PWD" open -n -b "com.microsoft.VSCode" --args $* ;
}Trim song using ffmpeg.
source
# trimmer <song> <start at(sec)> <duration(sec)>
# trimmed file is named "cut_" as prefix of the old file name, feel free to get rid of it.
trimmer() {
ffmpeg -i "$1" -ss "$2" -t "$3" -acodec copy cut_"$1"
}