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 / README.md
Last active October 13, 2023 10:49
How to set up ledger and graphs for Hardspace: Shipbreaker on Windows
@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 / 50.json
Created January 10, 2020 13:14
Flamegraph for method spec on Rails 5.0
{"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 January 10, 2020 13:14
Flamegraph for method spec on Rails 4.2
{"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
@Epigene
Epigene / settings.json
Created December 10, 2019 08:08
Gene's VSC general settings, 2019-12-10
{
"terminal.integrated.env.osx": {
"PATH": "~/.rvm/gems/ruby-2.5.3/bin:~/.rvm/rubies/ruby-2.5.3/bin:~/.rvm/bin:/bin:/usr/local/opt/[email protected]/bin:/usr/local/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin"
},
"ctags": {
"executePath": "~/.rvm/gems/ruby-2.5.3/gems/ripper-tags-0.7.0/bin/ripper-tags",
"options": "--tag-file=.tags --recursive --force --exclude=/assets/ --exclude=.bundle --exclude=.git/ --exclude=coverage/ --exclude=log/ --exclude=tmp/ --exclude=bin/",
"fileName": ".tags"
},
"colorInfo.languages": [
@Epigene
Epigene / ruby.json
Last active December 10, 2019 08:06
Gene's snippets for VSC, 2019-12-10
{
"service_spec template": {
"prefix": "service_spec",
"body": [
"RSpec.describe $0TODO, :service do",
" let(:options) do",
" {}",
" end",
"",
" describe \"#call\", :implicit_subject do",

Karabiner Elements v12.7.0 custom rule setup

  1. Open ~/.config/karabiner/assets/complex_modifications
  2. Make a new *.json rule file
  3. Put the rule json in there.
  4. Reload Karabiner and add the rule.

Control + D to Show Desktop