This file contains hidden or 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/instrumentation.rb | |
# Subscribe to grape request and log with Rails.logger | |
ActiveSupport::Notifications.subscribe('grape.request') do |name, starts, ends, notification_id, payload| | |
Rails.logger.info '[API] %s %s (%.3f ms) -> %s %s%s' % [ | |
payload[:request_method], | |
payload[:request_path], | |
(ends-starts)*1000, | |
(payload[:response_status] || "error"), | |
payload[:x_organization] ? "| X-Org: #{payload[:x_organization]}" : "", |
This file contains hidden or 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
:repo:deb [trusted=yes arch=amd64] https://apache.jfrog.io/artifactory/arrow/ubuntu/ focal main | |
libarrow-dev | |
libparquet-dev | |
libarrow-glib-dev | |
libparquet-glib-dev | |
libgirepository-1.0-1 | |
libgirepository1.0-dev |
This file contains hidden or 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
# It requires ACK - http://betterthangrep.com/ | |
task :find_unused_images do | |
images = Dir.glob('app/assets/images/**/*') | |
images_to_delete = [] | |
images.each do |image| | |
unless File.directory?(image) | |
# print "\nChecking #{image}..." | |
print "." | |
result = `ack -1 -G '(app|public)' --ruby --html --css --js #{File.basename(image)}` |
This file contains hidden or 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
#With Homebrew, run `brew install ack` to ensure this will work. | |
task :find_unused_images do | |
raise('ack not found!!! install it with your favorite package manager!') if `which ack`.empty? | |
images = Dir.glob('app/assets/images/**/*') | |
images_to_delete = images.inject([]) do |memo, image| | |
#Ignore Directories | |
unless File.directory?(image) | |
# print "\nChecking #{image}..." |