Skip to content

Instantly share code, notes, and snippets.

View bibendi's full-sized avatar

Misha Merkushin bibendi

View GitHub Profile
bibendi / .zshrc
Last active December 24, 2021 07:15
Dual architecture on M1 Apple Silicon
# Homebrew
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"
if [[ "$_ARCH" == "arm64" ]]; then
bibendi /
Created December 22, 2021 09:16 — forked from MarkBennett/
Installing Ruby 2.5 on Mac M1
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
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 ='db:bloat')
connection = ActiveRecord::Base.connection
connection.tables.each do |table_name|
rows_counted = redis.hget('tables', table_name)
class MutationRoot < Common::GraphQL::MutationRoot
with_options authenticate: true do
field :create_direct_upload, mutation: Mutations::CreateDirectUpload
with_options authenticate: true, user_checks: {completed: true} do
field :follow_user, mutation: Mutations::FollowUser
field :unfollow_user, mutation: Mutations::UnfollowUser
# frozen_string_literal: true
module CoreBy
module FieldExtensions
# GraphQL field extension allows returning URL of Active Storage attachment.
# TODO: Move to `graphql-field_attachment` gem?
class AttachmentUrlField < GraphQL::Schema::FieldExtension
attr_reader :attachment_assoc
def apply
bibendi /
Created November 7, 2019 19:37 — forked from furdarius/
Настройка обхода РКН на роутере
bibendi /
Created April 16, 2019 14:45 — forked from seebk/
Extract embedded certificates and keys from OpenVPN config files

This python script is intended to automate the extraction of embedded certificates and keys from OpenVPN config files.

Unfortunately the GNOME Network-Manager is not able to automatically import OpenVPN config files with embedded certificates and keys. A workaround is to manually extract these and store them in separate files (e.g. see


  • Make shure all the required packages are installed. For example on Ubuntu and Debian run:

    $ sudo apt-get install python3 network-manager-openvpn-gnome

bibendi / unwatch.rb
Last active November 1, 2018 17:34
Unwatch all Organization's repositories
require "octokit"
client = "")
client.auto_paginate = true
client.organization_repositories('abak-press', type: 'all').each do |repo|
client.forks( do |fork|
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')