Added lunar phase and 'zmoji' plugins.

This commit is contained in:
Sean Carolan 2014-03-01 21:19:04 -05:00
commit d09385ae19
7 changed files with 224 additions and 19 deletions

View file

@ -6,7 +6,7 @@ alias bu="bundle update"
# The following is based on https://github.com/gma/bundler-exec
bundled_commands=(annotate berks cap capify cucumber foodcritic foreman guard jekyll kitchen knife middleman nanoc rackup rainbows rake rspec ruby shotgun spec spin spork strainer tailor taps thin thor unicorn unicorn_rails puma)
bundled_commands=(annotate berks cap capify cucumber foodcritic foreman guard jekyll kitchen middleman nanoc rackup rainbows rake rspec ruby shotgun spec spin spork strainer tailor taps thin thor unicorn unicorn_rails puma)
# Remove $UNBUNDLED_COMMANDS from the bundled_commands list
for cmd in $UNBUNDLED_COMMANDS; do

View file

@ -1,14 +1,3 @@
function cabal_sandbox_info() {
cabal_files=(*.cabal(N))
if [ $#cabal_files -gt 0 ]; then
if [ -f cabal.sandbox.config ]; then
echo "%{$fg[green]%}sandboxed%{$reset_color%}"
else
echo "%{$fg[red]%}not sandboxed%{$reset_color%}"
fi
fi
}
function _cabal_commands() {
local ret=1 state
_arguments ':subcommand:->subcommand' && ret=0

View file

@ -1,7 +1,7 @@
function gi() { curl http://www.gitignore.io/api/$@ ;}
function gi() { curl http://gitignore.io/api/$@ ;}
_gitignireio_get_command_list() {
curl -s http://www.gitignore.io/api/list | tr "," "\n"
curl -s http://gitignore.io/api/list | tr "," "\n"
}
_gitignireio () {

View file

@ -0,0 +1,52 @@
# -----------------------------------------------------------------------------
# FILE: moonphase.plugin.zsh
# DESCRIPTION: The current moon phase for your terminal prompt. Uses a very
# simple calculation based upon a known new moon date. Sorry
# time travelers, this won't work before 1970.
# Just drop '$(printmoon)' into your PROMPT where you want the
# moon emoji to appear.
# AUTHOR: Sean Carolan (scarolan[at]gmail.com)
# VERSION: 1.0.0
# -----------------------------------------------------------------------------
function printmoon() {
# Accepts a time in days between 0 and 29.53
# Defaults to the current moon phase
if (($+1)); then
phase=$1
else
phase=$(calcphase $(date +%s))
fi
if [[ $phase > 0 ]] && [[ $phase < 1 ]]; then
moon="🌑 "
elif [[ $phase > 1 ]] && [[ $phase < 7.38 ]]; then
moon="🌒 "
elif [[ $phase > 7.38 ]] && [[ $phase < 8.38 ]]; then
moon="🌓 "
elif [[ $phase > 8.38 ]] && [[ $phase < 14.77 ]]; then
moon="🌔 "
elif [[ $phase > 14.77 ]] && [[ $phase < 15.77 ]]; then
moon="🌕 "
elif [[ $phase > 15.77 ]] && [[ $phase < 22.15 ]]; then
moon="🌖 "
elif [[ $phase > 22.15 ]] && [[ $phase < 23.15 ]]; then
moon="🌗 "
elif [[ $phase > 23.15 ]] && [[ $phase < 24.15 ]]; then
moon="🌗 "
elif [[ $phase > 24.15 ]] && [[ $phase < 29.53 ]]; then
moon="🌘 "
fi
echo $moon
}
function calcphase() {
# Accepts a Unix epoch date, in seconds.
target_date=$1
# Fixed lunar phase in seconds
lp=2551443
# This is the date of a known new moon: January 7, 1970 20:35 GMT
new_moon=592500
(( phase=(($target_date - $new_moon) % $lp) / (24.0 * 3600) ))
echo $phase
}

View file

@ -1,7 +1,3 @@
# Thank you Jim for everything you contributed to the Ruby and open source community
# over the years. We will miss you dearly.
alias jimweirich="rake"
alias rake="noglob rake" # allows square brackts for rake task invocation
alias brake='noglob bundle exec rake' # execute the bundled rake gem
alias srake='noglob sudo rake' # noglob must come before sudo

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long