Skip to content

Instantly share code, notes, and snippets.

View golodenko's full-sized avatar
🏠
Working from home and so should you

Nik Holo golodenko

🏠
Working from home and so should you
  • Ivano-Frankivsk, Ukraine
View GitHub Profile
@golodenko
golodenko / gulpfile.js
Created August 25, 2017 09:07
custom gulp config
'use strict';
var gulp = require('gulp'),
path = require('path'),
del = require('del'),
rename = require('gulp-rename'),
gutil = require('gulp-util'),
plumber = require('gulp-plumber'),
portfinder = require('portfinder'),
postcss = require('gulp-postcss'),

Keybase proof

I hereby claim:

  • I am golodenko on github.
  • I am golodenko (https://keybase.io/golodenko) on keybase.
  • I have a public key ASBjOQBWXFYsJSJ6n47HkYiFD4qmYOeiI1NSVYvslpXahwo

To claim this, I am signing this object:

puts 'testing ========='
tasks = ::Task::Base.where(title: 'Reply to message', created_at_from: '2020-01-01', created_at_to: '2020-07-10').to_a
puts "==== TASKS BATCH SIZE: #{tasks.size}"
arr = tasks.map(&:parent_guid).join(', ')
puts arr
puts '====== DONE'
@golodenko
golodenko / progress.rb
Last active October 2, 2020 15:43
progress.rb
ids = [229604, 269913, 269997]
ids.each do |id|
complaint = Complaint.find(id)
trace_id = SecureRandom.hex(32)
current_user = User.find(184683)
Services::Workflow.new(complaint, nil, trace_id).complete_prepare_case_by_system!
::Complaints::Statuses::CheckNextActionAtWorker.perform_async(complaint_id: id)
end
@golodenko
golodenko / update_tasks.rb
Last active August 7, 2020 20:49
update_tasks.rb
puts 'Started updating tasks parents'
started_at = Time.now
updated = 0
updated_task_ids = []
relation = ::Task.where(guide_guid: 'reply_to_message')
tasks_count = relation.count
puts "tasks to update #{tasks_count}"
relation.find_each(batch_size: 100) do |task|
@golodenko
golodenko / checking_tasks_mt.rb
Last active November 9, 2020 15:06
checking_tasks_mt.rb
failed_tasks = []
failed_tasks_by_ref = []
task_ids = [329136, 538046, 538356, 26390, 132307, 499667, 53154, 73316, 87621, 611359, 657803, 457885, 554784, 607724, 629694, 663473, 127289, 130200, 298003, 488789, 50716, 272952, 27791, 71771, 71869, 71872, 72035, 72041, 85363, 722455, 54784]
task_ids.each do |task_id|
task = ::Task.find(task_id)
puts "no task found wih #{task_id}" if task.blank?
failed_tasks << task_id if task.blank? || task.initial_message["complaint_id"].blank?
puts "no complaint_id for task ##{task.id}" if task.initial_message["complaint_id"].blank?
next if task.initial_message["complaint_id"].blank?