Skip to content

Instantly share code, notes, and snippets.

Avatar

Augusts Bautra Epigene

View GitHub Profile
View cloudSettings
{"lastUpload":"2021-06-15T07:37:30.093Z","extensionVersion":"v3.4.3"}
View bullet_stact.txt
Bullet::Notification::UnoptimizedQueryError at /api/v2/tiered_pricing_models/11834910-c11f-49bb-b095-23c98acbe51f
=================================================================================================================
> user: augusts
PUT /api/v2/tiered_pricing_models/11834910-c11f-49bb-b095-23c98acbe51f
AVOID eager loading detected
TieredPricingModel => [:account_tiered_pricing_model_template]
Remove from your finder: :includes => [:account_tiered_pricing_model_template]
Call stack
/Users/augusts/Projects/herer-api/spec/requests/tiered_pricing_models_spec.rb:63:in `block (3 levels) in <top (required)>'
@Epigene
Epigene / Code of Code.md
Created May 21, 2021
Comprehensive draft of Ruby code style to codify into Rubocop
View Code of Code.md

Dev team standarts

Follow community and company code guidelines, facilitate collaboration

Adhere to Ruby Style Guide

Special mentions agreed to on 2018-07-20

1. Use no spaces around curly braces around Hash parentheses

# good
View spec.rb
describe "#current_agreement_vehicle assoc", :slow, travel_to: "2021-01-01" do
let!(:vehicle1) do
Timecop.freeze(1.day.ago) { create(:vehicle) }
end
let!(:vehicle2) do
Timecop.freeze(2.days.ago) { create(:vehicle) }
end
let(:av1_2) do
@Epigene
Epigene / MB puma + Nginx settings
Last active Dec 28, 2020
MB puma + Nginx settings
View MB puma + Nginx settings
# /config/puma.rb
app = "manabalss" # App-specific
root = "/home/deployer/apps/#{app}"
workers 5
threads 1, 1 # relying on many workers for thread-unsafe apps
rackup DefaultRackup
port 11592
@Epigene
Epigene / Dokku v0.5.6 Rails App.md
Last active Oct 17, 2020
Knowledge-Base for getting a Rails5 app with Cable running on dokku v0.5.6
View Dokku v0.5.6 Rails App.md

Dokku v0.5.6 Rails workflow

Straight to Maintenance

0. Set up Droplet

Initialize the droplet with dokku app pre-setup
@Epigene
Epigene / gist:47c059a825acd4445e61
Created Jun 27, 2015
First Data FDL response (error) codes
View gist:47c059a825acd4445e61
RESPONSE_CODES = {
"000" => "Approved",
"001" => "Approved, honour with identification",
"002" => "Approved for partial amount",
"003" => "Approved for VIP",
"004" => "Approved, update track 3",
"005" => "Approved, account type specified by card issuer",
"006" => "Approved for partial amount, account type specified by card issuer",
"007" => "Approved, update ICC",
"100" => "Decline (general, no comments)",
@Epigene
Epigene / 50.json
Created Jan 10, 2020
Flamegraph for method spec on Rails 5.0
View 50.json
{"version":1.2,"mode":"wall","interval":1000,"samples":817,"gc_samples":220,"missed_samples":189,"metadata":{},"frames":{"2256502940":{"name":"Mysql2::Client#query","file":"/Users/augusts/.rvm/gems/ruby-2.5.3/gems/mysql2-0.5.3/lib/mysql2/client.rb","line":129,"total_samples":17,"samples":17,"edges":{"2256502940":17},"lines":{"131":[16,16],"130":[17,0],"132":[1,1]}},"2279488660":{"name":"ActiveRecord::ConnectionAdapters::AbstractMysqlAdapter#execute","file":"/Users/augusts/.rvm/gems/ruby-2.5.3/gems/activerecord-5.0.7.2/lib/active_record/connection_adapters/abstract_mysql_adapter.rb","line":217,"total_samples":27,"samples":0,"edges":{"2256502940":17,"2228340160":27},"lines":{"218":[44,0]}},"2228340160":{"name":"ActiveRecord::ConnectionAdapters::AbstractAdapter#log","file":"/Users/augusts/.rvm/gems/ruby-2.5.3/gems/activerecord-5.0.7.2/lib/active_record/connection_adapters/abstract_adapter.rb","line":582,"total_samples":27,"samples":0,"edges":{"2279488660":17,"2230307860":27},"lines":{"590":[17,0],"583":[27,0]}},
@Epigene
Epigene / 42.json
Created Jan 10, 2020
Flamegraph for method spec on Rails 4.2
View 42.json
{"version":1.2,"mode":"wall","interval":1000,"samples":251,"gc_samples":151,"missed_samples":24,"frames":{"2248648540":{"name":"Mysql2::Client#query","file":"/Users/augusts/.rvm/gems/ruby-2.5.3/gems/mysql2-0.4.10/lib/mysql2/client.rb","line":118,"total_samples":5,"samples":5,"edges":{"2248648540":5},"lines":{"120":[5,5],"119":[5,0]}},"2319186460":{"name":"ActiveRecord::ConnectionAdapters::AbstractMysqlAdapter#execute","file":"/Users/augusts/.rvm/gems/ruby-2.5.3/gems/activerecord-4.2.11.1/lib/active_record/connection_adapters/abstract_mysql_adapter.rb","line":316,"total_samples":8,"samples":0,"edges":{"2248648540":5,"2245218080":8},"lines":{"317":[13,0]}},"2245218080":{"name":"ActiveRecord::ConnectionAdapters::AbstractAdapter#log","file":"/Users/augusts/.rvm/gems/ruby-2.5.3/gems/activerecord-4.2.11.1/lib/active_record/connection_adapters/abstract_adapter.rb","line":477,"total_samples":8,"samples":0,"edges":{"2319186460":5,"2242197020":8},"lines":{"484":[5,0],"478":[8,0]}},"2242197020":{"name":"ActiveSupport::N