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/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 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 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 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}..." |
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
namespace :deploy do | |
desc "Deploy, migrate and restart production" | |
task :production do | |
Bundler.with_clean_env do | |
puts `git push origin master` | |
puts `git push production master` | |
puts `heroku pgbackups:capture DATABASE_URL --expire --app <app_name>` | |
puts `heroku run rake db:migrate --app <app_name>` | |
puts `heroku restart --app <app_name>` |
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
function program1(depth0,data) { | |
var buffer = "", stack1; | |
buffer += "\n <img alt='"; | |
foundHelper = helpers.product; | |
stack1 = foundHelper || depth0.product; | |
stack1 = (stack1 === null || stack1 === undefined || stack1 === false ? stack1 : stack1.name); | |
if(typeof stack1 === functionType) { stack1 = stack1.call(depth0, { hash: {} }); } | |
else if(stack1=== undef) { stack1 = helperMissing.call(depth0, "product.name", { hash: {} }); } | |
buffer += escapeExpression(stack1) + "' src='"; |
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
li.links | |
= link_to ccn.name, '#', :class => 'symptom_link grey', :id => "symptom-#{ccn.id}" | |
javascript: | |
jQuery(function() { | |
jQuery(".symptom_link").click(function() { | |
jQuery.ajax("/symptom/update_possible_causes/#{ccn.name.gsub(/\s/, '-').downcase}"); | |
}); | |
}); |