Skip to content

Instantly share code, notes, and snippets.

@gilgen
Created May 19, 2011 12:22
Show Gist options
  • Save gilgen/980617 to your computer and use it in GitHub Desktop.
Save gilgen/980617 to your computer and use it in GitHub Desktop.
Handy stuff

Jamie's handy tidbits

Add a postgres user

sudo -u postgres createuser -S -D -R -P your_user_name

Create a postgres database owned by a user

sudo -u postgres createdb -O database_owner_username name_of_database

Crazy omniauth segfault workaround/fix(?)

export RUBYOPT='-r openssl'

Scaffold with only needed stuff

rails g scaffold <model> <attributes> -e haml --routing-specs=false --helper-specs=false --controller-specs=false --fixture=false --view-specs=false --model-spec=false --helper=false --stylesheets=false -p

Use url helpers from the console

include ActionController::UrlWriter

Install postgres search extensions

CREATE EXTENSION tsearch2;
CREATE EXTENSION pg_trgm;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment