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
FUNCTION CALLS % TIME [uS / CALLS] | |
-------- ----- ------- ---- [----------] | |
gen:start/5 2 0.00 0 [ 0.00] | |
gen:init_it/6 2 0.00 0 [ 0.00] | |
application:get_all_env/1 1 0.00 0 [ 0.00] | |
sys_core_bsm:bsm_do_an/4 1 0.00 0 [ 0.00] | |
sys_core_bsm:bsm_do_an_var/4 1 0.00 0 [ 0.00] | |
otp_internal:obsolete_type_1/3 2 0.00 0 [ 0.00] | |
erl_internal:is_type/2 |
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 'librato/metrics' | |
require_relative 'metrics' | |
module Pushr | |
class StatsProcessor | |
# name, start, finish, id, payload | |
def call(_, start, finish, _, payload) | |
messagetype = payload[:type]['Pushr::Message'.size, payload[:type].size].downcase | |
hsh = { measure_time: Time.now, value: ((finish - start) * 1000) } | |
Pushr::Metrics.queue.add "#{payload[:app]}:message:#{messagetype}:time" => hsh |
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
machine: | |
node: | |
version: 6.2.0 | |
environment: | |
PATH: "$HOME/.asdf/bin:$HOME/.asdf/shims:$PATH" | |
MIX_ENV: "test" | |
services: | |
- postgresql | |
database: |
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
<?php | |
$options = get_option( THEME_SHORT . '-swatch-list' ); | |
var_dump($options); | |
unset($options[""]); | |
update_option( THEME_SHORT . '-swatch-list', $options); | |
var_dump(get_option( THEME_SHORT . '-swatch-list' )); | |
$options = get_option( THEME_SHORT . '-swatch-files' ); | |
var_dump($options); | |
unset($options[""]); |
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 Search | |
class Indexer | |
include Sidekiq::Worker | |
sidekiq_options queue: :low, retry: false, backtrace: true | |
LOGGER = Sidekiq.logger.level == Logger::DEBUG ? Sidekiq.logger : nil | |
SEARCH_POOL = ConnectionPool.new(size: SEARCH_UPDATE_POOL, timeout: 5) do | |
Elasticsearch::Client.new host: ELASTICSEARCH_URL, logger: LOGGER | |
end |
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
# First configure your models to use Amazon s3 as storage option and setup the associated S3 config. | |
# Then add the classes your want to migrate in the klasses array below. | |
# Then run rake paperclip_migration:migrate_to_s3 | |
# Should work but this is untested and may need some tweaking - but it did the job for me. | |
namespace :paperclip_migration do | |
desc "migrate files from filesystem to s3" | |
task :migrate_to_s3 => :environment do | |
klasses = [:product] # Replace with your real model names. If anyone wants to this could be picked up from args or from configuration. | |
klasses.each do |klass_key| |