Skip to content

Instantly share code, notes, and snippets.

View ckraybill's full-sized avatar

Chris Kraybill ckraybill

View GitHub Profile
@ckraybill
ckraybill / deploy_hooks.yml
Created April 9, 2015 04:52
Cloud66 custom deploy hook for configuring papertrail to log application logs. These go in your `.cloud66` deployment folder.
production:
after_rails:
- source: /.cloud66/log_files.yml
destination: /etc/log_files.yml
sudo: true
target: rails
apply_during: build_only
- source: /.cloud66/remote_syslog.init.d
destination: /etc/init.d/remote_syslog
@ckraybill
ckraybill / output.txt
Last active August 29, 2015 14:13
Analysis of QA testing paths
> domains = %w(metrostorage.com goldenstatestorage.com securityself-storage.com meridianhillsassistedliving.com studyplaygrow.com collegiatestation.com pouchrecords.com cedarsedina.com apts-greenfield.com baycourtatharbourpointe.com a1storage.com madisontoluca.com morningsidehouse.com thespringsliving.com morganatloyolastation.com hideawaystorage.com storquest.com willowbrookplace.com)
=> ["metrostorage.com", "goldenstatestorage.com", "securityself-storage.com", "meridianhillsassistedliving.com", "studyplaygrow.com", "collegiatestation.com", "pouchrecords.com", "cedarsedina.com", "apts-greenfield.com", "baycourtatharbourpointe.com", "a1storage.com", "madisontoluca.com", "morningsidehouse.com", "thespringsliving.com", "morganatloyolastation.com", "hideawaystorage.com", "storquest.com", "willowbrookplace.com"]
> domains.size
=> 18
> client_domains = ClientDomain.where(domain: domains)
=> ...truncated...
> client_domains.size
@ckraybill
ckraybill / assets.rake
Last active December 13, 2015 23:19 — forked from thermistor/assets.rake
namespace :assets do
desc "Check that all assets have valid encoding"
task :check => :environment do
paths = ["public/javascripts", "public/stylesheets"]
extensions = ["js", "coffee", "css", "scss"]
paths.each do |path|
dir_path = Rails.root + path
@ckraybill
ckraybill / custom_warden_strategy.rb
Created March 25, 2011 18:27
Grab the user_id either from a param ?s=<encoded user id> || from the Rails session
module G5
module Strategies
class CookieAuthenticable < ::Warden::Strategies::Base
def valid?
request.params['s'] || request.cookies['_g5search_session']
end
def authenticate!
user_id = if request.params['s']
user_id = Util.decode(request.params['s'])[:user_id]