Skip to content

Instantly share code, notes, and snippets.

@DanielGrech
Last active March 12, 2021 03:25
Show Gist options
  • Save DanielGrech/9542095 to your computer and use it in GitHub Desktop.
Save DanielGrech/9542095 to your computer and use it in GitHub Desktop.
Bash profile with some useful shortcuts I like
export BASH_SILENCE_DEPRECATION_WARNING=1
export HGEDITOR=nano
export PS1='\w: '
# important
alias shrug="printf '¯\_(ツ)_/¯' | pbcopy"
alias g="./gradlew"
# Git
alias gp="git push"
alias gm="git commit -m "
alias gs="git status"
alias ga="git add"
alias gb="git branch"
alias gl="git log --pretty=oneline --abbrev-commit"
# Random
alias ls="ls -1AGhpl"
alias ..="cd .."
alias ...="cd ../.."
alias ....="cd ../../.."
alias .....="cd ../../../.."
alias subl="/Applications/Sublime\ Text.app/Contents/SharedSupport/bin/subl"
alias c='pygmentize -O style=monokai -f console256 -g'
alias copy='pbcopy'
alias ql='qlmanage -p 2>/dev/null'
alias ips="ifconfig -a | perl -nle'/(\d+\.\d+\.\d+\.\d+)/ && print $1'"
alias myip="dig +short myip.opendns.com @resolver1.opendns.com"
export CLICOLOR=1
export LSCOLORS=GxFxCxDxBxegedabagaced
# android
alias lc="adb logcat"
alias fuckadb="adb kill-server && adb start-server"
alias adbd="adb devices"
alias devices="adb devices"
alias emulators="emulator -list-avds"
function pdfconcat {
TARGET_FILE=$1
# Drop first positional argument and move others down (Eg $2 -> $1, $3 -> $2, etc)
shift
"/System/Library/Automator/Combine PDF Pages.action/Contents/Resources/join.py" -o $TARGET_FILE "$@"
}
function enter_clean_statusbar {
adb shell am broadcast -a com.android.systemui.demo -e command battery -e plugged false -e level 100
# display time 10:00
adb shell am broadcast -a com.android.systemui.demo -e command clock -e hhmm 1000
# Display full mobile data without type
adb shell am broadcast -a com.android.systemui.demo -e command network -e mobile show -e level 4 -e datatype false
# Hide notifications
adb shell am broadcast -a com.android.systemui.demo -e command notifications -e visible false
# Show full battery but not in charging state
adb shell am broadcast -a com.android.systemui.demo -e command battery -e plugged false -e level 100
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment