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
# This assumes you're using OS X, but should work on any linux-based system | |
# These two find commands could be run as part of the asset packaging step... | |
brew install jpegoptim | |
# checkout disk usage before hand | |
du -h -d 1 . | |
# add -n to jpegoptim options to do a dry run | |
find . -name "*.jpg" -exec jpegoptim --strip-all {} \; | |
brew install optipng |
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
logger.push_tags and .pop_tags to complement logger.tagged: | |
class Job | |
def before | |
Rails.logger.push_tags :jobs, self.class.name | |
end | |
def after | |
Rails.logger.pop_tags 2 | |
end |
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
# .railsrc for Rails 3, encoding: utf-8 | |
# see http://rbjl.net/49-railsrc-rails-console-snippets | |
if !Rails.application then warn "Rails isn't loaded, yet... skipping .railsrc" else | |
# # # | |
def ripl?; defined?(Ripl) && Ripl.instance_variable_get(:@shell); end | |
# # # | |
# loggers |
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
Normal flow when declaring an exchange: | |
#<Qrack::Transport::Method:0x171ae688 @channel=1, @payload=#<Qrack::Protocol::Exchange::Declare:0x171af088 @durable=true, @passive=nil, @nowait=nil, @exchange="test.test_exchange_10", @internal=nil, @type=:fanout, @ticket=1, @auto_delete=nil, @arguments=nil>> | |
#<Qrack::Transport::Method:0x171ab438 @channel=1, @payload=( | |
> | |
The problematic flow: | |
#<Qrack::Transport::Method:0x171597c8 @channel=1, @payload=#<Qrack::Protocol::Exchange::Declare:0x17159cf0 @durable=nil, @passive=true, @nowait=nil, @exchange="test.test_exchange_201", @internal=nil, @type=:fanout, @ticket=1, @auto_delete=nil, @arguments=nil>> |
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
# Split a single logfile into multiple multiple logfiles based on PID information | |
# provided in the log lines. | |
# | |
# Usage: |