Skip to content

Instantly share code, notes, and snippets.

Kenny Smith kjs3

Block or report user

Report or block kjs3

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View heroku_logs.log
2012-04-25T16:04:31+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.2/lib/action_controller/metal/mime_responds.rb:246:in `respond_with'
2012-04-25T16:04:31+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.2/lib/active_support/callbacks.rb:81:in `run_callbacks'
2012-04-25T16:04:31+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.2/lib/active_support/callbacks.rb:385:in `_run_process_action_callbacks'
2012-04-25T16:04:31+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/devise-2.0.4/app/controllers/devise/sessions_controller.rb:9:in `new'
2012-04-25T16:04:31+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.2/lib/abstract_controller/callbacks.rb:17:in `process_action'
2012-04-25T16:04:31+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.2/lib/abstract_controller/base.rb:167:in `process_action'
2012-04-25T16:04:31+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.2/lib/abstract_controller/callbacks.rb:18:in `bloc
@kjs3
kjs3 / production.rb
Created Apr 25, 2012
asset stuff from production.rb
View production.rb
# Code is not reloaded between requests
config.cache_classes = true
# Full error reports are disabled and caching is turned on
config.consider_all_requests_local = false
config.action_controller.perform_caching = true
# Disable Rails's static asset server (Apache or nginx will already do this)
# Enabled for Heroku Cedar stack
config.serve_static_assets = true
@kjs3
kjs3 / staging.rb
Created Apr 20, 2012
staging setup
View staging.rb
config.cache_classes = true
# Full error reports are disabled and caching is turned on
config.consider_all_requests_local = false
config.action_controller.perform_caching = true
# Disable Rails's static asset server (Apache or nginx will already do this)
# Enabled for Heroku Cedar stack
config.serve_static_assets = true
config.static_cache_control = "public, max-age=691200" #set to 8 days
@kjs3
kjs3 / event.rb
Created Apr 17, 2012
Event Model from a Rails project
View event.rb
require "iconv"
class Event < ActiveRecord::Base
belongs_to :event_category
has_many :line_items
has_many :region_links, :as => :region_linkable
has_many :regions, :through => :region_links
has_many :interest_links, :as => :interest_linkable
has_many :interests, :through => :interest_links
View gist:408311
require 'right_aws.rb'
@amz_public_key = 'myaccesskey' # S3 Public key
@amz_private_key = 'mysecretaccesskey' # S3 Private key
# You need to create a key/pair to do much of anything with aws. You can do this by going to
# http://aws-portal.amazon.com/gp/aws/developer/account/index.html?action=access-key and clicking
# on the Key Pairs tab
@key_id = 'keyID' # Key ID from AWS (not the EC2 key/pairs)
View gist:397758
bson (1.0.1) lib/bson/bson_c.rb:8:in `serialize'
bson (1.0.1) lib/bson/bson_c.rb:8:in `serialize'
mongo (1.0.1) lib/mongo/cursor.rb:362:in `construct_query_message'
mongo (1.0.1) lib/mongo/cursor.rb:344:in `send_initial_query'
mongo (1.0.1) lib/mongo/cursor.rb:322:in `refill_via_get_more'
mongo (1.0.1) lib/mongo/cursor.rb:317:in `num_remaining'
mongo (1.0.1) lib/mongo/cursor.rb:65:in `next_document'
mongo (1.0.1) lib/mongo/collection.rb:196:in `find_one'
/Users/kjs3/.rvm/gems/ruby-1.9.2-head@smp2/bundler/gems/mongoid-7c52c9062e8404a8881d39f6d2b48690383a9f58-master/lib/mongoid/collections/master.rb:15:in `block (2 levels) in <class:Master>'
/Users/kjs3/.rvm/gems/ruby-1.9.2-head@smp2/bundler/gems/mongoid-7c52c9062e8404a8881d39f6d2b48690383a9f58-master/lib/mongoid/collection.rb:69:in `find_one'
View gist:396774
bson (1.0.1) lib/bson/bson_c.rb:8:in `serialize'
bson (1.0.1) lib/bson/bson_c.rb:8:in `serialize'
mongo (1.0.1) lib/mongo/cursor.rb:362:in `construct_query_message'
mongo (1.0.1) lib/mongo/cursor.rb:344:in `send_initial_query'
mongo (1.0.1) lib/mongo/cursor.rb:322:in `refill_via_get_more'
mongo (1.0.1) lib/mongo/cursor.rb:317:in `num_remaining'
mongo (1.0.1) lib/mongo/cursor.rb:65:in `next_document'
mongo (1.0.1) lib/mongo/collection.rb:196:in `find_one'
/Users/kjs3/.rvm/gems/ruby-1.9.1-p378@smp/bundler/gems/mongoid-7c52c9062e8404a8881d39f6d2b48690383a9f58-master/lib/mongoid/collections/master.rb:15:in `block (2 levels) in <class:Master>'
/Users/kjs3/.rvm/gems/ruby-1.9.1-p378@smp/bundler/gems/mongoid-7c52c9062e8404a8881d39f6d2b48690383a9f58-master/lib/mongoid/collection.rb:69:in `find_one'
View gist:396773
defaults: &defaults
# host: localhost
# slaves:
# - host: slave1.local
# port: 27018
# - host: slave2.local
# port: 27019
host: <%= ENV['MONGOID_HOST'] %>
port: <%= ENV['MONGOID_PORT'] %>
username: <%= ENV['MONGOID_USERNAME'] %>
View gist:334770
kjs3-2:smp-rails3 kjs3$ rails server
=> Booting WEBrick
=> Rails 3.0.0.beta1 application starting in development on http://0.0.0.0:3000
=> Call with -d to detach
=> Ctrl-C to shutdown server
Exiting
/Users/kjs3/websites/smp-rails3/config/environments/development.rb:17:in `block (2 levels) in <top (required)>': foo (RuntimeError)
from /Users/kjs3/.rvm/gems/ruby-1.9.2-head%rails3beta/bundler/gems/rails-16a5e918a06649ffac24fd5873b875daf66212ad-master/activesupport/lib/active_support/callbacks.rb:428:in `_run_prepare_callbacks'
from /Users/kjs3/.rvm/gems/ruby-1.9.2-head%rails3beta/bundler/gems/rails-16a5e918a06649ffac24fd5873b875daf66212ad-master/activesupport/lib/active_support/callbacks.rb:88:in `run_callbacks'
from /Users/kjs3/.rvm/gems/ruby-1.9.2-head%rails3beta/bundler/gems/rails-16a5e918a06649ffac24fd5873b875daf66212ad-master/actionpack/lib/action_dispatch/middleware/callbacks.rb:40:in `initialize'
View gist:334763
config/environment.rb:7:in `block in <top (required)>'
/Users/kjs3/.rvm/gems/ruby-1.9.2-head%rails3beta/bundler/gems/rails-16a5e918a06649ffac24fd5873b875daf66212ad-master/activesupport/lib/active_support/callbacks.rb:438:in `_run_prepare_callbacks'
/Users/kjs3/.rvm/gems/ruby-1.9.2-head%rails3beta/bundler/gems/rails-16a5e918a06649ffac24fd5873b875daf66212ad-master/activesupport/lib/active_support/callbacks.rb:88:in `run_callbacks'
/Users/kjs3/.rvm/gems/ruby-1.9.2-head%rails3beta/bundler/gems/rails-16a5e918a06649ffac24fd5873b875daf66212ad-master/actionpack/lib/action_dispatch/middleware/callbacks.rb:45:in `block in call'
/Users/kjs3/.rvm/gems/ruby-1.9.2-head%rails3beta/bundler/gems/rails-16a5e918a06649ffac24fd5873b875daf66212ad-master/activesupport/lib/active_support/callbacks.rb:429:in `_run_call_callbacks'
/Users/kjs3/.rvm/gems/ruby-1.9.2-head%rails3beta/bundler/gems/rails-16a5e918a06649ffac24fd5873b875daf66212ad-master/activesupport/lib/active_support/callbacks.rb:88:in `run_callbacks'
/Users/kjs3/.rvm/gems/r
You can’t perform that action at this time.