Skip to content

Instantly share code, notes, and snippets.

View tatyshev's full-sized avatar
🏠
Working from home

Ruslan tatyshev

🏠
Working from home
  • FundraiseUp
  • Kyrgyzstan
View GitHub Profile
@tatyshev
tatyshev / stalled-groups.js
Last active October 21, 2021 08:58
stalled groups
const hoursFromNow = hours => moment().subtract(hours, 'hour').toDate()
// Stalled groups table
db.jobgroups.aggregate()
.match({
'jobs.1': { $exists: true },
$or: [
{
lastPulledAt: { $lte: hoursFromNow(2) },
},
apt-get install npm
sudo ln -fs /usr/bin/nodejs /usr/local/bin/node
npm i -g yarn
@tatyshev
tatyshev / errors_for.rb
Created August 18, 2015 11:40
missing errors_for method for formBuilder
module ActionView
module Helpers
class FormBuilder
include ActionView::Helpers::TagHelper
include ActionView::Context
def errors_for(object_name, options = {})
return if (errors = object.errors[object_name]).empty?
options[:class] ||= 'form_input-errors' # default class