This file contains hidden or 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
Encoding.default_external: UTF-8 | |
Encoding.default_internal: | |
Encoding.default_external: ASCII-8BIT | |
Encoding.default_internal: ASCII-8BIT | |
Setting no encoding on file | |
f.external_encoding: ASCII-8BIT | |
f.internal_encoding: | |
Contents: امثلة |
This file contains hidden or 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
dot -o initializers.png -T png initializers.dot |
This file contains hidden or 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
ActiveRecord::Base.establish_connection | |
# Check if the spec passed to `ActiveRecord::Base.establish_connection` can connect to the database. | |
# | |
# @return [true] if an active connection can be made to the database using the current config. | |
# @return [false] if an active connection cannot be made to the database. | |
def connection_established? | |
begin | |
# use with_connection so the connection doesn't stay pinned to the thread. | |
ActiveRecord::Base.connection_pool.with_connection { |
This file contains hidden or 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
attribute = Mdm::Host.arel_table[:address] | |
value = MetasploitDataModels::IPAddress::V4::CIDR.new(value: '1.2.3.4/8') | |
formatted_value = "#{value.address}/#{value.prefix_length}" | |
cast_argument = Arel::Nodes::As.new(formatted_value, Arel::Nodes::SqlLiteral.new('INET')) | |
# @see https://gist.github.com/mrpunkin/1996454 | |
value_as_inet = Arel::Nodes::NamedFunction.new('CAST', [cast_argument]) | |
operation = Arel::Nodes::InfixOperation.new( | |
'<<', |
This file contains hidden or 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
en: | |
metasploit: | |
model: | |
# help for an operator on a specific class/module (Metasploit::Model::Architecture) with a given name (abbreviation) | |
ancestors: | |
metasploit/model/architecture: | |
search: | |
operator: | |
names: | |
abbreviation: |
This file contains hidden or 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
Uncaught exception: undefined method `syck_to_yaml' for class `Object' | |
/Users/luke.imhoff/.rvm/rubies/ruby-1.9.3-p545/lib/ruby/1.9.1/yaml.rb:65:in `yamler=' | |
/Users/luke.imhoff/.rvm/rubies/ruby-1.9.3-p545/lib/ruby/1.9.1/yaml.rb:61:in `class_eval' | |
/Users/luke.imhoff/.rvm/rubies/ruby-1.9.3-p545/lib/ruby/1.9.1/yaml.rb:61:in `yamler=' | |
/Users/luke.imhoff/.rvm/gems/ruby-1.9.3-p545@metasploit-framework/gems/rubocop-0.23.0/lib/rubocop/config_loader.rb:10:in `<top (required)>' | |
/Users/luke.imhoff/git/limhoff-r7/metasploit-framework/lib/fastlib.rb:374:in `require' | |
/Users/luke.imhoff/git/limhoff-r7/metasploit-framework/lib/fastlib.rb:374:in `require' | |
/Users/luke.imhoff/.rvm/gems/ruby-1.9.3-p545@metasploit-framework/gems/activesupport-3.2.19/lib/active_support/dependencies.rb:251:in `block in require' | |
/Users/luke.imhoff/.rvm/gems/ruby-1.9.3-p545@metasploit-framework/gems/activesupport-3.2.19/lib/active_support/dependencies.rb:236:in `load_dependency' | |
/Users/luke.imhoff/.rvm/gems/ruby-1.9.3-p545@metasploit-framewor |
This file contains hidden or 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
$LOAD_PATH.unshift File.expand_path('../../lib', __FILE__) | |
require 'GEM_NAME' | |
RSpec.configure do |config| | |
config.expose_dsl_globally = false | |
# These two settings work together to allow you to limit a spec run | |
# to individual examples or groups you care about by tagging them with | |
# `:focus` metadata. When nothing is tagged with `:focus`, all examples |
This file contains hidden or 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
require 'spec_helper' | |
RSpec.describe GEM_NAME do | |
context 'CONSTANTS' do | |
context 'VERSION' do | |
subject(:version) { | |
described_class::VERSION | |
} | |
it { is_expected.to be_a String } |
This file contains hidden or 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
# Use find_all_by_name instead of find_by_name as find_all_by_name will return pre-release versions | |
gem_specification = Gem::Specification.find_all_by_name('metasploit-yard').first | |
Dir[File.join(gem_specification.gem_dir, 'lib', 'tasks', '**', '*.rake')].each do |rake| | |
load rake | |
end |
This file contains hidden or 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
require 'rspec/core/rake_task' | |
RSpec::Core::RakeTask.new(:spec) | |
task :default => :spec |