Skip to content

Instantly share code, notes, and snippets.

Avatar

Misha Merkushin bibendi

View GitHub Profile
View attachment_url_field.rb
# 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
bibendi / rkn_unblock.md
Created Nov 7, 2019 — forked from furdarius/rkn_unblock.md
Настройка обхода РКН на роутере
View rkn_unblock.md
@bibendi
bibendi / README.md
Created Apr 16, 2019 — forked from seebk/README.md
Extract embedded certificates and keys from OpenVPN config files
View README.md

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 https://naveensnayak.wordpress.com/2013/03/04/ubuntu-openvpn-with-ovpn-file/).

Instructions:

  • 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
bibendi / unwatch.rb
Last active Nov 1, 2018
Unwatch all Organization's repositories
View unwatch.rb
require "octokit"
client = Octokit::Client.new(access_token: "")
client.auto_paginate = true
client.organization_repositories('abak-press', type: 'all').each do |repo|
client.delete_subscription(repo.id)
client.forks(repo.id).each do |fork|
client.delete_subscription(fork.id)
@bibendi
bibendi / .pryrc
Last active Jan 14, 2021
Dip on Rails
View .pryrc
Pry.config.history.should_save = true
Pry.config.history.file = File.join(__dir__, '.pry_history')
@bibendi
bibendi / ubuntu_agnoster_install.md
Created Sep 6, 2018 — forked from renshuki/ubuntu_agnoster_install.md
Ubuntu 16.04 + Terminator + Oh My ZSH with Agnoster Theme
View ubuntu_agnoster_install.md

Install Terminator (shell)

sudo add-apt-repository ppa:gnome-terminator
sudo apt-get update
sudo apt-get install terminator

Terminator should be setup as default now. Restart your terminal (shortcut: "Ctrl+Alt+T").

Install ZSH

@bibendi
bibendi / Capybara.md
Created Sep 3, 2018 — forked from tomas-stefano/Capybara.md
Capybara cheatsheet
View Capybara.md

Capybara Actions

# Anchor
click_link 'Save'

# Button
click_button 'awesome'

# Both above
@bibendi
bibendi / _service.md
Created Aug 25, 2018 — forked from naholyr/_service.md
Sample /etc/init.d script
View _service.md

Sample service script for debianoids

Look at LSB init scripts for more information.

Usage

Copy to /etc/init.d:

# replace "$YOUR_SERVICE_NAME" with your service's name (whenever it's not enough obvious)
@bibendi
bibendi / acceptance_helper.rb
Created Aug 21, 2018
Example Capybara tests
View acceptance_helper.rb
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
View keybase.md

Keybase proof

I hereby claim:

  • I am bibendi on github.
  • I am bibendi (https://keybase.io/bibendi) on keybase.
  • I have a public key ASDynTp-5ubsrL1hm6jHzh0KkUbBfmCcb-sn_JLrSVU_awo

To claim this, I am signing this object: