Bash: some+ aliases generator + few tweaks.
This commit is contained in:
@ -77,7 +77,7 @@ done
|
||||
alias dos2unix="perl -pi -e 's/\r\n?/\n/g'"
|
||||
|
||||
# Password generator
|
||||
password() { openssl rand -base64 ${1:-8} | c; }
|
||||
password() { openssl rand -base64 ${1:-8}; }
|
||||
|
||||
# Show $PATH in a readable way
|
||||
alias path='echo -e ${PATH//:/\\n}'
|
||||
@ -88,8 +88,8 @@ alias npm-release='npm version minor -m "%s"'
|
||||
|
||||
# Grunt
|
||||
alias gw="grunt deploy --debug && grunt watch --debug"
|
||||
alias gs="grunt deploy --debug && grunt serve --debug"
|
||||
gi() { grunt init:$@; }
|
||||
alias gs="grunt deploy --debug && grunt watch server --debug"
|
||||
gi() { grunt-init $@; }
|
||||
|
||||
# Magic Project Opener
|
||||
function proj { cd "$("$HOME/dotfiles/bin/opener.py" "$HOME/Dropbox/Projects" $1 -w project $2)"; }
|
||||
|
@ -40,13 +40,13 @@ function headers() {
|
||||
# Escape UTF-8 characters into their 3-byte format
|
||||
function escape() {
|
||||
printf "\\\x%s" $(printf "$@" | xxd -p -c1 -u)
|
||||
echo # newline
|
||||
echo
|
||||
}
|
||||
|
||||
# Get a character’s Unicode code point: £ → \x00A3
|
||||
function codepoint() {
|
||||
perl -e "use utf8; print sprintf('\x%04X', ord(\"$@\"))"
|
||||
echo # newline
|
||||
echo
|
||||
}
|
||||
|
||||
# Remove screenshots from desktop
|
||||
@ -238,3 +238,8 @@ function rasterize() {
|
||||
echo "Screenshot saved to: $filename"
|
||||
fi
|
||||
}
|
||||
|
||||
# Add special aliases that will copy result to clipboard (escape → escape+)
|
||||
for cmd in password hex2hsl hex2rgb escape codepoint; do
|
||||
eval "function $cmd+() { $cmd \$@ | c; }"
|
||||
done
|
||||
|
Reference in New Issue
Block a user