hexsha
stringlengths
40
40
size
int64
2
1.01M
content
stringlengths
2
1.01M
avg_line_length
float64
1.5
100
max_line_length
int64
2
1k
alphanum_fraction
float64
0.25
1
87f369bb819421cd54d6c63b07a37eae57167dd3
1,732
lib = File.expand_path("../lib", __FILE__) $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib) require "vue_gen/version" Gem::Specification.new do |spec| spec.name = "vue_gen" spec.version = VueGen::VERSION spec.authors = ["ou.yun"] spec.email = ["ou.yun@tci-cn.co.jp"] spec...
41.238095
96
0.669169
acaa4d334775caf4861f80245b0a386ea1b3aeb3
6,623
require 'net/http' require 'json' require 'openssl' module GocdClient class Service attr_reader :url def initialize(url, username, password) @url = url @username = username @password = password end ############### Server Health ############### def healthcheck if versio...
31.995169
208
0.608637
abfdacdf34247ad770dd737db26d150413feb559
115
module SafeCredentials class Engine < Rails::Engine initializer "loading configuration" do end end end
16.428571
42
0.73913
ac8c6758e5fc15b3d27ceaf712679b2cbc0aed85
3,936
class Ykman < Formula include Language::Python::Virtualenv desc "Tool for managing your YubiKey configuration" homepage "https://developers.yubico.com/yubikey-manager/" url "https://developers.yubico.com/yubikey-manager/Releases/yubikey-manager-1.0.1.tar.gz" sha256 "1f915d8899dbcf85b6b9879f5664953ce1edcd5a50...
43.252747
142
0.818852
ab1505910d96224affd18d3bc516cfc713bf59d1
37
require 'sensu-plugins-chef/version'
18.5
36
0.810811
e92fe8ae738b244a5d9f4c7b07f980778612d309
2,525
module Core class OrganizationsController < Core::ApplicationController respond_to :json before_action :filter_blocked_users, except: :index def index @organizations = Organization.finder(params[:q]) json = { records: @organizations.page(params[:page]).per(params[:per]), tot...
29.022989
99
0.646337
f719a95987153995fa81c3e750932edb4233efb6
6,262
# frozen_string_literal: true require "test_helper" require "tmpdir" if Licensed::Shell.tool_available?("go") describe Licensed::Source::Go do let(:gopath) { File.expand_path("../../fixtures/go", __FILE__) } let(:fixtures) { File.join(gopath, "src/test") } let(:config) { Licensed::Configuration.new("go" ...
31.626263
107
0.565474
abf51c4c05d0904222773a53636a8cac2e65d797
1,364
# encoding: UTF-8 require 'spec_helper' describe "show-model" do it "should print one ActiveRecord model" do output = mock_pry('show-model Beer', 'exit-all') expected = <<MODEL Beer id: integer name: string type: string rating: integer ibu: integer abv: integer belongs_to :hacker MODEL o...
24.357143
81
0.677419
e2db0e0d46cf4c1639497fac1d3a2f1cea4467a3
1,584
require_relative 'form_request' require 'open-uri' require 'hashie' Hash.send :include, Hashie::Extensions module ResponsesApi class RetrieveResponsesRequest < FormRequest ISO_8601_FORMAT = '%Y-%m-%dT%H:%M:%S'.freeze def initialize(form_id, token: APIConfig.token, page_size: 25, page: nil, ts_since: nil, ts...
29.886792
149
0.612374
6a5a90847460284587dd16dbf304b5075a36942f
334
class AddEditableToSysEditors < ActiveRecord::Migration def up add_reference :sys_editors, :editable, index: true, polymorphic: true GpArticle::Doc.find_each {|d| d.editors << Sys::Editor.find_by(parent_unid: d.unid) } end def down remove_reference :sys_editors, :editable, index: true, polymorphic: t...
30.363636
89
0.739521
e84fc658f967b8b51cb385ce8a1d83e123958609
92,358
# frozen_string_literal: true # WARNING ABOUT GENERATED CODE # # This file is generated. See the contributing guide for more information: # https://github.com/aws/aws-sdk-ruby/blob/version-3/CONTRIBUTING.md # # WARNING ABOUT GENERATED CODE require 'seahorse/client/plugins/content_length.rb' require 'aws-sdk-core/plug...
42.937238
175
0.610223
1a11eaf0910408989912846828d836c7a08bec38
1,697
# frozen_string_literal: true module NgrokAPI module Models class EndpointSAML attr_reader :client, :result, :enabled, :options_passthrough, :cookie_prefix, :inactivity_timeout, :maximum_duration, :idp_metadata_url, :idp_metadata, :for...
30.303571
85
0.63406
625cfe4e547986695d67151f5e76578454c3b2f4
22
module PageHelper end
7.333333
17
0.863636
210d05dad8a34ce0ac0d0054745393dcd00bab3a
129
class AddEndsAtToReservations < ActiveRecord::Migration def change add_column :reservations, :ends_at, :datetime end end
21.5
55
0.782946
01fce725860e7246db372d55e35215e0661017fb
173
require_relative "./gawk/version" require_relative "./gawk/cli" require_relative "./gawk/engine" require_relative "./gawk/table" module Gawk # Your code goes here... end
19.222222
33
0.751445
7ac5a15e0cd0cf29886c3794b0ef85cb6a390ca4
2,205
require 'omniauth-oauth2' module OmniAuth module Strategies class GitHub < OmniAuth::Strategies::OAuth2 option :client_options, { :site => 'https://api.github.com', :authorize_url => 'https://github.com/login/oauth/authorize', :token_url => 'https://github.com/login/oauth/access_tok...
25.941176
115
0.555556
f85b1d556f57683e3f4430b896381509e696ddb3
174
run_recipe File.dirname(__FILE__) + "/_common_accounts.rb" use_manual_close close_ledger #1 close_ledger #2 close_ledger #3 close_ledger #4 close_ledger #5 close_ledger #6
15.818182
58
0.810345
0309d5eebacfb0703ec7abb1bc50c17cb6ab9eef
478
cask 'busycontacts' do version '1.3.2' sha256 '91266016a10a33d59cc16b31d67fc211cf8e788f898be3b202cb4351175a6ca3' url 'https://www.busymac.com/download/BusyContacts.zip' appcast 'https://www.busymac.com/busycontacts/releasenotes.html' name 'BusyContacts' homepage 'https://www.busymac.com/busycontacts/index....
31.866667
75
0.75523
08bee065a194f9e8dcef29aa2f8f8fa857761864
917
class Libosip < Formula desc "Implementation of the eXosip2 stack" homepage "https://www.gnu.org/software/osip/" url "https://ftpmirror.gnu.org/osip/libosip2-4.1.0.tar.gz" mirror "https://ftp.gnu.org/gnu/osip/libosip2-4.1.0.tar.gz" sha256 "996aa0363316a871915b6f12562af53853a9962bb93f6abe1ae69f8de7008504" b...
39.869565
95
0.752454
bf71f861900de27a6f94f5eea4871f24849ac997
1,624
class PhotosController < ApplicationController before_action :find_photos, only: [:show, :edit, :update, :destroy] # before_action :correct_users_photos, only: [:show, :edit, :update, :destroy] def index @photos = current_user.photos end def new @photo = Photo.new end d...
21.945946
84
0.574507
114aa3ed96fd6171310017a52785ed7993afbad2
1,448
require 'rails_helper' RSpec.describe "Media", type: :request do let(:metadata) do {author: "author", album: "albumname"} end let(:metadata2) do {author: "author2", album: "albumname2"} end let(:digests) do [ "aaa:1000", "bbb:1300", "ccc:1800" ] end let(:digests2) do ...
20.685714
97
0.609116
f8548657d46ed5ba4e993e75d536e0b741dcac11
175
module Spree::SearchResult def title raise NotImplementedError end def image raise NotImplementedError end def url raise NotImplementedError end end
12.5
29
0.737143
39ef9f29b7cb08a51346fccc61430082fdf6dbda
1,859
class Thor class Argument #:nodoc: VALID_TYPES = [ :numeric, :hash, :array, :string ] attr_reader :name, :description, :enum, :required, :type, :default, :banner alias :human_name :name def initialize(name, options={}) class_name = self.class.name.split("::").last type = options[:type] ...
24.786667
115
0.56213
28c9e4a1f4ddd03a6ed1118b453eff1b7337cfb4
1,260
require "prawn" class SnapApplicationExtraMemberPdf def initialize(members:, attributes_class:, title:) @members = members @attributes_class = attributes_class @title = title end def completed_file pdf = Prawn::Document.new pdf.bounding_box([40, pdf.cursor - 40], width: 500, height: 600) do...
19.6875
71
0.621429
7a262dd025ce0555351fe5cc44166536f1c8d418
9,522
module Banzai module Filter # Issues, Merge Requests, Snippets, Commits and Commit Ranges share # similar functionality in reference filtering. class AbstractReferenceFilter < ReferenceFilter include CrossProjectReference def self.object_class # Implement in child class # Exam...
29.388889
105
0.588322
e88339408e95e0ed58e2c4d30706fbe78a7aadaf
124
class EducationSerializer < ActiveModel::Serializer attributes :id, :school, :location, :startDate, :endDate, :degree end
31
67
0.774194
2689da79e778ef00037ceac1e3e5f583d3f85178
2,951
$LOAD_PATH.unshift File.expand_path('../lib', __dir__) require 'influxdb-client' # warning: Invokable Scripts are supported only in InfluxDB Cloud, currently there is no support in InfluxDB OSS. url = 'https://us-west-2-1.aws.cloud2.influxdata.com' token = '...' bucket = '...' org = '...' client = InfluxDB2::Client....
32.428571
118
0.648594
28026191219a37dffcd63d109599100581257a08
1,325
if RUBY_VERSION < "1.9" $stderr.puts "Sorry, Cucumber features are only meant to run on Ruby 1.9+ :(" exit 0 end require 'bundler' Bundler.setup require 'aruba/cucumber' require 'aruba/jruby' if RUBY_ENGINE == 'jruby' require 'capybara/cucumber' require 'minitest/autorun' require 'phantomjs/poltergeist' # Fake ra...
28.804348
101
0.713962
61250b0ff991cdde82dc1a1ffcbf8ba315fe9fe8
1,388
# rubocop:disable Metrics/LineLength # == Schema Information # # Table name: drama_castings # # id :integer not null, primary key # locale :string not null, indexed => [drama_character_id, person_id] # notes :string # created_at :datetime # update...
36.526316
98
0.695245
387d53dea3914fcc8beb5c703bc7a029f5578507
467
$LOAD_PATH.unshift File.expand_path('../../lib', __FILE__) require 'hayrick' require 'sequel' require 'database_cleaner' require_relative 'support/database_setup' require_relative 'support/helpers' RSpec.configure do |config| config.include Helpers config.before(:suite) do DatabaseCleaner.strategy = :transac...
22.238095
58
0.762313
ffe7f7657e10f865a1f1af9cf1040d140bb31d8d
3,298
class Perl < Formula desc "Highly capable, feature-rich programming language" homepage "https://www.perl.org/" url "https://www.cpan.org/src/5.0/perl-5.34.0.tar.xz" sha256 "82c2e5e5c71b0e10487a80d79140469ab1f8056349ca8545140a224dbbed7ded" license any_of: ["Artistic-1.0-Perl", "GPL-1.0-or-later"] head "https...
34.715789
109
0.671316
01df9934ea334d0a2b65d874f92ea9363d312825
279
# frozen_string_literal: true module OrkaAPI class Client # The version of this gem. VERSION = "0.1.0" # The Orka API version this gem supports. Support for other versions is not guaranteed, in particular older # versions. API_VERSION = "1.7.0" end end
21.461538
111
0.691756
f76fff4d2f319d6a082ef52c685c958c2b0fa3ce
76
require 'spec_helper_acceptance' # Ensure DCCP is disabled - Section 3.5.1
19
41
0.776316
ed39872a6f94c48b97bfa63543bccef4489779f7
1,312
require 'spec_helper' describe Arachni::Framework::Parts::Plugin do include_examples 'framework' describe '#plugins' do it 'provides access to the plugin manager' do expect(subject.plugins.is_a?( Arachni::Plugin::Manager )).to be_truthy expect(subject.plugins.available.sort).to...
30.511628
85
0.55564
ed97ab0fce8847133da500714522fbea31bc1cac
4,105
# Run `rake sinatra-contrib.gemspec` to update the gemspec. Gem::Specification.new do |s| s.name = "sinatra-contrib" s.version = "1.4.0" s.description = "Collection of useful Sinatra extensions" s.homepage = "http://github.com/sinatra/sinatra-contrib" s.summary = s.description # generated...
32.070313
61
0.687942
ababc759df9380ceb1144a42b84fb588a985a5b4
2,999
# frozen_string_literal: true require "spid/saml2" require "spid/sso" require "spid/slo" require "spid/rack" require "spid/metadata" require "spid/version" require "spid/configuration" require "spid/identity_provider_manager" require "spid/synchronize_idp_metadata" module Spid # :nodoc: class UnknownAuthnComparison...
26.078261
79
0.718906
ed29b26a540b44c5781ce7ac4680a5798f108ee3
1,404
module I18n module Sync # Main class class Work attr_accessor :master, :debug def initialize(master, opts = {}) @master = YamlFile.new(master) say "Start work on #{master}" end def self.sync_dir(path, master, opts = {}) path ||= DEFAULT_LOCALE fail "Pa...
24.631579
70
0.510684
edb00c261187ac7474ca31d7963a6727391aafda
1,660
require 'rails_helper' describe 'leagues/matches/index' do let(:div) { build(:league_division) } let(:home_team) { build_stubbed(:league_roster) } let(:away_team) { build_stubbed(:league_roster) } before do @matches = [] @matches << build_stubbed(:league_match, home_team: home_team, ...
38.604651
91
0.656024
1d29285cd76f4a849df38523a56da784e40c2aa2
388
ActiveRecord::QueryMethods.module_eval do def bind_parameters(opts) binds = [] opts.each do |(column, value)| if(value.nil?) raise ArgumentError.new("nils are not allowed in bind parameter. please sanitize value for column: '#{column}'") end binds.push [@klass.columns_hash[column.to_...
27.714286
120
0.667526
edce0ceeb056ef3668296d7942a77e9597ce16a9
1,310
require 'renewable/version' module Renewable def initialize(attributes = {}, options = {}) attributes, options = process_arguments(attributes.dup, options.dup) renewable_process_attributes(attributes) renewable_process_options(options) attributes, options = before_freeze(attributes, options) self...
21.833333
72
0.748092
d5eef7d266c81d95e3540488122b2eac8e767b85
4,386
class Internetarchive < Formula include Language::Python::Virtualenv desc "Python wrapper for the various Internet Archive APIs" homepage "https://github.com/jjjake/internetarchive" url "https://files.pythonhosted.org/packages/9f/30/edd23ef4968ac86f587ec7d152887e8005ee9ca7e058fe2c90c38157274e/internetarchive-2...
49.840909
148
0.824897
1ca0ae196b8623c424d21c3a4497568c77845736
781
require "active_record" require "active_record/relation" require "active_record/relation/query_methods.rb" module ActiveRecord::QueryMethods def structurally_incompatible_values_for_or(other) (ActiveRecord::Relation::SINGLE_VALUE_METHODS - [:distinct]).reject { |m| send("#{m}_value") == other.send("#{m}_value...
55.785714
196
0.693982
6aa7cf47f911d6a854d6e2b25b951dd4d402700d
282
$LOAD_PATH.unshift(File.dirname(__FILE__)) require 'config/application' use Rack::Cors do allow do origins '*' resource '*', headers: :any, methods: [:get, :post, :put, :delete, :options] end end use OTR::ActiveRecord::ConnectionManagement run GrapeOAuth2Sample::API
20.142857
80
0.712766
5d4951a145a14b5ede66887504d527cd12be2ccd
2,600
# A sweep represents a batch of Snapshots that were triggered simultaneously, # such as after a deploy. class Sweep < ActiveRecord::Base belongs_to :project has_many :snapshots attr_accessor :delay_seconds validates :title, presence: true validates :emai...
27.659574
79
0.688077
018397910031a7830c455849c54419e672138b78
659
require "#{Rails.root}/lib/ghauth" class GhauthController < ApplicationController rescue_from OAuth::Unauthorized, :with => Proc.new { redirect_to '/' } def sign_in redirect_to GhAuth.oauth.authorize_url(client_id: GhAuth.config['client_id'], scope: 'user:email') end def callback token = GhAuth.oau...
27.458333
102
0.705615
266ee7929043839c82003639b4087f194f40eeac
880
# rubocop:disable Metrics/LineLength # == Schema Information # # Table name: notification_settings # # id :integer not null, primary key # email_enabled :boolean default(TRUE) # fb_messenger_enabled :boolean default(TRUE) # mobile_enabled :boolean d...
27.5
63
0.6125
aca906ae7f473370c9378f0abdecc3bc221f17f5
16,185
module ActiveMerchant #:nodoc: module Billing #:nodoc: class WorldpayGateway < Gateway self.test_url = 'https://secure-test.worldpay.com/jsp/merchant/xml/paymentService.jsp' self.live_url = 'https://secure.worldpay.com/jsp/merchant/xml/paymentService.jsp' self.default_currency = 'GBP' sel...
36.127232
174
0.600494
f78242da6800413af23d52cd079f35cc42b76afe
724
# Time Complexity: O(n) # Space Complexity: O(1) def max_sub_array(nums) max_so_far = nums[0] max_ending_here = nums[0] i = 1 while i < nums.length max_ending_here = max_ending_here + nums[i] if max_so_far < max_ending_here max_so_far = max_ending_here end if max_ending_here <...
23.354839
49
0.633978
1dbc25acda7c8fdcaad3f71fe351b03e7d1b78cf
840
cask 'adguard' do version '2.1.3.600' sha256 '40a56f23f0424c3c8242e9de75871803d2a6f9affcabb9031e57657eebbd6a5b' url "https://static.adguard.com/mac/release/AdGuard-#{version}.dmg" appcast 'https://static.adguard.com/mac/adguard-release-appcast.xml' name 'Adguard' homepage 'https://adguard.com/' pkg 'AdG...
35
75
0.65119
1ae9e651d448b8fe23a73de8e8df06c25c8b7434
1,895
require 'spec_helper' describe "Shipping Methods", :type => :feature do stub_authorization! let!(:zone) { create(:global_zone) } let!(:shipping_method) { create(:shipping_method, :zones => [zone]) } after do Capybara.ignore_hidden_elements = true end before do Capybara.ignore_hidden_elements = fa...
29.153846
100
0.681266
d57c07a7d58849f69a37b357c9ed5bfeabd5ffdc
4,287
RSpec.describe MetasploitDataModels::Search::Operation::Port::Range, type: :model do subject(:port_range_operation) { described_class.new( value: formatted_value ) } let(:formatted_value) { '1' } it { is_expected.to be_a MetasploitDataModels::Search::Operation::Range } context 'valida...
31.065217
153
0.560765
6a5d003e87f048190f15202478b7bcb2ec9f7161
2,936
# encoding: UTF-8 require 'spec_helper' describe Banzai::Filter::TableOfContentsFilter, lib: true do include FilterSpecHelper def header(level, text) "<h#{level}>#{text}</h#{level}>\n" end it 'does nothing when :no_header_anchors is truthy' do exp = act = header(1, 'Header') expect(filter(act, n...
29.959184
95
0.604564
abaf1bd60b452cb704432fa93ac947d537d86637
1,791
require "otp/utils" require "otp/base32" require "otp/uri" module OTP class Base include OTP::Utils DEFAULT_DIGITS = 6 DEFAULT_ALGORITHM = "SHA1" attr_accessor :secret, :algorithm, :digits attr_accessor :issuer, :accountname def initialize(secret=nil, algorithm=nil, digits=nil) self....
25.956522
80
0.6622
33d15cd89f786bcdefa46833ddfcdec92f60b98a
1,946
Chef::Log.info("mysql-memcached : source install dependencies") package 'cmake' do :upgrade end package 'bison' do :upgrade end package 'libncurses5-dev' do :upgrade end include_recipe "ri_mysql_memcached_plugin::client" Chef::Log.info("mysql-memcached : download source") remote_file "#{node...
23.731707
110
0.65519
e98b70a6189c1abb74681c65ac4c5adf16aaae61
128
require 'email_spec' RSpec.configure do |config| config.include(EmailSpec::Helpers) config.include(EmailSpec::Matchers) end
21.333333
37
0.789063
d5c509a75df6f89016cf0e15b43dedfc79b9af42
1,349
# frozen_string_literal: true # Copyright 2019 OpenTelemetry Authors # # SPDX-License-Identifier: Apache-2.0 require 'sinatra' require 'opentelemetry' require_relative 'extensions/tracer_extension' module OpenTelemetry module Adapters module Sinatra class Adapter class << self attr_rea...
22.483333
71
0.606375
b96896b129a188aa9d764c6b3c2e897b0d431a7a
476
# Write first_pos, a method which takes a string and , returns a hash # whose keys are all the words in the string, and values are the # earliest position they were seen in the string. # # There will be no punctuation in the strings. # # first_pos "The dog and the cat and the cow" # => {"The" => 0, "dog" => 1, "and" =>...
34
123
0.642857
e2d24bdfd9fc63d67c1a64111a6cb816726bebb0
2,532
# This file is auto-generated from the current state of the database. Instead # of editing this file, please use the migrations feature of Active Record to # incrementally modify your database, and then regenerate this schema definition. # # Note that this schema.rb definition is the authoritative source for your # dat...
35.661972
115
0.720379
6a7a5c5d424079549d248a42ac33e371697ed9ae
3,014
class ArxLibertatis < Formula desc "Cross-platform, open source port of Arx Fatalis" homepage "https://arx-libertatis.org/" license "GPL-3.0" revision 2 stable do url "https://arx-libertatis.org/files/arx-libertatis-1.1.2.tar.xz" sha256 "82adb440a9c86673e74b84abd480cae968e1296d625b6d40c69ca35b35ed4e4...
31.395833
115
0.697744
3831e65ecad3c14039e443a90c88eec875545581
1,856
require 'yaml' require 'active_support/concern' module Geokit # Contains a class method geocode_ip_address which can be used to enable automatic geocoding # for request IP addresses. The geocoded information is stored in a cookie and in the # session to minimize web service calls. The point of the helper is to...
37.877551
131
0.721444
33721dbe3c9bd8f8746ea209905967f4ade727c1
950
require "language/haskell" class Hledger < Formula include Language::Haskell::Cabal desc "Command-line accounting tool" homepage "http://hledger.org" url "https://hackage.haskell.org/package/hledger-1.10/hledger-1.10.tar.gz" sha256 "f64420f852502e84dfa9374ace1d00a06ecf1641ad9fd3b22d7c2c48c1d5c4d3" bottle...
30.645161
93
0.773684
61f89daf8d0344ea4a24e773847350451c864571
1,825
# frozen_string_literal: true # Copyright 2021 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicabl...
34.433962
90
0.731507
084f976e1b06e477e28add3df6ef88bb661e6fa5
1,392
require 'rubygems' require 'chef/log' require 'chef' require 'tempfile' module Zabbix class Report < Chef::Handler def report Chef::Log.info "Zabbix::Report handler started" prefix = "custom.chef-client.last_run" file = Tempfile.new('client-handler-zabbix-report') host_name = node[:zabb...
34.8
166
0.619253
ed1317d1760d0146c667d1ea484b0aee7b279a6f
992
{ matrix_id: '1211', name: 't3dl_e', group: 'Oberwolfach', description: 'Oberwolfach: micropyros thruster, E matrix', author: 'E. Rudnyi', editor: 'E. Rudnyi', date: '2004', kind: 'duplicate model reduction problem', problem_2D_or_3D: '1', num_rows: '20360', num_cols: '20360'...
29.176471
81
0.654234
5db3569b47521aee7b2ff4697d398661db839389
141
require 'rails_helper' RSpec.describe CourseClassesTrainer, :type => :model do pending "add some examples to (or delete) #{__FILE__}" end
23.5
56
0.751773
bf3166d1c01f8d5ef7407503bf16eeb89c1811f1
21,425
# frozen_string_literal: true require 'rails_helper' RSpec.describe Devise::Models::G5Authenticatable do subject { model } let(:model_class) { User } let(:model) { model_class.new(attributes) } let(:attributes) { {} } describe '#save!' do subject(:save) { model.save! } context 'when model is new'...
29.756944
80
0.585811
1df4352d66d3f890ceef7d701d69dbe3054a9a48
5,218
## # This module requires Metasploit: https://metasploit.com/download # Current source: https://github.com/rapid7/metasploit-framework ## require 'msf/core/post/file' require 'msf/core/post/windows/priv' require 'msf/core/post/windows/registry' #TODO: Do we need this? require 'msf/core/exploit/exe' class Meta...
36.48951
113
0.665006
1a9210a7ae6faf9ca7a8d6b4206af6d7f9f783b2
1,178
# rubocop:disable Metrics/LineLength # == Schema Information # # Table name: reports # # id :integer not null, primary key # explanation :text # naughty_type :string not null, indexed => [naughty_id] # reason :integer not null # status :integer default(0)...
31.837838
91
0.655348
e92d348550bc8e717a735d43d6922bfcedfc1299
1,640
require File.expand_path("../../../../spec_helper", __FILE__) describe Pod::Generator::Markdown do before do @file_accessor = fixture_file_accessor('banana-lib/BananaLib.podspec') @spec = @file_accessor.spec @generator = Pod::Generator::Markdown.new([@file_accessor]) @spec.stubs(:name).returns("POD_N...
41
114
0.733537
26c059ed3c29ab1730d3849e331a60d8514f4d97
9,213
require "erb" # Root ProjectRazor namespace module ProjectRazor module ModelTemplate # Root Model object # @abstract class Opensuse12 < ProjectRazor::ModelTemplate::Base include(ProjectRazor::Logging) # Assigned image attr_accessor :image_uuid # Metadata attr_accessor :host...
32.326316
121
0.511668
7a21354cfc45af7e44b2c9674d2091a8beb6d74c
1,610
module CodeRay module Scanners # = Debug Scanner # # Parses the output of the Encoders::Debug encoder. class Raydebug < Scanner register_for :raydebug file_extension 'raydebug' title 'CodeRay Token Dump' protected def scan_tokens encoder, options opened_tokens = [] u...
24.029851
72
0.527329
fff99a1d31b5a9c1f0b7065825a6cc35adef8993
5,833
$: << File.expand_path(File.dirname(__FILE__)) module QA ## # GitLab QA runtime classes, mostly singletons. # module Runtime autoload :Release, 'qa/runtime/release' autoload :User, 'qa/runtime/user' autoload :Namespace, 'qa/runtime/namespace' autoload :Scenario, 'qa/runtime/scenario' autolo...
28.315534
82
0.674439
212b2cb949d07bb5e5545a66543d2c5c613710a9
1,322
require 'mongo_doc' class Address include MongoDoc::Document attr_accessor :street attr_accessor :city attr_accessor :state attr_accessor :zip_code attr_accessor :phone_number end class Contact include MongoDoc::Document attr_accessor :name attr_accessor :interests embed_many :addresses scope...
28.12766
175
0.74357
334af36a2b7b24ba417d2b6411a1bdf3c50c86f1
1,197
module VanillaIse class EndpointGroup < Object def self.all(page_size: 100, page_limit: Float::INFINITY) Base.make_api_call( '/config/endpointgroup', :get, page_size: page_size, page_limit: page_limit, ).collect { |group| self.new(group) } end def self.search...
26.021739
86
0.583124
5d1fe22f2dff68597fa1bc08850479f2bb3ee2f9
12,076
module API class MergeRequests < Grape::API include PaginationParams DEPRECATION_MESSAGE = 'This endpoint is deprecated and will be removed in GitLab 9.0.'.freeze before { authenticate! } params do requires :id, type: String, desc: 'The ID of a project' end resource :projects do ...
42.521127
135
0.648973
792dd5fe0ba3f18284057c500c26c1267135b7b8
430
# frozen_string_literal: true module CacheWithSettings::Helpers module RenderingHelper def render(options = {}, locals = {}, &block) if options.kind_of?(Hash) && options[:cached] == true options[:cached] = -> object { CacheWithSettings.compose_key(object) } end if block_given? ...
23.888889
78
0.630233
7a4e46b37b3526def0906d2af4ce7a578cacfa96
6,656
# frozen_string_literal: true require 'language_pack/fetcher' # This class is responsible for installing and maintaining a # reference to bundler. It contains access to bundler internals # that are used to introspect a project such as detecting presence # of gems and their versions. # # Example: # # bundler = Langu...
30.53211
122
0.656851
f87788ba9ccb5f0c260747f9bf9de8f98b0ed2f4
40
module Johannes VERSION = "0.0.1" end
10
19
0.675
abea672c525e7a76af8e53130d1bff76ec21cca2
3,326
require 'pry' module Handlers class Dungeon include PoroPlus include Behavior::HandlesCommands def move if Place.current.has_exit?(movement_direction) response = "#{message.sender_nick} dazedly leads the party #{movement_direction}.\n\r" if message.sender.dazed? response = "#{mes...
32.930693
172
0.659651
03363ba5abb924518886ceb7243a96829efbf2fd
152
module ActivePresenter module VERSION MAJOR = 0 MINOR = 0 TINY = 3 STRING = [MAJOR, MINOR, TINY].join('.') end end
15.2
45
0.532895
e87e3244c907207ce5ad6a2461046a447b2f54eb
959
require "rails_helper" RSpec.describe EventsController, type: :routing do describe "routing" do it "routes to #index" do expect(get: "/events").to route_to("events#index") end it "routes to #new" do expect(get: "/events/new").to route_to("events#new") end it "routes to #show" do ...
24.589744
72
0.605839
089e94f672af453c5e989907fad7ec98b0e7c431
458
module ItemDecoratorCommon extend ActiveSupport::Concern included do def to_values model.class::DIFF_FIELDS.inject({}) do |hash, field| hash[field] = case field when :url h.link_to(send(:url).truncate(30), send(:url), target: "_blank") when :tombo_image h.annic...
21.809524
74
0.58952
38521d19bb029f434425ec28cda26a92b8ab5768
464
Refinery::Application.routes.draw do resources :pages scope(:path => 'refinery', :as => 'admin', :module => 'admin') do resources :pages do collection do post :update_positions end end resources :page_parts resource :pages do resources :dialogs, :controller => :pages_dia...
18.56
67
0.586207
f7db83c456515fb924a40ec12cb06d05b169f5bd
339
require_relative 'account' require_relative 'portfolio' portfolio = Portfolio.new portfolio.add_account Account.new('red', 2000) portfolio.add_account Account.new('blue', 1000) portfolio.add_account Account.new('green', 500) puts portfolio.any? { |account| account.balance > 2000 } puts portfolio.all? { |account| acco...
33.9
56
0.772861
1d3b4863491d174f040610aa111fc41a3b5bef02
802
require 'sinatra' require 'rubygems' require 'aws-record' require_relative "models/landpage_lead.rb" require_relative "controllers/landpage_lead_controller.rb" before do if (! request.body.read.empty? and request.body.size > 0) request.body.rewind @params = Sinatra::IndifferentHash.new @params.merge!(JS...
18.651163
59
0.607232
e93f16da641b5a29ecfe622245d68d1ee2787caa
3,027
require 'ddtrace/ext/profiling' require 'ddtrace/profiling/events/stack' require 'ddtrace/profiling/pprof/builder' require 'ddtrace/profiling/pprof/converter' module Datadog module Profiling module Pprof # Builds a profile from a StackSample class StackSample < Converter SAMPLE_TYPES = { ...
33.263736
100
0.625041
38825eaa71b1492442dfb722b204181330d408be
1,740
########################################################################## # Copyright 2015 ThoughtWorks, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/li...
39.545455
137
0.631609
1a067e23c2ac32437668a7361d1ed4c48c33813f
1,262
cask 'mps' do version '2017.3,173.1427' sha256 'f2db828314488712f27143c0688680b7b1829f72bc6d40a3a3eb9606b6e49aa2' url "https://download.jetbrains.com/mps/#{version.before_comma.major_minor}/MPS-#{version.before_comma}-macos-jdk-bundled.dmg" appcast 'https://data.services.jetbrains.com/products/releases?code=MP...
46.740741
248
0.706022
91fb10b5836b5dcb57d91f718a308db7885d381e
529
shared_context "configurator with stub builder and requester" do let(:configurator) { HttpStub::Examples::ConfiguratorWithComprehensiveStubs } let(:stub_builder) { configurator.stub_builder } let(:stub_requester) { HttpStub::StubRequester.new(server_uri, stub_builder) } let(:stub_match_rules) { stub...
35.266667
80
0.758034
2857f95b015b0bd8a53cbe001372c570e1d6fa58
2,458
=begin #Hydrogen Atom API #The Hydrogen Atom API OpenAPI spec version: 1.7.0 Contact: info@hydrogenplatform.com Generated by: https://github.com/swagger-api/swagger-codegen.git Swagger Codegen version: 2.4.14 =end require 'spec_helper' require 'json' require 'date' # Unit tests for NucleusApi::PageAllocation # Aut...
27.311111
102
0.715216
79663ce3a940979f69935faf7e2c004a797a10e8
2,819
# frozen_string_literal: true module RuboCop module Cop module Gemspec # Dependencies in the gemspec should be alphabetically sorted. # # @example # # bad # spec.add_dependency 'rubocop' # spec.add_dependency 'rspec' # # # good # spec.add_dependency...
29.989362
107
0.608726
915a7ed103a3d32a59a78ce5ea00c4e5eb00993d
99
module ParamsValidation EmailRegex = /\A[a-zA-Z0-9_.+\-]+@[a-zA-Z0-9\-]+\.[a-zA-Z0-9\-.]+\z/ end
24.75
70
0.565657
1a166dfa82e2fd1c929f4ae1875c8392e841e1bf
364
class CreateUserAddresses < ActiveRecord::Migration[6.1] def change create_table :user_addresses do |t| t.references :user, type: :bigint t.string :fullname t.string :address_line1 t.string :address_line2 t.string :city t.string :state t.string :zip_code t.string :c...
22.75
56
0.651099
180520b27e7facb1d9d91bd27bf316a9ff67aadb
564
# frozen_string_literal: true require 'spec_helper' describe Gitlab::Cluster::PumaWorkerKillerObserver do let(:counter) { Gitlab::Metrics::NullMetric.instance } before do allow(Gitlab::Metrics).to receive(:counter) .with(any_args) .and_return(counter) end describe '#callback' do subject ...
20.142857
56
0.66844
f86f5212f149b7ec04e99ef8e680e44e0d606731
597
class Documentaries attr_accessor :rating, :year_made, :title, :movie_url @@all = [] def initialize(rating, year_made, title, movie_url) @rating = rating @year_made = year_made @title = title @movie_url = movie_url @@all << self end def self.reset! @@all = [] end ...
21.321429
99
0.609715
5d2765532ffeaa099ccc4f0e8007ae91076cabac
5,761
require 'helper' describe Twitter::REST::Undocumented do before do @client = Twitter::REST::Client.new(consumer_key: 'CK', consumer_secret: 'CS', access_token: 'AT', access_token_secret: 'AS') end describe '#following_followers_of' do context 'with a screen_name passed' do before do stub_...
55.394231
229
0.685645
26e7e93533ef84b995c1a23e8696ac87b64cf1f8
3,562
class Profiles::TwoFactorAuthsController < Profiles::ApplicationController skip_before_action :check_2fa_requirement def show unless current_user.otp_secret current_user.otp_secret = User.generate_otp_secret(32) end unless current_user.otp_grace_period_started_at && two_factor_grace_period ...
31.245614
124
0.744526
1a267eeb566504d47bb94390fbce9ced29290736
506
# frozen_string_literal: true require "rspec" require "rack/test" require "rack/ecg" RSpec.configure do |config| config.expect_with(:rspec) do |expectations| expectations.include_chain_clauses_in_custom_matcher_descriptions = true end config.mock_with(:rspec) do |mocks| mocks.verify_partial_doubles = tr...
20.24
76
0.758893
ed9b2974fc11c9684af87c70a3836addce60f3c5
531
require 'csv' # file = File.open('db/urls', 'r') # file.each_line do |row| # puts row # endinserts = [] inserts= [] file = File.open('db/urls', 'r') file.each do |row| # row = (http://example.com/fb3b726804f824a9185c57530e), # inserts << "('#{row.chomp.tr(',();', '')}', '#{SecureRandom.hex(8)}', 0, '#{T...
35.4
112
0.608286
f74c86c68999688c1736c18f76f5729602911b4d
597
require 'test_helper' class ProtectedAreasHelperTest < ActionView::TestCase test '#map_bounds, given a ProtectedArea object, returns a hash containing its bounds' do pa = FactoryGirl.create(:protected_area) pa.expects(:bounds).twice.returns([[0,0], [1,1]]) assert_equal map_bounds(pa), {'from' => [0,...
29.85
84
0.664992