-
Notifications
You must be signed in to change notification settings - Fork 1
/
.aliases
56 lines (45 loc) · 947 Bytes
/
.aliases
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
alias l="eza -l --git"
alias be="bundle exec"
mcd () {
mkdir "$1" && cd "$1"
}
ffcut() {
usage_msg="Example usage: ffcut \$IN_FILE 00:01:23-00:59:59 \$OUT_FILE"
if [ -z "$1" ]; then
echo "$usage_msg"
return 0
fi
in_file=$1
IFS="-" read -r start_stamp end_stamp <<< "$2"
if [[ -z $start_stamp && -z $end_stamp ]]; then
echo "$usage_msg"
return 1
fi
if [ -n "$3" ]; then
out_file="$3"
else
extension="${in_file##*.}"
filename="${in_file%.*}"
out_file="${filename}_cut.$extension"
fi
args=( "-i" "$in_file" "-c" "copy" )
if [ -n "$start_stamp" ]; then
args+=( "-ss" "$start_stamp" )
fi
if [ -n "$end_stamp" ]; then
args+=( "-to" "$end_stamp" )
fi
args+=( "$out_file" )
set -x
ffmpeg "${args[@]}"
set +x
}
case "$OSTYPE" in
darwin*)
alias ls='ls -G'
;;
linux*)
alias ls='ls --color=auto'
;;
esac
[[ -f ~/.aliases.local ]] && . ~/.aliases.local