Skip to content

Instantly share code, notes, and snippets.

Rich Rines richrines

Block or report user

Report or block richrines

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 clear-sidekiq-jobs.sh
# 1. Clear retry set
Sidekiq::RetrySet.new.clear
# 2. Clear scheduled jobs
Sidekiq::ScheduledSet.new.clear
# 3. Clear 'Processed' and 'Failed' jobs
View onename.txt
Verifying that "richrines.id" is my Blockstack ID. https://onename.com/richrines
@richrines
richrines / explain_analyze.rb
Created Jun 21, 2016 — forked from jsanders/explain_analyze.rb
Run EXPLAIN ANALYZE on all select queries and log the results. Definitely don't use this if performance matters...
View explain_analyze.rb
if Rails.env.development?
require 'active_record/connection_adapters/postgresql_adapter'
class ActiveRecord::ConnectionAdapters::PostgreSQLAdapter
def __explain_analyze(sql, command, *args)
meth = "#{command}_without_explain_analyze".to_sym
if /\A\s*SELECT/i.match(sql)
newsql = "EXPLAIN ANALYZE #{sql}"
plan = send(meth, newsql, *args).map { |row| row['QUERY PLAN'] }.join("\n")
Rails.logger.debug("\e[1m\e[31mQUERY PLAN FOR: #{sql.strip};\n#{plan}\e[0m")
You can’t perform that action at this time.