Skip to content

Instantly share code, notes, and snippets.

View SeriouslyAwesome's full-sized avatar

John Ellis SeriouslyAwesome

View GitHub Profile
Raven.configure do |config|
config.sanitize_fields = Rails.application.config.filter_parameters.map(&:to_s)
config.dsn = ENV['SENTRY_DSN'] unless Rails.env.development? || Rails.env.test?
config.environments = %w(sandbox staging demo production)
config.silence_ready = true
end
@SeriouslyAwesome
SeriouslyAwesome / Gemfile
Last active April 1, 2024 20:50 — forked from tylerhunt/Gemfile
ActiveAdmin association autocomplete without complicated plugins.
gem 'active_model_serializers'
gem 'activeadmin'
gem 'jquery-ui-rails'
# Create a states table with an index on the abbreviation,
# then create the 50 states plus Washington, DC
class CreateStates < ActiveRecord::Migration
def change
create_table :states do |t|
t.string :name, null: false
t.string :abbr, null: false
t.timestamps null: false
end
@SeriouslyAwesome
SeriouslyAwesome / .htaccess
Created April 15, 2015 18:49
Google PageSpeed / Yahoo! YSlow Apache Config for Static Sites
# Protect files and directories
<FilesMatch "(\.(engine|inc|info|install|module|profile|po|sh|.*sql|theme|tpl(\.php)? |xtmpl)|code-style\.pl|Entries.*|Repository|Root|Tag|Template)$">
Order allow,deny
</FilesMatch>
# Don’t show directory listings
Options -Indexes
# Basic rewrite rules, stop unneeded PERL bot, block subversion directories
<IfModule mod_rewrite.c>
@SeriouslyAwesome
SeriouslyAwesome / XYZ_add_states_visited_to_people.rb
Created November 14, 2014 02:36
Auto-complete tagging with Rails, PostgreSQL Arrays and Chosen: A Complete Example
class AddStatesVisitedToPeople < ActiveRecord::Migration
def change
add_column :people, :states_visited, :text, array: true, :default => []
end
end