Skip to content

Instantly share code, notes, and snippets.

@nolandc
nolandc / gsb.sh
Last active June 7, 2017 09:35
Git select-branch
list=$(git branch --list | grep -v \*)
declare -a branches=($list)
echo "Branches: "
for i in "${!branches[@]}"; do
printf "%s\t%s\n" "[$i]" "${branches[$i]}";
done
printf "Enter the number of the branch you'd like to switch to: "
@nolandc
nolandc / gdbi.sh
Last active August 29, 2015 14:22
Interactive Git Branch Deletion
echo "Git Branch Deleletion (Interactive)"
# Grep out the current branch and branches too important to delete
list=$(git branch --list | grep -v \* | grep -v develop | grep -v master)
if [[ $list == '' ]]; then
echo "There are no branches to delete."
exit 0
fi
SQLite3::SQLException: table conversations has no column named deal_id: INSERT INTO "conversations" ("buyer_id", "conversationable_id", "conversationable_type", "created_at", "deal_id", "seller_id", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?)
/Users/nolancarroll/.rvm/gems/ruby-1.9.3-p448/gems/sqlite3-1.3.8/lib/sqlite3/database.rb:91:in `initialize'
/Users/nolancarroll/.rvm/gems/ruby-1.9.3-p448/gems/sqlite3-1.3.8/lib/sqlite3/database.rb:91:in `new'
/Users/nolancarroll/.rvm/gems/ruby-1.9.3-p448/gems/sqlite3-1.3.8/lib/sqlite3/database.rb:91:in `prepare'
/Users/nolancarroll/.rvm/gems/ruby-1.9.3-p448/gems/activerecord-3.2.14/lib/active_record/connection_adapters/sqlite_adapter.rb:253:in `block in exec_query'
/Users/nolancarroll/.rvm/gems/ruby-1.9.3-p448/gems/activerecord-3.2.14/lib/active_record/connection_adapters/abstract_adapter.rb:280:in `block in log'
/Users/nolancarroll/.rvm/gems/ruby-1.9.3-p448/gems/activesupport-3.2.14/lib/active_support/notifications/instrumenter.rb:20:in `instrument'
/Users/nolancarroll/.
college = current_user.college
@colleges = [college] + college.nearby
@deals = Kaminari.paginate_array(@colleges.map(&:deals).flatten).page params[:page]