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
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_ |
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
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 |
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
log = File.new(AppConfig.log_filepath, "a+") | |
$stdout.reopen(log) | |
$stderr.reopen(log) |
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
[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 |
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
cf = Redrax::CloudFiles.new | |
cf.configure!( | |
user: ENV['RAX_USERNAME'], | |
api_key: ENV['RAX_API_KEY'], | |
region: :iad | |
) | |
cf.authenticate! | |
container_name = "test_container" | |
file_name = "test_file" |
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
require 'aviator' | |
configuration = { | |
:provider => 'openstack', | |
:auth_service => { | |
:name => 'identity', | |
:host_uri => 'http://devstack:5000/v2.0', | |
:request => 'create_token', | |
:validator => 'list_tenants' | |
}, |
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
# containers | |
cf.containers.create("new_container") | |
cf.containers.create("new_container", metadata: { "you're on your own here bud": "because you wanted all of the power" }) # Should we even offer metadata mutation at create time???? | |
container = cf.containers["my-test-dir"] | |
container.delete | |
# metadata (Hash-like protocol) | |
container.metadata # Return a Hash of the metadata less the X-Container-Meta- prefixes | |
container.metadata["price"] = "4.20" | |
container.metadata.delete("price") |
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
export body="{\"auth\":{\"RAX-KSKEY\":\"apiKeyCredentials\":{\"username\":\"$RAX_USERNAME\", \"apiKey\":\"$RAX_API_KEY\"}}}" | |
echo $body | |
echo | |
curl -v -s https://identity.api.rackspacecloud.com/v2.0/tokens -X 'POST' \ | |
-d $body \ | |
-H 'Content-Type: application/json' | python -m json.tool | |
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
module Fog | |
module Rackspace | |
class LoadBalancers | |
class Real | |
def create_access_rule(load_balancer_id, address, type) | |
#TODO - This can actually support adding multiple access rules. | |
data = { | |
'accessList' => [ | |
{ | |
'address' => address, |
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
class Bob | |
def hey(what) | |
what = forget_that_noise(what) | |
if saying_a_whole_lotta_nothing?(what) | |
"Fine. Be that way!" | |
elsif shouting_at_me?(what) | |
"Woah, chill out!" | |
elsif asking_me_something?(what) | |
"Sure." |