Skip to content

Instantly share code, notes, and snippets.

View lbalceda's full-sized avatar

Luis Balceda lbalceda

  • San Francisco, California
View GitHub Profile
@lbalceda
lbalceda / gist:5681074
Last active January 27, 2017 19:30
rails 3 vs rails 4 unicorn logger configuration settings
# For Production you would probably want to default the Log Level to 'INFO' instead of 'DEBUG'.
# Rails 3
config.logger = Logger.new(STDOUT)
config.logger.level = Logger.const_get(
ENV['LOG_LEVEL'] ? ENV['LOG_LEVEL'].upcase : 'DEBUG'
)
@lbalceda
lbalceda / gist:5616034
Created May 20, 2013 22:15
rails 3 dot gitignore
# Developer
.env
# Ignore bundler config
/.bundle
# Ignore the default SQLite database.
/db/*.sqlite3
# Ignore uploads
@lbalceda
lbalceda / gist:5406803
Last active December 16, 2015 08:38
modify owners of all tables or sequences in PostgreSQL
#tables
for tbl in `psql -qAt -c "select tablename from pg_tables where schemaname = 'public';" YOUR_DB` ; do psql -c "alter table $tbl owner to NEW_OWNER" YOUR_DB ; done
#sequences
for tbl in `psql -qAt -c "select sequence_name from information_schema.sequences where sequence_schema = 'public';" YOUR_DB` ; do psql -c "alter table $tbl owner to NEW_OWNER" YOUR_DB ; done
@lbalceda
lbalceda / gist:5384315
Created April 14, 2013 21:35
script to load / start firebug lite in browsers that don't have inspector
<script type="text/javascript" src="https://getfirebug.com/firebug-lite.js">
{
startOpened: true,
enableTrace: true
}
</script>