Skip to content

Instantly share code, notes, and snippets.

View bibendi's full-sized avatar

Misha Merkushin bibendi

View GitHub Profile
@bibendi
bibendi / gist:7941823
Created December 13, 2013 09:21
Оформление коммитов

Для оформления сообщения коммита следует использовать следующий шаблон:

<type>(<scope>): <subject>
<BLANK LINE>
<body>

Заголовок

Тип коммита

@bibendi
bibendi / .pryrc
Last active December 5, 2023 12:52
Dip on Rails
Pry.config.history.should_save = true
Pry.config.history.file = File.join(__dir__, '.pry_history')
@bibendi
bibendi / acceptance_helper.rb
Created August 21, 2018 10:43
Example Capybara tests
require 'rails_helper'
require 'capybara/rspec'
require 'selenium-webdriver'
require 'site_prism'
Capybara.server = :puma, { Silent: true }
Capybara.server_host = `hostname`.strip.downcase
Capybara.server_port = 3002
Capybara.default_max_wait_time = 5
@bibendi
bibendi / rkn_unblock.md
Created November 7, 2019 19:37 — forked from furdarius/rkn_unblock.md
Настройка обхода РКН на роутере
@bibendi
bibendi / .zshrc
Last active December 24, 2021 07:15
Dual architecture on M1 Apple Silicon
# Homebrew
_ARCH=$(arch)
PROMPT="$_ARCH $PROMPT"
if [[ "$_ARCH" == "i386" ]]; then
local brew_path="/usr/local/homebrew/bin"
local brew_opt_path="/usr/local/homebrew/opt"
local nvm_path="$HOME/.nvm-x86"
local rbenv_path="$HOME/.rbenv-x86"
fi
if [[ "$_ARCH" == "arm64" ]]; then
@bibendi
bibendi / installing-ruby-2.5.1-on-m1.md
Created December 22, 2021 09:16 — forked from MarkBennett/installing-ruby-2.5.1-on-m1.md
Installing Ruby 2.5 on Mac M1
@bibendi
bibendi / db.rake
Created November 9, 2021 06:45
Disabling schema dumping for the statistics database on Rails 6.
raise "Remove patches below in Rails 7" if Rails::VERSION::MAJOR == 7
Rake::Task["db:schema:load:statistics"]&.clear
Rake::Task["db:_dump:statistics"]&.clear
Rake::Task["db:schema:dump:statistics"]&.clear
Rake::Task["db:test:load_schema:statistics"]&.clear
namespace :db do
namespace :schema do
desc "Creates a database schema file (either db/schema.rb or db/structure.sql, depending on `config.active_record.schema_format`)"
task dump: :load_config do
namespace :db do
namespace :bloat do
desc 'Поиск распухших таблиц'
task :tables => :environment do
redis = Redis::Namespace.new('db:bloat')
connection = ActiveRecord::Base.connection
connection.tables.each do |table_name|
begin
rows_counted = redis.hget('tables', table_name)
class MutationRoot < Common::GraphQL::MutationRoot
with_options authenticate: true do
field :create_direct_upload, mutation: Mutations::CreateDirectUpload
end
with_options authenticate: true, user_checks: {completed: true} do
field :follow_user, mutation: Mutations::FollowUser
field :unfollow_user, mutation: Mutations::UnfollowUser
end
end
@bibendi
bibendi / tgnotify
Last active September 16, 2020 22:36
Ruby CLI tool for sending notifications to Telegram
#!/usr/bin/env ruby
require 'optparse'
options = {}
opt_parser = OptionParser.new do |opt|
opt.banner = 'Usage: tgnotify [OPTIONS] text'
opt.separator ''
opt.separator 'CLI tool for sending notifications to Telegram'