Skip to content

Instantly share code, notes, and snippets.

@alexandre
Created September 16, 2014 09:17
Show Gist options
  • Save alexandre/f2982ff524fd0a20127f to your computer and use it in GitHub Desktop.
Save alexandre/f2982ff524fd0a20127f to your computer and use it in GitHub Desktop.
a piece of my .bashrc
export PATH=$PATH:~/bin/:~/bin/node/bin/
alias dev='cd $HOME/Devel'
alias ls='ls --color'
alias ll='ls -l'
alias ltr='ls -ltr'
alias la='ls -a'
alias tibia='cd $HOME/Games/Tibia;./Tibia'
alias dwn='cd $HOME/Downloads'
alias git='hub'
function color_my_prompt {
local __user_and_host="\[\033[01;32m\]\u@\h"
local __cur_location="\[\033[01;34m\]\w"
local __git_branch_color="\[\033[31m\]"
#local __git_branch="\`ruby -e \"print (%x{git branch 2> /dev/null}.grep(/^\*/).first || '').gsub(/^\* (.+)$/, '(\1) ')\"\`"
local __git_branch='`git branch 2> /dev/null | grep -e ^* | sed -E s/^\\\\\*\ \(.+\)$/\(\\\\\1\)\ /`'
local __prompt_tail="\[\033[35m\]$"
local __last_color="\[\033[00m\]"
export PS1="$__user_and_host $__cur_location $__git_branch_color$__git_branch$__prompt_tail$__last_color "
}
color_my_prompt
youtube-mp3 () {
# get mp3 from youtube
command -v ffmpeg >/dev/null && youtube-dl --restrict-filenames --extract-audio --audio-format=mp3 --audio-quality 320k "${1}"
[[ $? = 1 ]] && echo "instale o programa ffmpeg para poder converter para mp3"
}
function strip(){
echo "$1" | sed 's/ /_/g'
}
function remove_acc(){
echo "$1" | iconv -f "utf-8" -t "ascii//TRANSLIT"
}
# Instalacao das Funcoes ZZ (www.funcoeszz.net)
export ZZOFF="" # desligue funcoes indesejadas
export ZZPATH="/home/alexandre/Downloads/funcoeszz" # script
source "$ZZPATH"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment