Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge branch 'jqr'

Conflicts:
	Rakefile
	bash_profile
	bash_profile.d/git.sh
	bash_profile.d/mac.sh
	bash_profile.d/prompt.sh
	bash_profile.d/ruby.sh
	bash_profile.d/standard_improvements.sh
	railsrc.d/prompt.rb
	rvmrc
  • Loading branch information...
commit b501a30e20c27acddb4ced35d0475789de9c506b 2 parents 46bc1d1 + c2cd2ac
Darren Boyd authored
10 Rakefile
View
@@ -33,11 +33,7 @@ task :install do
matcher = Regexp.new(Regexp.escape(lines.first) + '.*?' + Regexp.escape(lines.last), Regexp::MULTILINE)
- if File.exist?("#{home}/.#{file}")
- contents = File.read("#{home}/.#{file}")
- else
- contents = ""
- end
+ contents = File.exists?("#{home}/.#{file}") ? File.read("#{home}/.#{file}") : ''
puts "Insert content into #{home}/.#{file}"
output =
@@ -55,4 +51,6 @@ task :install do
puts "Use ~/.bash_profile.d/local.sh for machine specific bash settings."
-end
+end
+
+task :default => :install
8 bash_profile
View
@@ -1,12 +1,16 @@
+export PATH=~/bin:~/.gem/ruby/1.8/bin:~/.seeds/bin:/usr/local/bin:/usr/local/sbin:$PATH
+
for a in `ls $HOME/.bash_profile.d/*.sh`; do
source $a
done
-export VISUAL='mate -w'
+export VISUAL=`first_of "mate -w" "nano -w" vi`
export EDITOR=$VISUAL
-export GIT_EDITOR='mate -wl1'
+export GIT_EDITOR=`first_of "mate -wl1" "nano -w" vi`
export GEMEDITOR='mate'
export PATH=~/bin:/usr/local/bin:$PATH
+ulimit -n 10240
+
if [[ -s ~/.rvm/scripts/rvm ]] ; then source ~/.rvm/scripts/rvm ; fi
12 bash_profile.d/first_of.sh
View
@@ -0,0 +1,12 @@
+# Returns the first command that exists, or exit status 1.
+#
+# EDITOR=`first_of "mate -w" "nano -w" vi`
+first_of() {
+ if [ -n "$1" ]; then
+ local arg=$1
+ shift
+ command -v $arg >> /dev/null && echo $arg || first_of "$@"
+ else
+ exit 1
+ fi
+}
34 bash_profile.d/git.sh
View
@@ -2,6 +2,8 @@
# http://www.jukie.net/~bart/blog/pimping-out-git-log
alias gl="git log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%an %cr)%Creset' --abbrev-commit --date=relative"
alias glp='gl -p'
+alias glb='gl --branches'
+alias glm="gl master..."
alias gst='git status'
alias gs='git status'
@@ -15,6 +17,8 @@ complete -o default -o nospace -F _git_diff gdh
alias gdm='git diff | mate'
alias gdcm='git diff --cached | mate'
+alias gdm='gd master...'
+
alias ga='git add'
complete -o default -o nospace -F _git_add ga
alias gap='git add -p'
@@ -33,8 +37,21 @@ alias gpru='gp && rake && gu'
alias gri='git rebase -i origin/master^'
alias grc='git rebase --continue'
-alias gb='git branch'
+alias gb='git branch -v'
complete -o default -o nospace -F _git_branch gb
+alias gbu='git branch -v --no-merged'
+alias gbum='git branch -v --no-merged master'
+
+alias gbr='git branch -v -r'
+alias gbru='git branch -v -r --no-merged'
+alias gbrum='git branch -v -r --no-merged master'
+alias gba='git branch -v -a'
+alias gbau='git branch -v -a --no-merged'
+alias gbaum='git branch -v -a --no-merged master'
+
+alias gbdm='git branch --merged | grep -v "*" | xargs -n 1 git branch -d'
+
+alias grpo='git remote prune origin'
alias gitx='gitx --all'
@@ -47,12 +64,15 @@ ggc() {
echo "Cleaned up $((before-after)) kb."
}
-# Might use this, but we already have grb
-# grb() {
-# git push origin HEAD:refs/heads/$1
-# git fetch origin &&
-# git checkout -b $1 --track origin/$1
-# }
+grb() {
+ if [ -n "$1" ]; then
+ git push origin HEAD:refs/heads/$1
+ git fetch origin &&
+ git checkout -b $1 --track origin/$1
+ else
+ git branch --set-upstream `current_git_branch` origin/`current_git_branch`
+ fi
+}
git_mode() {
# https://github.com/hashrocket/dotmatrix/commit/d888bfee55ca430ba109e011d8b0958e810f799a
1  bash_profile.d/node.sh
View
@@ -0,0 +1 @@
+export NODE_PATH="/usr/local/lib/node"
1  bash_profile.d/pdsh.sh
View
@@ -0,0 +1 @@
+export PDSH_SSH_ARGS_APPEND="-o StrictHostKeyChecking=no"
8 bash_profile.d/ruby.sh
View
@@ -34,6 +34,7 @@ script_rails() {
alias sc='script_rails console'
alias sg='script_rails generate'
+alias sd='script_rails destroy'
alias ss='script_rails server'
alias sdc='script_rails dbconsole -p'
@@ -56,3 +57,10 @@ alias rak='ack --ruby --cucumber'
alias wak='ack --web'
alias rak-no-test='ack --ignore-dir=test --ruby'
alias rgrep='grep -rnH'
+
+# decent REE config for faster local development
+export RUBY_HEAP_MIN_SLOTS=800000
+export RUBY_HEAP_FREE_MIN=100000
+export RUBY_HEAP_SLOTS_INCREMENT=300000
+export RUBY_HEAP_SLOTS_GROWTH_FACTOR=1
+export RUBY_GC_MALLOC_LIMIT=79000000
1  bash_profile.d/standard_aliases.sh
View
@@ -21,3 +21,4 @@ export LSCOLORS=gxgxcxdxbxegedabagacad
alias e='$EDITOR'
alias nano='nano -w'
+alias o='open'
3  bash_profile.d/standard_improvements.sh
View
@@ -1,6 +1,7 @@
alias mkdir='mkdir -p'
alias recent='ls -lAt | head'
alias old='ls -lAt | tail'
+alias psg='ps aux | grep'
touch() {
dir=`expr "$1" : '\(.*\/\)'`
@@ -19,6 +20,6 @@ myip() {
_ssh_hosts() {
grep "Host " ~/.ssh/config 2> /dev/null | sed -e "s/Host //g"
# http://news.ycombinator.com/item?id=751220
- cat ~/.ssh/known_hosts | cut -f 1 -d ' ' | sed -e s/,.*//g | uniq | grep -v "\["
+ cat ~/.ssh/known_hosts 2> /dev/null | cut -f 1 -d ' ' | sed -e s/,.*//g | uniq | grep -v "\["
}
complete -W "$(_ssh_hosts)" ssh
1  gitignore
View
@@ -1,2 +1,3 @@
.DS_Store
Thumbs.db
+.redcar
4 railsrc
View
@@ -6,6 +6,8 @@ def detect_rails_root
end
end
-DETECTED_RAILS_ROOT = detect_rails_root
+if detect_rails_root
+ DETECTED_RAILS_ROOT = detect_rails_root
+end
require_rb_files_from(File.join(ENV['HOME'], '.railsrc.d'))
22 railsrc.d/change_log.rb
View
@@ -1,16 +1,18 @@
# From http://github.com/ryanb/dotfiles/tree/master/railsrc
+require 'active_record'
-def change_log(stream)
+def active_record_log(stream)
ActiveRecord::Base.logger = Logger.new(stream)
- ActiveRecord::Base.clear_active_connections!
+ ActiveRecord::Base.clear_all_connections!
+ nil
end
-
-def show_log
- change_log(STDOUT)
- puts "logs shown"
+
+def sql_on
+ active_record_log(STDOUT)
end
-
-def hide_log
- change_log(nil)
- puts "logs hidden"
+
+def sql_off
+ active_record_log(nil)
end
+
+# sql_on
2  rvmrc
View
@@ -1,4 +1,4 @@
rvm_gemset_create_on_use_flag=1
rvm_project_rvmrc_default=1
rvm_pretty_print_flag=1
-export rvm_path="/Users/dboyd/.rvm"
+export rvm_path="$HOME/.rvm"
Please sign in to comment.
Something went wrong with that request. Please try again.