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
# Configure Git PS1 | |
GIT_PS1_DESCRIBE_STYLE='describe' | |
GIT_PS1_SHOWDIRTYSTATE=true | |
GIT_PS1_SHOWUNTRACKEDFILES=true | |
GIT_PS1_SHOWSTASHSTATE=true | |
GIT_PS1_SHOWCOLORHINTS=true | |
GIT_PS1_HIDE_IF_PWD_IGNORED=true | |
GIT_PS1_SHOWUPSTREAM='legacy' | |
#GIT_PS1_STATESEPARATOR=' ' |
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
#!/usr/bin/env bash | |
# pretty bash prompt | |
# Based on twolfson's sexy bash prompt (https://github.com/twolfson/sexy-bash-prompt) | |
# If we are on a colored terminal | |
if tput setaf 1 &> /dev/null; then | |
# Reset the shell from our `if` check | |
tput sgr0 &> /dev/null | |
# If you would like to customize your colors, use |
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
# Usually I just include that in my ~/.bashrc | |
# Usage : adb_pull_db_pre_lollipop com.package.name file.db | |
function adb_pull_db_pre_lollipop () { | |
if [[ -z "$1" ]]; then | |
echo "Usage : adb_pull_db_pre_lollipop com.package.name file.db" | |
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
######################################################################### | |
# Kill a running android process | |
function adb_kill { | |
if [[ -z $1 ]]; then | |
echo "Usage : adb_kill com.example.application" | |
else | |
process=`adb shell ps | grep $1` | |
if [[ -n $process ]]; then |
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
function adb_toggle_airplane_mode { | |
# Open airplane mode settings | |
adb shell am start -a android.settings.AIRPLANE_MODE_SETTINGS | |
# Key UP to focus on the first switch = toggle airplane mode, then sleep 100ms | |
adb shell input keyevent 19 ; sleep 0.1 | |
# Key CENTER to toggle the first switch, then sleep 100ms | |
adb shell input keyevent 23 ; sleep 0.1 |
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
# usage export_svg source.svg output.png sizedp | |
function export_svg() { | |
mkdir -p "drawable-ldpi" | |
size=$(($3 * 3 / 4)) | |
inkscape -z -e "drawable-ldpi/$2" -w $size -h $size "$1" | |
mkdir -p "drawable-mdpi" | |
size=$(($3)) | |
inkscape -z -e "drawable-mdpi/$2" -w $size -h $size "$1" | |
mkdir -p "drawable-hdpi" |
OlderNewer