Skip to content

Instantly share code, notes, and snippets.

View TrumpClone's full-sized avatar

Optimus Advocate TrumpClone

View GitHub Profile
# frozen_string_literal: true
module Distribution::Transmission::Hooks::Hookable
HookError = Class.new(StandardError)
UnexistentHookError = Class.new(HookError)
class << self
def included(base_class)
base_class.extend ClassMethods
end
# frozen_string_literal: true
module Distribution::Transmission::Hooks::Hookable
HookError = Class.new(StandardError)
UnexistentHookError = Class.new(HookError)
class << self
def included(base_class)
base_class.extend ClassMethods
end
@TrumpClone
TrumpClone / asdasdasd
Created December 26, 2017 12:19
asdasd
# frozen_string_literal: true
module Distribution::Transmission::Hooks::Hookable
HookError = Class.new(StandardError)
UnexistentHookError = Class.new(HookError)
class << self
def included(base_class)
base_class.extend ClassMethods
end
@TrumpClone
TrumpClone / GG NO RE LOH
Created January 24, 2018 11:57
SUBLIME KEK PEK
[
{ "keys": ["super+§"], "command": "copy_path" },
{ "keys": ["super+option+§"], "command": "reveal_in_side_bar" }
]
# frozen_string_literal: true
# @see https://github.com/rails/rails/blob/4-2-stable/activerecord/lib/active_record/store.rb
module ActiveRecord::Store::ClassMethods
def multi_store_accessor(store_attributes, *keys, store_host: nil)
store_host = store_attributes.first unless store_host
keys = keys.flatten
_store_accessors_module.module_eval do
keys.each do |key|
# rubocop:disable all
class Module
# TODO: (@exclusive) refactor and make PR to Ruby on Rails (ActiveSupport)
# NOTE: rails => /v4.2.10/activesupport/lib/active_support/core_ext/module/delegation.rb
module FixNumberNamedMethodsDelegation
# NOTE: rails => /v4.2.10/activesupport/lib/active_support/core_ext/module/delegation.rb
def delegate(*methods)
options = methods.pop
unless options.is_a?(Hash) && to = options[:to]