Skip to content

Instantly share code, notes, and snippets.

Avatar

Evan Light elight

  • Heroku
  • Washington, DC
View GitHub Profile
View dns_manager.rb
module API::Clients
class DnsManager < Base
def initialize(url)
headers = {
"Accept" => "application/json",
"Content-Type" => "application/json",
"Request-Id" => API::RequestStore.request_ids,
"X-Request-Id" => API::RequestStore.request_id,
}
super(url, "heroku-dns-manager", headers: headers)
View dns_manager.rb
def params(action:, domain:, target:, type:)
body = {
change: {
:action => action,
"resource-record-set" => {
:name => domain
}
}
}.tap do |b|
case type
View gist:a78c566c5721b44ce794
require 'json'
cert=File.read('cert.pem')
key=File.read('key.pem')
app = "afternoon-citadel-7280"
body = {
app: { id: app },
certificate_chain: cert,
private_key: key
View parameters.rb
def require(key)
self[key].presence || raise(ActionController::ParameterMissing.new(key))
end
alias :required :require
def permit(*filters)
params = self.class.new
View fixture_writer.rb
def fixture_hash
{ identifier => generate_object_attributes }
end
View *.txt
lib/metrics/dashboard.rb:14:9: Rails.cache.fetch("metrics_#{key}_#{interval.to_s}") do
lib/metrics/dashboard.rb:51:9: Rails.cache.write("metrics_#{key}_#{interval.to_s}",data)
lib/metrics/dashboard.rb:56:9: Rails.cache.fetch("#{GROSS_REVENUE_LINE_KEY}-#{period}") do
lib/metrics/dashboard.rb:67:9: Rails.cache.write("#{GROSS_REVENUE_LINE_KEY}-#{period}", data)
lib/metrics/dashboard.rb:73:9: Rails.cache.fetch("#{NET_REVENUE_LINE_KEY}-#{period}") do
lib/metrics/dashboard.rb:91:9: Rails.cache.write("#{NET_REVENUE_LINE_KEY}-#{period}", data)
lib/metrics/dashboard.rb:96:9: Rails.cache.fetch("#{TOTAL_COST_LINE_KEY}-#{period}") do
lib/metrics/dashboard.rb:127:9: Rails.cache.write("#{TOTAL_COST_LINE_KEY}-#{period}", data)
lib/metrics/dashboard.rb:132:9: Rails.cache.fetch("#{CHART_DATA_KEY}-#{interval}") { build_all_chart_data(interval) }.symbolize_keys
lib/metrics/dashboard.rb:136:9: Rails.cache.write("#{CHART_DATA_KEY}-#{interval}", build_all_chart_
View *.txt
lib/metrics/dashboard.rb:14:9: Rails.cache.fetch("metrics_#{key}_#{interval.to_s}") do
lib/metrics/dashboard.rb:51:9: Rails.cache.write("metrics_#{key}_#{interval.to_s}",data)
lib/metrics/dashboard.rb:56:9: Rails.cache.fetch("#{GROSS_REVENUE_LINE_KEY}-#{period}") do
lib/metrics/dashboard.rb:67:9: Rails.cache.write("#{GROSS_REVENUE_LINE_KEY}-#{period}", data)
lib/metrics/dashboard.rb:73:9: Rails.cache.fetch("#{NET_REVENUE_LINE_KEY}-#{period}") do
lib/metrics/dashboard.rb:91:9: Rails.cache.write("#{NET_REVENUE_LINE_KEY}-#{period}", data)
lib/metrics/dashboard.rb:96:9: Rails.cache.fetch("#{TOTAL_COST_LINE_KEY}-#{period}") do
lib/metrics/dashboard.rb:127:9: Rails.cache.write("#{TOTAL_COST_LINE_KEY}-#{period}", data)
lib/metrics/dashboard.rb:132:9: Rails.cache.fetch("#{CHART_DATA_KEY}-#{interval}") { build_all_chart_data(interval) }.symbolize_keys
lib/metrics/dashboard.rb:136:9: Rails.cache.write("#{CHART_DATA_KEY}-#{interval}", build_all_chart_
View *.txt
app/controllers/barcodes_controller.rb:10:16: img_data = Rails.cache.fetch("barcode-#{code.gsub(/\W/,'_')}.png") do
app/controllers/picklist/recently_picked_controller.rb:5:15: items = Rails.cache.read('recently_picked') || []
app/controllers/picklist/to_ship_controller.rb:9:15: items = Rails.cache.read('recently_picked') || []
app/controllers/picklist/to_ship_controller.rb:14:7: Rails.cache.write('recently_picked', items)
app/controllers/pricing_engine/driver_controller.rb:10:15: running = Rails.cache.read('pricing_engine_worker_running') ? true : false
app/interactors/unit_interactor/change_storage_location.rb:66:15: items = Rails.cache.read('recently_picked') || []
app/interactors/unit_interactor/change_storage_location.rb:68:7: Rails.cache.write('recently_picked', items)
app/models/load.rb:239:8: #Rails.cache.fetch("load-#{proxy_association.owner.id}-manifest_entries-interesting_columns") do
app/models/load.rb:713:5: Rails.cache.write("load-#{self.id}-processing-mani
View app.rb
log = File.new(AppConfig.log_filepath, "a+")
$stdout.reopen(log)
$stderr.reopen(log)
View jed.cnf
[mysqld]
# Slow Log
#slow_query_log = 1
#log_queries_not_using_indexes = 1
#long_query_time = 1
# Disable DNS lookups for performance
skip_name_resolve
# MySQL >= 5.5.5 uses InnoDB by default, but set it just in case