Skip to content

Instantly share code, notes, and snippets.

View EdwardTippett's full-sized avatar

Edward Tippett EdwardTippett

  • Airtasker
  • Sydney
View GitHub Profile
# Extracted from http://git.io/HeGfdA
# Full credit to https://github.com/SamSaffron
#
# Middleware that causes static asset requests to bypass rails altogether. This
# can make requests a lot faster. From 4.5s to 1.5s in some apps. Only relevant
# in development environments as production already does this.
#
# Put this file in lib/middleware and add the following code to your
# development.rb environment file:
#
Steps to install and run PostgreSQL 9.3 using Homebrew (Mac OS X)
(if you aren't using version 9.2.4, change to the correct version)
launchctl unload ~/Library/LaunchAgents/homebrew.mxcl.postgresql.plist
mv /usr/local/var/postgres /usr/local/var/postgres92
brew upgrade postgresql
initdb /usr/local/var/postgres -E utf8
pg_upgrade -b /usr/local/Cellar/postgresql/9.2.4/bin -B /usr/local/Cellar/postgresql/9.3.0/bin -d /usr/local/var/postgres91 -D /usr/local/var/postgres
launchctl load ~/Library/LaunchAgents/homebrew.mxcl.postgresql.plist
development:
adapter: postgresql
<% if `git symbolic-ref HEAD 2>/dev/null`.chomp.sub('refs/heads/', '').gsub(/\W/, '_') =~ /hotfix|release/ %>
database: YOUR_APP_NAME_HERE_development_master
<% else %>
database: YOUR_APP_NAME_HERE_development_<%= `git symbolic-ref HEAD 2>/dev/null`.chomp.sub('refs/heads/', '').gsub(/\W/, '_')[0..20] %>
<% end %>
pool: 5
timeout: 5000
host: localhost