Skip to content

Instantly share code, notes, and snippets.

View wrburgess's full-sized avatar
:shipit:
Shippin'

Randy Burgess wrburgess

:shipit:
Shippin'
View GitHub Profile
source "http://rubygems.org"
ruby "2.1.0"
gem "rails", "4.0.3"
gem "activeadmin", github: "gregbell/active_admin"
gem "aws-sdk", "1.35.0"
gem "bourbon", "3.1.8"
gem "cancan", "1.6.10"
gem "carrierwave", "0.10.0"
@wrburgess
wrburgess / reduce_memory_usage.rb
Created March 17, 2014 15:54
Reduce object creation example
def licensee_country_valid?
# clip.video.source.source_countries.map { |source| source.country }.include?(order.licensee_country)
clip.video.source.source_countries.where("country LIKE '%#{order.licensee_country}%'").any?
end
@wrburgess
wrburgess / commands_for_oink.md
Created March 17, 2014 16:14
using oink to filter logs to track memory issues

analyze logs

oink analyze.log --threshold=50 -r

---- OINK FOR ACTIVERECORD ----
THRESHOLD: 50 Active Record objects per request

-- SUMMARY --
Worst Requests:
@wrburgess
wrburgess / gist:c62eee7b2630313034bd
Last active August 29, 2015 14:02 — forked from nbibler/gist:5307941
Getting pow to work with rvm (add to .powrc file)
if [ -f "$rvm_path/scripts/rvm" ]; then
source "$rvm_path/scripts/rvm"
if [ -f ".rvmrc" ]; then
source ".rvmrc"
fi
if [ -f ".ruby-version" ]; then
rvm use `cat .ruby-version`
fi
@wrburgess
wrburgess / Simple-PubNub-Tutorial.markdown
Created June 25, 2014 21:49
A Pen by Innovations for Learning.
@wrburgess
wrburgess / Very-Simple-Slider.markdown
Created June 25, 2014 21:51
A Pen by Innovations for Learning.
@wrburgess
wrburgess / rails_mailers_setup.md
Created July 21, 2014 16:02
Setting up mailers for Rails 4 with Sidekiq and Redis

Reference: http://guides.rubyonrails.org/action_mailer_basics.html

Set up SMTP settings

Setup the SMTP settings as appropriate in config/environments/development.rb, staging.rb, production.rb

config.action_mailer.delivery_method = :smtp
config.action_mailer.smtp_settings = {
  address: "smtp.mandrillapp.com",
@wrburgess
wrburgess / new_gist_file.md
Created July 24, 2014 17:18
Resetting a Rails database on Heroku

Rebuild database on Heroku

$ git push heroku

$ heroku pg:reset HEROKU_POSTGRESQL_COLOR

$ heroku run rake db:migrate

$ heroku run rake db:seed
@wrburgess
wrburgess / application.js
Created September 1, 2014 17:22
Rails 4 Environment Status Message
//= require environment_indicator
...
//= require all
@wrburgess
wrburgess / index.haml
Created September 10, 2014 03:25
A Pen by Innovations for Learning.
#runner
#info