build-lists: true
^ share my personal process
^ take inspiration and apply to your life
| import SwiftUI | |
| /* | |
| ## Animated highlight over redacted code | |
| To actually try to get a loading shimmer animation on redacted content | |
| Interesting concepts: | |
| - overlay + `.blendMode` |
this code is supposed to be run in the rails console.
fix_varner_organizations.rbMYCHAIN_SYNCED_ORGANIZATIONS to the organization_identifier in production.organization_identifier = 'varner', also modify the MYCHAIN_SYNCED_ORGANIZATIONS to have one organization at a time, for not having problems with memory on production.| # frozen_string_literal: true | |
| module Organization | |
| class Group | |
| # belongs_to :parent, class_name: 'Organization::Group' | |
| # has_many :children, class_name: 'Organization::Group', | |
| # foreign_key: :parent_id | |
| # has_many :group_memberships, dependent: :destroy | |
| # has_many :users, through: :group_memberships | |
| RECURSIVE_UP = <<SQL.freeze |
so basically here in postgres_adapter.rb I am manually raising a raise Rack::Timeout::RequestTimeoutError and if that exception is captured, the code continues to execute, then the next time the code wants to access the DB the PG::DuplicatePstatement: ERROR will occurr.
the way to solve this is to add a begin/ensure block to the affected area to make sure prepared statements are generated correctly
NOTE: i raise the error when the counter gets to 130 since this method is excecuted many times
| module ErrorNormalization | |
| extend ActiveSupport::Concern | |
| included do | |
| rescue_from CanCan::AccessDenied, with: :render_forbidden | |
| rescue_from ActiveRecord::RecordNotFound, with: :render_not_found | |
| rescue_from ActionController::ParameterMissing, with: :render_bad_request | |
| end | |
| def render_forbidden |
| Nov 03 17:56:52 rema-mine-ansatte app/web.4: source=rack-timeout id=5cbf5e4f-1011-4b45-8205-8ce70df979dd wait=94ms timeout=29000ms state=ready | |
| Nov 03 17:56:52 rema-mine-ansatte app/web.4: Processing by API::V1::EmployeesController#create as JSON | |
| Nov 03 17:56:52 rema-mine-ansatte app/web.4: Started POST "/api/v1/stores/1111/employees.json" for 62.92.0.125 at 2015-11-03 16:56:51 +0000 | |
| Nov 03 17:56:52 rema-mine-ansatte app/web.4: Parameters: {"employee"=>{"address"=>"Ratvikveien 435", "age_group"=>"", "bank_account_number"=>"[FILTERED]", "birthdate"=>"1974-06-30", "city"=>"Åfjord", "collective_agreement"=>"1", "complete"=>"", "country_code"=>"NO", "display_name"=>"Anita Helen By", "draft_id"=>"5638e319633532000d000000", "email_address"=>"[email protected]", "employment_percent"=>"13.33333333333333", "employment_type"=>"1", "end_date"=>"", "first_name"=>"Anita Helen", "hourly_pay_entry_date"=>"2015-11-03 00:00:00 +0000", "hourly_pay_level"=>"9", "hourly_pay_premium_currency"=>"", "hourly_pay_premium_pe |