Skip to content

Instantly share code, notes, and snippets.

View woto's full-sized avatar
😎
nothing interesting here

Руслан Корнев woto

😎
nothing interesting here
View GitHub Profile
ru:
activemodel:
errors:
models:
payments/tinkoff/cancel:
attributes:
base:
failure: "Ошибка #%{interaction_id} %{details}"
payments/tinkoff/init:
attributes:
@woto
woto / tinkoff_cancel.json
Created April 21, 2024 22:28
Tinkoff cancel
{
"TerminalKey": "TinkoffBankTest",
"PaymentId": 2304882,
"Token": "c0ad1dfc4e94ed44715c5ed0e84f8ec439695b9ac219a7a19555a075a3c3ed24",
"IP": "192.168.255.255",
"Amount": 19200,
"Receipt": {
"FfdVersion": "string",
"ClientInfo": {
"Birthdate": "string",
@woto
woto / WYSIWYG.md
Created November 28, 2020 20:21 — forked from monolithed/WYSIWYG.md
WYSIWYG редакторы

Модуль должен соответствовать следующим требованиям:

  • Свободная лицензия (в идеале)
  • API
  • Масштабировать текст по количеству символов (в идеале)
  • Быть кроссбраузерным IE9+
  • Сокращать ссылки и подсвечивать ссылки
  • Иметь защиту от XSS
  • Конфигурироваться
  • Поддерживать историю
{
:duration => 0.21136004943400621,
:allocations => 5,
:cpu_time => 0.09248999999999889,
:idle_time => 0.11887004943400732,
:transaction_id => "054dc3152d419f050463",
:payload => {
:rack_env => {
"CONTENT_LENGTH" => "7",
"CONTENT_TYPE" => "application/protobuf",
{
:duration => 2000.2723450306803,
:allocations => 20,
:cpu_time => 0.20638099999999854,
:idle_time => 2000.0659640306803,
:transaction_id => "054dc3152d419f050463",
:payload => {
:rack_env => {
"CONTENT_LENGTH" => "7",
"CONTENT_TYPE" => "application/protobuf",
@woto
woto / rake.md
Last active October 22, 2019 10:44
rake tasks
@woto
woto / migration.md
Last active October 21, 2019 10:36
rails generate migration

You can create the table and index with the generator without changing the migration file

For a unique index

rails generate model CreateFoos bar:string:uniq

For a non-unique index

rails generate model CreateFoos bar:string:index

default: &default
truncate: true
sequence: true
root:
- <<: *default
table: schema_migrations
sql: SELECT * FROM schema_migrations
sequence: false
@woto
woto / 1.txt
Created December 6, 2018 12:04
gdeslon=# begin;
BEGIN
gdeslon=# UPDATE sales SET initiator = 'human' WHERE gs_order_id IN (4733101,4814060,5045578,2761356,3113259,3158908,5060756,3227701,4994584,3472936,4643596,4325613,5097799,4463556,4709183,5057299,5102945,3037175,3141875,3889107,4746201,4698855,3899259,4308014,4620971,3445374,4973622,3073276,4753219,4632260,4398456,5055112,5396304,5186646,5395751,5336857,5396205,3598535,4474090,5381409,5359223,5386413,5384849,3311271,5385151,5387127,5383425,5386496,5093853,5346721,5274973,4959252,4874160,5249273,5298124,5321132,3322202,4528250,4701741,4628222,5172108,5295830,5395261,5373196,5231922,5332825,5362603,5384270,4226945,5371464,5325283,5208760,3962696,5341750,5344433,5344938,4170788,4360691,4362785,4436840,4562022,3989914,5349389,5368872,5323842,5507156,5507155,5507134,5507158,5507159,5484752,5507132,5484754,5507161,5484753,5484751,5484757,5507157,5507162,5484756,5467484,5484755,5454971,5507154,5454930,5454944,5454985,5454976,5467487,5454945,5467483,5454936,5467486,5454973,5454961,5454964,5454
@woto
woto / tmp
Last active March 20, 2018 21:27
root@0993fea07a16:/app/db/migrate# rake db:migrate
(in /app)
D, [2018-03-21T00:16:46.850190 #55] DEBUG -- : (1.4ms) SELECT pg_try_advisory_lock(3372214896220972305)
D, [2018-03-21T00:16:46.861403 #55] DEBUG -- : (2.5ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC
I, [2018-03-21T00:16:46.862738 #55] INFO -- : Migrating to AddInitiatorToSales (20180306170359)
D, [2018-03-21T00:16:46.864178 #55] DEBUG -- : (0.4ms) BEGIN
== 20180306170359 AddInitiatorToSales: migrating ==============================
-- add_column(:sales, :initiator, :string)
D, [2018-03-21T00:16:46.869565 #55] DEBUG -- : (4.4ms) ALTER TABLE "sales" ADD "initiator" character varying
-> 0.0053s