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
# frozen_string_literal: true | |
require "set" | |
PROJECT_ROOT = Dir.pwd | |
OVERWRITE = true # перезаписывать блок при каждом запуске | |
MAKE_BACKUP = false # писать .bak | |
MAX_SAMPLES = 10 | |
# ───────── helpers | |
def project_file?(path) |
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
# Add somewhere inside you spec file | |
require 'ruby_parser' | |
RSpec.configure do |config| | |
config.after(:suite) do | |
# Calling compare_traces after all suites complete | |
compare_traces('trace_with_feature_on.txt', 'trace_with_feature_off.txt') | |
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
# frozen_string_literal: true | |
# == Examples of usage | |
# class A | |
# include WithRetry | |
# | |
# def process | |
# with_retry(catch_only_on_expections: [StandardError]) do | |
# # do something | |
# 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
call plug#begin('~/.vim/plugged') | |
Plug 'xolox/vim-misc' | |
Plug 'scrooloose/nerdtree', { 'on': 'NERDTreeToggle' } | |
"Plug 'jiangmiao/auto-pairs' | |
Plug 'tpope/vim-fugitive' "git differences, other git intergations" | |
Plug 'airblade/vim-gitgutter' "deleteon and insertion marks" | |
Plug 'kien/ctrlp.vim' | |
Plug 'morhetz/gruvbox' | |
Plug 'easymotion/vim-easymotion' |
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
ActiveRecord::Base.connection.execute('select \'drop table "\' || tablename || \'" cascade;\' from pg_tables where schemaname = \'public\'').to_a.map{|e| e.values[0]}.each {|stmt| ActiveRecord::Base.connection.execute(stmt)} |