This file contains 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
class StoredMethod | |
attr_accessor :result, :method, :args | |
def initialize(result, method, args) | |
@result = result | |
@method = method | |
@args = args | |
end | |
def execute(obj) | |
res = obj.send(@method, @args) |
This file contains 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
--- stack | |
zsh, nvim, tmux | |
--- .vimrc | |
source ~/.vim/autoload/pathogen.vim | |
execute pathogen#infect() | |
call pathogen#helptags() | |
filetype indent plugin on |
This file contains 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
testd |
This file contains 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 | |
module ActiveRecord | |
module Validations | |
class AbsenceValidator < ActiveModel::Validations::AbsenceValidator # :nodoc: | |
def validate_each(record, attribute, association_or_value) | |
if record.class._reflect_on_association(attribute) | |
association_or_value = Array.wrap(association_or_value).reject(&:marked_for_destruction?) | |
end | |
super |
This file contains 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 | |
class PeopleHaveMiddleNames < ActiveRecord::Migration::Current | |
def self.up | |
add_column "people", "middle_name", :string | |
end | |
def self.down | |
remove_column "people", "middle_name" | |
end |
This file contains 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 | |
module ActiveModel | |
module Validations | |
# == \Active \Model Absence Validator | |
class AbsenceValidator < EachValidator # :nodoc: | |
def validate_each(record, attr_name, value) | |
record.errors.add(attr_name, :present, **options) if value.present? | |
end | |
end |
This file contains 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 | |
ORIG_ARGV = ARGV.dup | |
require "bundler/setup" | |
require "active_support/core_ext/kernel/reporting" | |
silence_warnings do | |
Encoding.default_internal = Encoding::UTF_8 | |
Encoding.default_external = Encoding::UTF_8 |
This file contains 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 | |
module AbcHelper | |
def bare_a() end | |
end |
This file contains 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 | |
class PeopleHaveMiddleNames < ActiveRecord::Migration::Current | |
def self.up | |
add_column "people", "middle_name", :string | |
end | |
def self.down | |
remove_column "people", "middle_name" | |
end |
This file contains 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
* Freescale 83xx and 512x PCI bridges | |
Freescale 83xx and 512x SOCs include the same PCI bridge core. | |
83xx/512x specific notes: | |
- reg: should contain two address length tuples | |
The first is for the internal PCI bridge registers | |
The second is for the PCI config space access registers | |
Example (MPC8313ERDB) |
OlderNewer