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 'RMagick' | |
include Magick | |
def convert_rgb(color) | |
color / 257 | |
end | |
def convert_pixel(pixel) | |
{ | |
:r => convert_rgb(pixel.red), |
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
#!/bin/bash | |
set -e | |
echo "Update Linux Packages" | |
sudo apt-get update -y | |
echo "Install Required Linux Packages" | |
sudo apt-get install build-essential bison openssl libreadline6 libreadline6-dev curl git-core zlib1g zlib1g-dev libssl-dev libyaml-dev libsqlite3-0 libsqlite3-dev sqlite3 libxml2-dev libxslt-dev autoconf libc6-dev nodejs -y |
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
mapping = [{"4244"=>"CS-670"}, {"10577"=>"CS-670"}, {"4161"=>"CS-670"}, {"682"=>"CS-670"}, {"4308"=>"CS-670"}, {"4030"=>"CS-670"}, {"4189"=>"CS-670"}, {"6782"=>"CS-670"}, {"397"=>"CS-670"}, {"775"=>"CS-670"}, {"284"=>"CS-670"}, {"10679"=>"CS-670"}, {"4044"=>"CS-670"}, {"4104"=>"CS-670"}, {"4372"=>"CS-670"}, {"4358"=>"CS-670"}, {"4670"=>"CS-670"}, {"5561"=>"CS-670"}, {"4340"=>"CS-670"}, {"4364"=>"CS-670"}, {"4069"=>"CS-670"}, {"4637"=>"CS-670"}, {"4284"=>"CS-670"}, {"10284"=>"CS-670"}, {"4243"=>"CS-670"}, {"147"=>"CS-670"}, {"570"=>"CS-670"}, {"4088"=>"CS-670"}, {"6265"=>"CS-670"}, {"9159"=>"CS-670"}, {"10052"=>"CS-670"}, {"4322"=>"CS-670"}, {"4802"=>"CS-670"}, {"4292"=>"CS-670"}, {"6089"=>"CS-670"}, {"4198"=>"CS-670"}, {"4319"=>"CS-670"}, {"4273"=>"CS-670"}, {"921"=>"CS-670"}, {"4080"=>"CS-670"}, {"4334"=>"CS-670"}, {"5330"=>"CS-670"}, {"4328"=>"CS-670"}, {"5165"=>"CS-670"}, {"4180"=>"CS-670"}, {"7772"=>"CS-670"}, {"831"=>"CS-670"}, {"4240"=>"CS-670"}, {"6716"=>"CS-670"}, {"9494"=>"CS-670"}, {"659"=>"CS-670"} |
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
MASTER_FACILITY_ID = 200 | |
SOURCE_ID = 2 | |
STORE_NUMBERS = ['107','117','310','316','317','318','320','326','367','368','369','370','443','512','514','518','519','550','555','556','587','589','590','645','649','655','660','661','662','663','664','665','666','667','669','700','706','778','779','780','781','830','831','835','843','844','845','846','847','848','849','850','851','852','853','854','855','862','863','864','865','877','878','879','889','901','5006','5040','5062','5063','5066','5067','5071','5142','5170','5205','5206','5208','5220','5222','5223','5394','5412','5413','5536','5538','5539','5540','5581','5583','5584','5596','5610','5615','5616','5617','5633','5637','5732','5733','5740','5785','5786','5787','5790','5800','5814','5815','5816','5817','5818','5819','5834','5839','5843','5850','5890','5990','5995','6049','6069','6095','6109','6190','6258','6271','6272','6277','6368','6369','6681','6683','6700','6714','6715','6716','6717','6718','6719','6720','6721','6722','6723','6724','6725','6764','6774','6787 |
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
def remove_deleted_units_from_search(facility_id) | |
search_params = { facility_id: facility_id, models: 'Unit', _source: ['id'] } | |
response = Er::Client.new.facility_search(search_params) | |
response_ids = response['results'].map { |result| result['_source']['id'] } | |
current_unit_ids = Facility.find(facility_id).units.where(deleted: false).pluck(:id) | |
unit_ids_to_remove = response_ids - current_unit_ids | |
unit_ids_to_remove.each do |unit_id| | |
Unit.searchkick_index.remove(Unit.new(id: unit_id)) | |
puts "Removing unit ID #{unit_id} from search" | |
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
ActiveRecord::Base.transaction do | |
puts "message,created_at,id,key,one_cent_board,processed,transport_type,facility_id,store_number,customer,account_number,amount_approved,employee,payment_action" | |
kyle = User.find_by(email: "[email protected]"); | |
emv_transactions = EmvTransaction.where(processed: false, created_at: DateTime.parse('2020-09-24')..DateTime.parse('2020-09-25 10:00')) | |
emv_transactions.each do |emv_transaction| | |
facility = emv_transaction.facility | |
provider_response = emv_transaction.saved_provider_response&.dig('result') | |
payment_detail = provider_response&.dig('payment_details', 'payment_detail') | |
output = [ | |
facility.in_time_zone { emv_transaction.created_at }, |
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
-- Delete all unit facts in Kepler for store 400 | |
with one_facility_dim as ( | |
select facility_dim_id | |
from facility_dim | |
where facility_dim.store_number = '400' | |
), | |
kepler_units as ( |
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
package main | |
import ( | |
"fmt" | |
"time" | |
) | |
func main() { | |
seconds_per_block := float64(6) |
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
{ | |
"genesis_time": "2023-02-17T18:06:58.722081982Z", | |
"chain_id": "chain-GyjHsE", | |
"initial_height": "1", | |
"consensus_params": { | |
"block": { | |
"max_bytes": "22020096", | |
"max_gas": "-1", | |
"time_iota_ms": "1000" | |
}, |
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
# HELP begin_blocker begin_blocker | |
# TYPE begin_blocker summary | |
begin_blocker{module="capability",quantile="0.5"} 0.002392000053077936 | |
begin_blocker{module="capability",quantile="0.9"} 0.0029730000533163548 | |
begin_blocker{module="capability",quantile="0.99"} 0.0029730000533163548 | |
begin_blocker_sum{module="capability"} 0.4431930019054562 | |
begin_blocker_count{module="capability"} 145 | |
begin_blocker{module="distribution",quantile="0.5"} 0.26203298568725586 | |
begin_blocker{module="distribution",quantile="0.9"} 0.3047870099544525 | |
begin_blocker{module="distribution",quantile="0.99"} 0.3047870099544525 |
OlderNewer