From 7bf9111eb5ab4d4f6532221797abd2b0a63d1f17 Mon Sep 17 00:00:00 2001 From: Gregory Eremin Date: Fri, 19 Apr 2013 22:11:41 +0400 Subject: [PATCH] Dock delay, git achievements and more --- git/gitconfig | 5 +++-- git/gitignore | 1 + iterm2/com.googlecode.iterm2.plist | 12 ++++++------ ruby/config.zsh | 7 ++++++- zsh/aliases.zsh | 23 ++++++++++++++++++----- zsh/functions/dock-delay | 1 + zsh/paths.zsh | 3 ++- zsh/prompt.zsh | 8 +++++++- zsh/zshrc | 1 + 9 files changed, 45 insertions(+), 16 deletions(-) create mode 100644 zsh/functions/dock-delay diff --git a/git/gitconfig b/git/gitconfig index 57354bc..b556917 100644 --- a/git/gitconfig +++ b/git/gitconfig @@ -9,8 +9,7 @@ co = checkout br = checkout -b st = status -sb - ci = commit -m - ca = commit -am + ci = commit up = !sh -c 'git pull --rebase --prune && git log --pretty=format:\"%Cred%ae %Creset- %C(yellow)%s %Creset(%ar)\" HEAD@{1}..' [color] diff = auto @@ -30,3 +29,5 @@ prompt = false [help] autocorrect = 1 +[achievement] + upload = true diff --git a/git/gitignore b/git/gitignore index 0dcbe49..e54c857 100644 --- a/git/gitignore +++ b/git/gitignore @@ -2,3 +2,4 @@ .bundle .rake_tasks *.sublime-* +vendor/gems diff --git a/iterm2/com.googlecode.iterm2.plist b/iterm2/com.googlecode.iterm2.plist index 60cb966..9b6b6ac 100644 --- a/iterm2/com.googlecode.iterm2.plist +++ b/iterm2/com.googlecode.iterm2.plist @@ -1516,7 +1516,7 @@ FocusFollowsMouse FsTabDelay - 1 + 0.10000000149011612 GlobalKeyMap 0x9-0x40000 @@ -1620,7 +1620,7 @@ HideScrollbar HideTab - + HighlightTabLabels HotKeyBookmark @@ -1688,9 +1688,9 @@ NSWindow Frame NSColorPanel 307 274 214 309 0 0 1440 878 NSWindow Frame Preferences - 304 393 924 485 0 0 1440 878 + 304 393 924 485 0 0 1440 900 NSWindow Frame iTerm Window 0 - 419 240 570 426 0 0 1440 878 + 0 420 570 448 0 0 1440 878 NSWindow Frame iTerm Window 1 0 452 570 426 0 0 1440 878 NSWindow Frame iTerm Window 2 @@ -2479,7 +2479,7 @@ SUHasLaunchedBefore SULastCheckTime - 2013-03-13T09:26:34Z + 2013-04-16T20:31:17Z SavePasteHistory Show Toolbelt @@ -2529,6 +2529,6 @@ findRegex_iTerm iTerm Version - 1.0.0.20130302 + 1.0.0.20130319 diff --git a/ruby/config.zsh b/ruby/config.zsh index 54bf592..07a43aa 100644 --- a/ruby/config.zsh +++ b/ruby/config.zsh @@ -1,3 +1,8 @@ export RUBYOPT="-Ku" -export RUBY_GC_MALLOC_LIMIT=60000000 + +export RUBY_HEAP_MIN_SLOTS=800000 +export RUBY_HEAP_FREE_MIN=100000 export RUBY_FREE_MIN=200000 +export RUBY_HEAP_SLOTS_INCREMENT=300000 +export RUBY_HEAP_SLOTS_GROWTH_FACTOR=1 +export RUBY_GC_MALLOC_LIMIT=79000000 diff --git a/zsh/aliases.zsh b/zsh/aliases.zsh index 9f2e124..1296160 100644 --- a/zsh/aliases.zsh +++ b/zsh/aliases.zsh @@ -4,18 +4,31 @@ alias please="sudo" # Ruby & Rails alias b="bundle exec" -alias mkbundle="bundle install --path .bundle" -alias ss="git up && bundle && bundle exec rake db:migrate" -alias rc="bundle exec rails c" -alias rs="bundle exec rails s" + +alias rails="bundle exec rails" +alias rake="bundle exec rake" +alias rspec="bundle exec rspec" +alias cap="bundle exec cap" +alias cucumber="bundle exec cucumber" + +alias mkbundle="bundle install --path vendor/gems" +alias ss="git up && bundle --quiet && bundle exec rake db:migrate" +alias rc="rails c" +alias rs="rails s" +alias rs1="rails s -p3001" +alias rs2="rails s -p3002" +alias fs="bundle exec foreman start" # Git +alias git="git-achievements" alias gl="git log --graph --pretty=format:'%Cred%h%Creset %an: %s - %Creset %C(yellow)%d%Creset %Cgreen(%cr)%Creset' --abbrev-commit --date=relative" -alias gc="git commit -m" +alias gc="git ci -m" alias ga="git add -u && git add . && git st" alias gs="git st" alias gd="git diff" alias gp="git push" +alias gu="gut up" +alias gb="git br" # OSX alias hidedesktop="defaults write com.apple.finder CreateDesktop -bool false && killall Finder" diff --git a/zsh/functions/dock-delay b/zsh/functions/dock-delay new file mode 100644 index 0000000..f7701b1 --- /dev/null +++ b/zsh/functions/dock-delay @@ -0,0 +1 @@ +defaults write com.apple.Dock autohide-delay -float $1 && killall Dock diff --git a/zsh/paths.zsh b/zsh/paths.zsh index 87b30a2..7952142 100644 --- a/zsh/paths.zsh +++ b/zsh/paths.zsh @@ -1,3 +1,4 @@ export PATH=~/.dotfiles/bin:$PATH -export PATH=~/.apps/tunneler/bin:$PATH +export PATH=/usr/local/share/npm/bin:$PATH +export PATH=~/.misc/git-achievements:$PATH export PATH=/Applications/Sublime\ Text\ 3.app/Contents/SharedSupport/bin:$PATH diff --git a/zsh/prompt.zsh b/zsh/prompt.zsh index a544626..2fd034c 100644 --- a/zsh/prompt.zsh +++ b/zsh/prompt.zsh @@ -22,6 +22,12 @@ git_dirty() { fi } +git_need_commit() { + git diff --stat 2>/dev/null | awk -F',' '/files? changed/ { lc += $2 + $3 } END { + if (lc > 100) print "\n%F{005}Y U NO COMMIT!?%f" + }' +} + git_prompt_info () { ref=$($git symbolic-ref HEAD 2>/dev/null) || return echo "${ref#refs/heads/}" @@ -57,7 +63,7 @@ directory_name(){ echo "%F{003%}%1/%\%f" } -export PROMPT=$'\n$(directory_name)$(git_dirty)$(need_push) › ' +export PROMPT=$'\n$(directory_name)$(git_dirty)$(need_push)$(git_need_commit) › ' set_prompt () { export RPROMPT="$(rb_prompt)" } diff --git a/zsh/zshrc b/zsh/zshrc index 96f1e1a..709e867 100644 --- a/zsh/zshrc +++ b/zsh/zshrc @@ -23,3 +23,4 @@ compinit ### Added by the Heroku Toolbelt export PATH="/usr/local/heroku/bin:$PATH" +export PATH="/usr/local/sbin:$PATH"