The rails file cache is something that keeps growing.
Here are some 'handy' snippets.
Delete all files older then 7 days. (replace -delete with -print to test it)
find ./tmp/cache/ -type f -mtime +7 -delete
Delete all empty folders. (mindepth prevents the deletion of the root folder)
find ./tmp/cache/ -type d -empty -delete -mindepth 1
whenever.rb I use
job_type :command_in_path, "cd :path && :task :output"
every :day, at: "0:40" do
command_in_path "find ./tmp/cache/ -type f -mtime +7 -delete"
every :day, at: "1:10" do
command_in_path "find ./tmp/cache/ -type d -empty -delete -mindepth 1"
I finally found a reason why sometimes my 'bundle update' hangs infinitely.. It keeps showing dots... and takes forever..
Resolving dependencies........... *sigh* ...
I have some gems that are available only for authorized users.
When the ssh keychain is still locked (haven't entered a password for my ssh-key yet) Bundler keeps running infinitely without showing any password entry...
It is pretty easy to cleanup dangling blobs.
When using a http/https service it may be better to use purge_later
Spree::Core::Engine.routes.url_helpers.product_url(product, host: "http://www.yourdomain.com")
Just reminder for myself...
The method Numeric#nonzero?
returns self if the number is != 0 else it returns nil
Makes this code possible:
objects.sort do |a, b|
(a.lastname <=> b.lastname).nonzero? || (a.firstname <=> b.firstname)