Skip to content

Instantly share code, notes, and snippets.

View Epigene's full-sized avatar

Augusts Bautra Epigene

View GitHub Profile
# hook approach
class InstructionsController < ApplicationController
before_action :load_instruction, only: %i[show edit]
def show
authorize @instruction
end
def edit
authorize @instruction
@Epigene
Epigene / Dokku v0.5.6 Rails App.md
Last active January 5, 2024 14:48
Knowledge-Base for getting a Rails5 app with Cable running on dokku v0.5.6

Dokku v0.5.6 Rails workflow

Straight to Maintenance

0. Set up Droplet

Initialize the droplet with dokku app pre-setup
@Epigene
Epigene / README.md
Last active October 13, 2023 10:49
How to set up ledger and graphs for Hardspace: Shipbreaker on Windows
@Epigene
Epigene / gist:47c059a825acd4445e61
Created June 27, 2015 12:54
First Data FDL response (error) codes
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)",
{"lastUpload":"2021-06-15T07:37:30.093Z","extensionVersion":"v3.4.3"}
@Epigene
Epigene / bullet_stact.txt
Created May 27, 2021 13:38
bullet raise
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 07:39
Comprehensive draft of Ruby code style to codify into Rubocop

Dev team standarts

Follow community and company code guidelines, facilitate collaboration

Special mentions agreed to on 2018-07-20

1. Use no spaces around curly braces around Hash parentheses

# good
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 December 28, 2020 19:35
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