This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# /config/initializers/sidekiq.rb | |
current_web_concurrency = Proc.new do | |
web_concurrency = ENV['WEB_CONCURRENCY'] | |
web_concurrency ||= Puma.respond_to? | |
(:cli_config) && Puma.cli_config.options.fetch(:max_threads) | |
web_concurrency || 16 | |
end | |
local_redis_url = Proc.new do |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module ActiveAdminHelper | |
def admin_arbre_context | |
@admin_arbre_context ||= Arbre::Context.new(assigns, self) | |
end | |
def default_renderer | |
case controller.send(:resource_class).name | |
when "ActiveAdmin::Page" | |
"page" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ brew install libmagic | |
$ brew link libmagic (if the link is already created is going to fail, don't worry about that) | |
$ env ARCHFLAGS="-arch x86_64" gem install ruby-filemagic -- --with-magic-include=/usr/local/include --with-magic-lib=/usr/local/lib/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# see http://stackoverflow.com/questions/5880962/how-to-destroy-jobs-enqueued-by-resque-workers - old version | |
# see https://github.com/defunkt/resque/issues/49 | |
# see http://redis.io/commands - new commands | |
namespace :resque do | |
desc "Clear pending tasks" | |
task :clear => :environment do | |
queues = Resque.queues | |
queues.each do |queue_name| | |
puts "Clearing #{queue_name}..." |