-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
shell-aliases
65 lines (53 loc) · 1.67 KB
/
shell-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
57
58
59
60
61
62
63
64
65
# Shortcuts
alias cls="clear"
alias ll="ls -alF"
alias la="ls -A"
alias l="ls -CF"
# General
alias g="git"
alias cdr='cd "$(git rev-parse --show-toplevel)"'
alias refreshenv='test -r $HOME/.env.local && source $HOME/.env.local'
# Laravel
alias a="php artisan"
alias artisan="php artisan"
alias p="clear && if [[ -f vendor/bin/pest ]]; then vendor/bin/pest; else vendor/bin/phpunit; fi"
alias tinker="php artisan tinker"
# PHP
alias c="php /usr/local/bin/composer"
alias cfresh="rm -rf vendor/ composer.lock && c i"
alias c-timeout="composer-switch-timeout"
# JavaScript
alias n="npm"
alias nfresh="rm -rf node_modules/ package-lock.json && npm i"
# Tmux
alias ta="tmux attach -t"
alias tl="tmux list-sessions"
alias tn="tmux new -s"
# MQTT
alias mqtt_pub="mqttx pub -h '${MQTT_HOST}' -u '${MQTT_USER}' -P '${MQTT_PASS}'"
alias mqtt_sub="mqttx sub -h '${MQTT_HOST}' -u '${MQTT_USER}' -P '${MQTT_PASS}'"
# Functions
composer-link () {
if [ -z "$2" ]; then
repo_name="$(basename $1)"
else
repo_name="$2"
fi
composer config repositories.${repo_name} '{"type": "path", "url": "'$1'"}' --file composer.json
}
composer-switch-timeout () {
original_timeout="${COMPOSER_PROCESS_TIMEOUT:-300}"
if [[ ! -z $1 ]]; then
current_timeout="${1}"
echo "Switching Composer process timeout from ${original_timeout}ms to ${current_timeout}ms"
else
current_timeout="${original_timeout}"
echo "Current timeout is ${current_timeout}ms"
fi
export COMPOSER_PROCESS_TIMEOUT="${current_timeout}"
}
sci () {
curl -sL "https://styleci.io/analyses/$1/diff" | git apply --ignore-whitespace
}
# Include local shell aliases
test -r $HOME/.shell-aliases.local && . $HOME/.shell-aliases.local