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
User.where('email !~* ?', '.+@.+\..+').ids |
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
location ~* \.(jsgz|datagz|memgz|unity3dgz)$ { | |
add_header Content-Encoding gzip; | |
break; | |
} |
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
install docker-compose | |
cd ${your_project_path} | |
git submodule add https://github.com/Laradock/laradock.git | |
cd laradock | |
git checkout v4.20.0 | |
rm nginx/sites/laravel-https.conf | |
open docker-compose.yml | |
find workspace: and find INSTALL_NODE and set it to true |
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
[[email protected] /var/www/shopper/ss/current/log]$ zcat production.log-20170321.gz | grep '2017-03-20T18:57:21.144275 #1282' -A 30 | |
D, [2017-03-20T18:57:21.144275 #1282] DEBUG -- : [85d9fbfa-1539-48da-beba-b1c8d25ff5fc] (1.0ms) ROLLBACK | |
I, [2017-03-20T18:57:21.144523 #1282] INFO -- : [85d9fbfa-1539-48da-beba-b1c8d25ff5fc] Completed 500 Internal Server Error in 1059ms (ActiveRecord: 1032.1ms) | |
D, [2017-03-20T18:57:21.144579 #1282] DEBUG -- : [5b0994f6-e263-4a99-8e43-0c8d2ab20c85] Billing::Account Load (0.3ms) SELECT "billing_accounts".* FROM "billing_accounts" WHERE "billing_accounts"."owner_id" = $1 AND "billing_accounts"."owner_type" = $2 LIMIT 1 [["owner_id", 659], ["owner_type", "Promotion"]] | |
F, [2017-03-20T18:57:21.145696 #1282] FATAL -- : [85d9fbfa-1539-48da-beba-b1c8d25ff5fc] | |
ActiveRecord::StatementInvalid (PG::TRDeadlockDetected: ERROR: deadlock detected | |
ПОДРОБНОСТИ: Process 14287 waits for ShareLock on transaction 15108488; blocked by process 8732. | |
Process 8732 waits for AccessExclus |
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
zcat production.log-20161231.gz | grep 'PATCH "/admin/promotions/694"' -A 3 | grep 'goods_required_amount' | |
find . -type f -name 'production*\.gz' -exec sh -c "zcat {} | grep 'PATCH "/admin/promotions/694"' -A 3 | grep 'goods_required_amount'" \; |
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
bundle exec rubocop $(gs | grep '.rb' | awk '{print $2}' | xargs) |
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
Dry::Validation::Schema::Params.configure do |config| | |
config.messages_file = Rails.root.join('config', 'locales', 'errors.yml') | |
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
class ApplicationService < Performify::Base | |
def initialize(*params) | |
params = params.try(:first).try(:deep_symbolize_keys) || {} | |
@current_user = params.delete(:current_user) | |
@args = params | |
prepare_instance | |
fail!(with_callbacks: false) if errors? | |
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
schema = Dry::Validation.Schema(Dry::Validation::Schema::Params) do | |
optional(:password).maybe(:str?, min_size?: 6) | |
optional(:identity_id).maybe(:int?) | |
rule(password_or_identity_id_filled: %i[password identity_id]) do |password, identity_id| | |
password.filled? | identity_id.filled? | |
end | |
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
schema = Dry::Validation.Schema(Dry::Validation::Schema::Params) do | |
configure { config.namespace = :user } | |
end |