Skip to content

Instantly share code, notes, and snippets.

View CyJimmy264's full-sized avatar
💚

Maksim Veynberg CyJimmy264

💚
View GitHub Profile

Keybase proof

I hereby claim:

  • I am cyjimmy264 on github.
  • I am mveynberg (https://keybase.io/mveynberg) on keybase.
  • I have a public key ASDdg0QAGdUUWq8ipE9gbEW6g-w5Sm-ocfG0MReUIFpm-Qo

To claim this, I am signing this object:

@CyJimmy264
CyJimmy264 / enum_validatable.rb
Created February 28, 2023 09:39
ActiveRecord::Enum validation in Rails API
# frozen_string_literal: true
# ActiveRecord::Enum validation in Rails API
# https://medium.com/nerd-for-tech/using-activerecord-enum-in-rails-35edc2e9070f
module EnumValidatable
extend ActiveSupport::Concern
class_methods do
def validatable_enum(*enums_to_fix)
enums_to_fix.each do |element|
@CyJimmy264
CyJimmy264 / tips_tricks.org
Last active March 14, 2023 02:11
Tips & Tricks

Emacs

The VC package is built into Emacs and provides some basic support for browsing file versions, browsing logs, checking out, committing, etc. VC commands are bound to C-x v by default.

There are several commands to access other revisions. If you know what revision you want to open, press C-x v ~ (vc-revision-other-window). To open the last revision that changed a given line, press C-x v g (vc-annotate), and press f (vc-annotate-find-revision-at-line) on the desired line. If you want to find and open a revision based on its log message, run C-x v l (vc-print-log) and press f (log-view-find-revision) when the cursor is on the desired commit.

Shell

https://dev.to/equiman/why-oh-my-zsh-is-so-cool-31gd

@CyJimmy264
CyJimmy264 / claude.ai.md
Created October 27, 2024 11:14
Combining RSpec Matchers with Negation

У меня есть такой пример:

    it 'does not change payment status, cancellation reason, or output cancellation message' do
      expect { job }
        .not_to change { payment.reload.payment_status }.from('transferring')
        .and change { payment.reload.cancellation_reason }.from(nil)
        .and output(/Платёж #{payment.uuid} отменён/).to_stdout
    end
@CyJimmy264
CyJimmy264 / Jira Auto Description Diff-1.0.user.js
Last active April 15, 2025 19:22
Jira Auto Description Diff
// ==UserScript==
// @name Jira Auto Description Diff
// @namespace http://tampermonkey.net/
// @version 1.0.1
// @description Автоматически показывает diff изменений описания в задачах Jira
// @author ты
// @match *://jira.esokolov.com/*
// @grant none
// ==/UserScript==
var diff_match_patch=function(){this.Diff_Timeout=1;this.Diff_EditCost=4;this.Match_Threshold=.5;this.Match_Distance=1E3;this.Patch_DeleteThreshold=.5;this.Patch_Margin=4;this.Match_MaxBits=32},DIFF_DELETE=-1,DIFF_INSERT=1,DIFF_EQUAL=0;diff_match_patch.Diff=function(a,b){this[0]=a;this[1]=b};diff_match_patch.Diff.prototype.length=2;diff_match_patch.Diff.prototype.toString=function(){return this[0]+","+this[1]};