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
33202fdf8b6f7bb9f3a47831b4f67788b63faa1d
44,787
# encoding: utf-8 # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is # regenerated. module Azure::ApiManagement::Mgmt::V2018_06_01_preview # # ApiManagement Client # class ApiVersionSet include MsRestAzure # # Creates a...
53.895307
233
0.698573
012c8154cd75556904a43a1364203ca02a216d9d
498
# encoding: utf-8 module Adhearsion module Translator class Asterisk module AMIErrorConverter def self.convert(result = ->(e) { raise ChannelGoneError, e.message } ) yield rescue RubyAMI::Error => e case e.message when 'No such channel', /Channel (\S+) does not...
23.714286
109
0.564257
082e9edf74167d891299fce7d4369636b10eae04
75
class Tagging < ApplicationRecord belongs_to :post belongs_to :tag end
15
33
0.786667
1a2bf65dab984d0ce9fdccabbebef6c10894ad49
77
class Answer < ActiveRecord::Base has_many :comments, as: :commentable end
19.25
38
0.766234
87f9a1e3838bacf169569002a168561f9883e248
1,607
# typed: false # frozen_string_literal: true # This file was generated by GoReleaser. DO NOT EDIT. class Ksd < Formula desc "ksd` is a tool, whose aim is help you to visualize in text plain your kubernetes secrets, either `yaml` or `json` outputs." homepage "https://github.com/mfuentesg/ksd" version "1.0.7" o...
28.192982
131
0.700685
18e8ec0e7d17960495641b9369283c9b399a4f2f
4,802
# frozen_string_literal: true class MergeRequestPollWidgetEntity < Grape::Entity include RequestAwareEntity expose :auto_merge_strategy expose :available_auto_merge_strategies do |merge_request| AutoMergeService.new(merge_request.project, current_user).available_strategies(merge_request) # rubocop: disable ...
32.666667
147
0.790504
01f8e424a7b1d36fd8b55369884354c93473c06c
4,742
class TestFile < ActiveRecord::Base belongs_to :assignment # Run sanitize_filename before saving to the database before_save :sanitize_filename # Upon update, if replacing a file with a different name, delete the old file first before_update :delete_old_file # Run write_file after saving to the database ...
34.362319
121
0.685154
b9e5095acb91e8e55fafecdd5c62548135082a9e
378
cask 'marble' do version '1.5.0' sha256 '6d1bf3e02c34ef0df0d5d0311d580bfae1d5259e3db45036163a5330dc139c04' url "https://files.kde.org/marble/downloads/MacOSX/Marble-#{version}.dmg" name 'Marble' homepage 'https://marble.kde.org/' license :unknown # TODO: change license and remove this comment; ':unknown' i...
31.5
112
0.756614
bf7df0c6e5392c3f627cca98b8a84e7ed8bcd38d
135
require_relative '../lib/tty-reader' reader = TTY::Reader.new answer = reader.read_line('=> ', echo: false) puts "Answer: #{answer}"
19.285714
45
0.681481
5d4834cc5b9e4c07a22e15d9d62fc4f4ae04c4fc
1,895
class Cppcheck < Formula homepage "http://sourceforge.net/apps/mediawiki/cppcheck/index.php?title=Main_Page" url "https://github.com/danmar/cppcheck/archive/1.68.tar.gz" sha1 "f08ef07f750f92fafe4f960166072e9d1088d74e" head "https://github.com/danmar/cppcheck.git" bottle do sha1 "8191b30ed8620ed5de071bbe...
27.463768
87
0.640633
1c102fef9cafb1255a2dd347915ebf2ec57ae13e
36,754
module KAE KAEISHandleCGI = 'sdoc' AeBuildSyntaxBadData = 12 AeBuildSyntaxBadDesc = 11 AeBuildSyntaxBadEOF = 2 AeBuildSyntaxBadHex = 6 AeBuildSyntaxBadNegative = 4 AeBuildSyntaxBadToken = 1 AeBuildSyntaxCoercedList = 18 AeBuildSyntaxMissingQuote = 5 AeBuildSyntaxNoCloseBrace = 15 AeBuildSyntaxNoCloseBracket ...
24.667114
49
0.725744
f784a03fad98d480b2fd7227761664c19653b577
4,126
# Copyright 2015 Google 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/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing,...
28.853147
124
0.726612
389896b55f780018cfb2d4277dd92f53db33af64
1,172
# mock library for testing the IE controller require 'watir' class FakeFrame def length return 0 end end class FakeDoc attr_accessor :links, :all def initialize @links = "" @doc = self end def getElementsByTagName(tag) @doc.links end def frames return FakeFrame.new en...
12.336842
44
0.622014
61bed16b3f615300313012e87599e7c399c48e85
74,319
# frozen_string_literal: true require 'socket' require 'timeout' require 'thread' require 'io/wait' begin require 'securerandom' rescue LoadError end # Resolv is a thread-aware DNS resolver library written in Ruby. Resolv can # handle multiple DNS requests concurrently without blocking the entire Ruby # interpret...
26.022059
113
0.531829
edf24ff5111b6e57099fef57a9946ca87dd6b8c1
68
class WelcomeController < ApplicationController def index end end
13.6
47
0.838235
7aaf4403e1512dc04ce0b0093affa1cc379e1366
1,039
cask 'balenaetcher' do version '1.5.69' sha256 '0e6bb080caa2c4a0141f242699d9ed1f25b4752a41c5bad19f5e1bfa01f5ee44' # github.com/balena-io/etcher was verified as official when first introduced to the cask url "https://github.com/balena-io/etcher/releases/download/v#{version}/balenaEtcher-#{version}.dmg" appcas...
37.107143
101
0.619827
bb287882b6c8a8e8af7d7a8d73e4293853d30040
37,579
##########################GO-LICENSE-START################################ # Copyright 2016 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...
85.020362
386
0.749887
ed6918bbeec015cfe765d57079bcb53381fd395b
195
module Platform class FacebookMobile module Impersonators def a_anonymous_user @anonymous_user ||= Platform::FacebookMobile::AnonymousUser.new self end end end end
21.666667
76
0.712821
e8e7113923fbd62dad822942a45073d259e2fedc
363
# frozen_string_literal: true require_relative './rule_serializer' class DiscourseChatIntegration::ChannelSerializer < ApplicationSerializer attributes :id, :provider, :error_key, :error_info, :data, :rules def rules object.rules.order_by_precedence.map do |rule| DiscourseChatIntegration::RuleSerialize...
25.928571
73
0.774105
e20b6c3d20397ff2848d6912c583330f1ae644e9
1,223
# frozen_string_literal: true # Copyright 2020 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...
28.44186
74
0.663123
7a476ef2e229594f0cc2be6981f8ba6c5da468f1
2,175
require 'psych' bot_data = { :presubs => [ ["dont", "don't"], ["youre", "you're"], ["love", "like"], ["apologize", "are sorry"], ["dislike", "hate"], ["despise", "hate"], ["yeah", "yes"], ["mom", "family"] ], :responses => { :default => [ "I don't understand.", "Wh...
21.323529
56
0.453333
2806fbc984e33c48fc793be77fbfe2cd6f61bafc
1,176
# @react-native-seoul/kakao-login.podspec require "json" package = JSON.parse(File.read(File.join(__dir__, "package.json"))) Pod::Spec.new do |s| s.name = "kakao-login" s.version = package["version"] s.summary = package["description"] s.description = <<-DESC @react-native...
32.666667
124
0.59949
d52a73f43ecdec015892cc1cdc0fc0c772aad33d
147
class AddVixedAssetToAssetTag < ActiveRecord::Migration[5.2] def change add_reference :asset_tags, :fixed_asset, foreign_key: true end end
24.5
62
0.782313
6103e1fe49f05cd55483c57a62cf0773cb1b9bc1
361
# encoding: utf-8 # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is # regenerated. module Azure::Storage::Mgmt::V2019_04_01 module Models # # Defines values for Services # module Services B = "b" Q = "q" ...
19
70
0.623269
ff387a7573ea0b7eacc929973cc9858fb6830c03
194
class DropNotNullConstraintsFromUploads < ActiveRecord::Migration[7.0] def change change_column_null(:uploads, :rating, true) change_column_null(:uploads, :tag_string, true) end end
27.714286
70
0.773196
62f88ca55f1eff763bd4bb4e94f28ff0c6dd742d
3,666
=begin #Upbit Open API ### REST API for Upbit Exchange - Base URL: [https://api.upbit.com] - Official Upbit API Documents: [https://docs.upbit.com] - Official Support email: [open-api@upbit.com] OpenAPI spec version: 1.0.0 Contact: ujhin942@gmail.com Generated by: https://github.com/swagger-api/swagger-codegen.git S...
29.095238
172
0.705128
3379e16d106f52bd83d8019cfa0edce66f014a30
97
# frozen_string_literal: true module Hanami module Serializer VERSION = "0.1.1" end end
12.125
29
0.71134
338f1f5f371b47704c2e18fddaff00edc8f606e1
1,863
Pod::Spec.new do |s| s.name = "WorldMagneticModel" s.version = "1.0.5" s.summary = "An iOS native wrapper around the World Magnetic Model" s.description = <<-DESC The World Magnetic Model is a joint product of the United States’ National Geospatial-Intelligence Agency (NGA) and the United Ki...
64.241379
559
0.723564
330f54346124359729c86da4b38ff5392ef08ac5
4,353
# frozen_string_literal: true require 'securerandom' require 'base64' module Kafka module Sasl class Scram MECHANISMS = { "sha256" => "SCRAM-SHA-256", "sha512" => "SCRAM-SHA-512", }.freeze def initialize(username:, password:, mechanism: 'sha256', logger:) @semaphore = ...
24.049724
108
0.569492
d583584fb356de981ef3c6275c186b7dc6b888e6
1,660
require "spec_helper" module CC::Analyzer describe Issue do let(:output) do { "categories" => ["Style"], "check_name" => "Rubocop/Style/Documentation", "description" => "Missing top-level class documentation comment.", "location"=> { "lines" => { "begin...
26.349206
74
0.598795
b93b22e3de348c0a224366bfae8a6579287f8323
13,784
class Dvc < Formula include Language::Python::Virtualenv desc "Git for data science projects" homepage "https://dvc.org" url "https://github.com/iterative/dvc/archive/1.8.4.tar.gz" sha256 "71e9d1acc3ad5ce6fc94a7b3d3e4390e1754f8adfe484daa9a251b03e874353f" license "Apache-2.0" revision 1 livecheck do ...
46.567568
149
0.805572
ac0959104cecd1d7fa9b54f17477502a5fd4a0a4
2,049
# frozen_string_literal: true # # Copyright:: 2019, Chef Software Inc. # Author:: Tim Smith (<tsmith@chef.io>) # # 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/licens...
40.176471
365
0.669595
21db5fc39e9388f931b08cec742a8b9e79e25bd1
413
class DeleteUserWorker include ApplicationWorker def perform(current_user_id, delete_user_id, options = {}) delete_user = User.find(delete_user_id) current_user = User.find(current_user_id) ::Users::DestroyService.new(current_user).execute(delete_user, options.symbolize_keys) rescue Gitlab::Access:...
31.769231
90
0.757869
39625553920c2665d4b84a32ffe5e2cec9f33902
206
class CreateUsers < ActiveRecord::Migration[5.0] def change create_table :users do |t| t.string :name t.string :email t.string :password_digest t.timestamps end end end
17.166667
48
0.645631
0837f632a9e56b7a6fa45407b1ff5a5bdf747c7e
478
class Manager::SpendMoney < ApplicationService expects do required(:manager).filled required(:amount).filled optional(:band) end delegate :manager, :amount, :band, to: :context before do manager = Manager.ensure(manager) band = Band.ensure(band) context.fail!(message: 'Amount must be p...
22.761905
77
0.694561
62f05e0b0d4378801e5039f8d8eb7ea222f4eb35
6,082
require 'rails_helper' describe FixityCheck do let(:good_asset) { build(:asset_image_with_correct_sha512) } let(:good_asset_2) { build(:asset_mp3_with_correct_sha512) } # :asset_with_faked_file, by factory default,comes with a random fake sha512. let(:corrupt_asset) { build(:asset_with_faked_file) } de...
40.278146
243
0.701414
08e5a5d0a87d10ba87fa772fd8132858b22ede5e
316
require 'rails_helper' module Cdx RSpec.describe Taxonomy, type: :model do subject(:taxonomy) { create(:cdx_taxonomy) } describe '#save!' do it { expect(build(:cdx_taxonomy).save!).to eq(true) } end describe '#root' do it { expect(taxonomy.root).not_to eq(nil) } end end end
17.555556
59
0.636076
abb8502c6406b24afa8eab78aabbef4cf1ac1818
2,310
require 'rails_helper' RSpec.describe 'Course: Skills' do let(:instance) { Instance.default } with_tenant(:instance) do let(:course) { create(:course) } before { login_as(user, scope: :user) } context 'As a Course Manager' do let(:user) { create(:course_manager, course: course).user } sc...
36.09375
96
0.70303
7a88d357020eb9528b02e6bf1f0f5ebbd565dc29
1,756
require 'application_system_test_case' class ShowDepartmentModuleTest < ApplicationSystemTestCase context 'module' do setup do @user = create(:user) login_as(@user, as: :user) @dep_module = create(:department_module) create(:department_module_user, :responsible, user: @user, department_m...
31.927273
98
0.678815
79e892d68a5f76e30403b52a90f2f1a295c60045
1,183
require 'versionomy' def play_store_version_code_to_upload_to() puts "fetching play_store_version_code_to_upload_to" versionCode = ['internal', 'alpha', 'beta', 'production'].map { |branch| begin versionCode = google_play_track_version_codes(track: branch).max versionCode ||= 1 ...
35.848485
81
0.676247
7a54cbae58d8e7c59ab30d039c8b3d5155b6d16d
12,570
class PEdump module SigParser DATA_ROOT = File.dirname(File.dirname(File.dirname(__FILE__))) TEXT_SIGS_FILES = [ File.join(DATA_ROOT, "data", "userdb.txt"), File.join(DATA_ROOT, "data", "signatures.txt"), File.join(DATA_ROOT, "data", "fs.txt") ] class OrBlock < Array; end ...
32.48062
148
0.454733
6a39e6df7f0f79d3773b62c2561f307354e762b2
2,430
#! /usr/bin/env ruby require 'spec_helper' require 'oregano/file_serving/terminus_selector' describe Oregano::FileServing::TerminusSelector do before do @object = Object.new @object.extend(Oregano::FileServing::TerminusSelector) @request = stub 'request', :key => "mymod/myfile", :options => {:node => "...
35.217391
124
0.666255
5df0ae82fb6729fc1d5eff2862a56be013cacd27
3,780
Rails.application.configure do # Settings specified here will take precedence over those in config/application.rb. # Code is not reloaded between requests. config.cache_classes = true # Eager load code on boot. This eager loads most of Rails and # your application in memory, allowing both threaded web serve...
41.086957
102
0.756614
18d17802f22b6c60f23ce40a12dac01c7f3545c2
144
# Be sure to restart your server when you modify this file. Mytopten::Application.config.session_store :cookie_store, key: '_mytopten_session'
36
82
0.805556
f7eca0eac310aa7276c722e8d40d426e96f999c0
267
class FindProjectWithPermissions include ProcParty def call(name, user) project = Project.find_by!(name: name) if !AccessControl.new(project).readable?(user) raise ActionController::RoutingError, "Project not found" end project end end
19.071429
63
0.719101
5d189eb689229628d750a1009d3171b2c94da4d8
3,623
# frozen_string_literal: true module UserApi module V1 class Phones < Grape::API desc 'Phone related routes' resource :phones do desc 'Add new phone', security: [{ "BearerToken": [] }], failure: [ { code: 400, message: 'Required params are empty' }, ...
39.813187
95
0.54568
2120c259bbbbc26ff7af2661738cc13eaf42b555
145
require 'rails_helper' RSpec.describe "connects/approve.html.slim", type: :view do pending "add some examples to (or delete) #{__FILE__}" end
24.166667
59
0.744828
5de39c5605a164ca47b129560ebe1c1be8f57aca
379
maintainer "Opscode, Inc." maintainer_email "cookbooks@opscode.com" license "Apache 2.0" description "Installs hadoop and sets up basic cluster per Cloudera's quick start docs" long_description IO.read(File.join(File.dirname(__FILE__), 'README.rdoc')) version "0.8" depends "...
29.153846
93
0.672823
6a151bae42f0d557b83bbbe61b2d181f1b9e148a
325
module ApplicationHelper # Returns the full title on a per-page basis. def full_title(page_title = '') base_title = "Ruby on Rails Tutorial Sample App" if page_title.empty? base_title else page_title + " | " + base_title end end...
27.083333
56
0.547692
79a9157b228c060ef5ee11025ee3320f2669799c
1,244
require "language/node" class NetlifyCli < Formula desc "Netlify command-line tool" homepage "https://www.netlify.com/docs/cli" url "https://registry.npmjs.org/netlify-cli/-/netlify-cli-3.39.0.tgz" sha256 "47d34627b59490b680ececf5bd81474276229608bf5f7bafa55010584fb45c4d" license "MIT" head "https://github....
35.542857
122
0.758039
ffc2e5a72f7d2d6b98e7888e807824dbbf6fbc49
1,589
# Copyright (c) Facebook, Inc. and its affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. flipperkit_version = '0.56.0' Pod::Spec.new do |spec| spec.name = 'Flipper' spec.version = flipperkit_version spec.license = { :type => ...
52.966667
267
0.679043
79ea3568174cffd0e8945d453a56c14bf50da92f
1,651
Pod::Spec.new do |s| s.name = "Instabug" s.version = "1.5" s.summary = "Bug reporting for mobile apps. Learn more at http://instabug.com" s.homepage = "http://instabug.com" s.license = { :type => 'Commercial', :text => <<-LICENSE Copyright (C) 2013 Instab...
45.861111
209
0.652938
b9dee6faf73481369eab2612ca683a454b04cddc
1,147
class UcspiTcp < Formula desc "Tools for building TCP client-server applications" homepage "https://cr.yp.to/ucspi-tcp.html" url "https://cr.yp.to/ucspi-tcp/ucspi-tcp-0.88.tar.gz" sha256 "4a0615cab74886f5b4f7e8fd32933a07b955536a3476d74ea087a3ea66a23e9c" bottle do cellar :any_skip_relocation sha256 "4...
32.771429
92
0.760244
18f8394751e1e7996bf393ec4c2a6362c8d90af1
633
module UPS module RequestXML class ShipmentNode < Base attr_reader :description, :documents_only def initialize(nodes, options = {}) @nodes = nodes super(options) end def to_xml request = Nokogiri::XML::Builder.new do |xml| xml.Shipment { ...
19.78125
56
0.538705
e873bf5fcc65786469334eb18150a8c15d3b38df
1,069
# == Schema Information # # Table name: flow_nodes # # flow_id(id from flows) :integer not null # node_id(id from path at position) :integer not null # context_id(from flows) :integer not null # position(0-indexed) :integer not null # year(fro...
28.891892
63
0.601497
265c2bfff71fffbb126320ec0a24a7d8b2559940
2,597
module RuneRb::Game::Entity::Helpers::Command # Initializes the Instance#commands hash and populates it with recognizable commands. def load_commands @commands = { Animation: RuneRb::Game::Entity::Commands::Animation, Ban: RuneRb::Game::Entity::Commands::Ban, Graphic: RuneRb::Game::Entity::Co...
49
98
0.748556
5dcce3587452fc572fe9bf043a7be4e06ceff704
276
require File.expand_path('../../../../../spec_helper', __FILE__) describe "OpenSSL::X509::ExtensionFactory#crl" do it "needs to be reviewed for spec completeness" end describe "OpenSSL::X509::ExtensionFactory#crl=" do it "needs to be reviewed for spec completeness" end
27.6
64
0.735507
e8855b09e58bfafe8f3799743d82cd593688336c
1,164
#: * `postinstall` <formula>: #: Rerun the post-install steps for <formula>. require "sandbox" module Homebrew module_function def postinstall ARGV.resolved_formulae.each { |f| run_post_install(f) if f.post_install_defined? } end def run_post_install(formula) args = %W[ nice #{RUBY_PATH} ...
23.755102
86
0.657216
621e339cbbdd3381f3149a2c10a8d6164ee5ba05
35
describe Twterm::Friendship do end
11.666667
30
0.828571
87e5622fae4811390f721fb6b3974613d3e4fcbf
6,274
module CourseExports class PrepareStudentsExportService include CourseExportable def execute tables = [ { title: 'Targets', rows: target_rows }, { title: 'Students', rows: student_rows }, { title: 'Submissions', rows: submission_rows } ] finalize(tables) end ...
26.472574
86
0.553714
7aa17cb5716b76408f7a2b5a68f9ee469512ce09
601
# frozen_string_literal: true require_relative '../../../lib/mc_protocol_e/frame_1e/access_route' include McProtocolE::Frame1e describe AccessRoute do let(:object) { described_class.new(pc_num: pc_num) } describe "#own_station" do subject { McProtocolE::Frame1e::AccessRoute.own_station } it { exp...
23.115385
85
0.712146
618d04d108e6e37dcc9adeaafb407ecf71792561
1,095
require 'facilethings/rest/user' require 'facilethings/rest/partner' require 'facilethings/rest/coupon' require 'facilethings/rest/admin' require 'facilethings/rest/campaign' require 'facilethings/rest/subscription' require 'facilethings/rest/mail' require 'facilethings/rest/channel' require 'facilethings/rest/ocal_co...
28.076923
46
0.756164
1c8aa3ec6e07aa77bbd2c5c9c8edb6d2a1e3df8e
810
class MicropostsController < ApplicationController before_action :logged_in_user, only: [:create, :destroy] before_action :correct_user, only: :destroy def create @micropost = current_user.microposts.build(micropost_params) if @micropost.save flash[:success] = 'Micropost created!' redirect_...
24.545455
67
0.690123
e23d2bd375b8d8bc0d54c93b3491f306f5851ea4
19
set :source, 'src'
9.5
18
0.631579
f8877b6d1aa505e2a1b3d148dab71e89ecf76692
14,131
require 'spec_helper' describe ProjectsHelper do include ProjectForksHelper describe "#project_status_css_class" do it "returns appropriate class" do expect(project_status_css_class("started")).to eq("active") expect(project_status_css_class("failed")).to eq("danger") expect(project_status_c...
32.189066
201
0.686646
ff461e9fee3b12fa34c212365abababab45d87af
5,120
# # Be sure to run `pod spec lint Elemeiyou.podspec' to ensure this is a # valid spec and to remove all comments including this before submitting the spec. # # To learn more about Podspec attributes see http://docs.cocoapods.org/specification.html # To see working Podspecs in the CocoaPods repo see https://github.c...
37.101449
96
0.599805
262e8fbb38e285daa0ff8ad06c62173435f19c07
1,032
Pod::Spec.new do |s| s.name = 'IssueTracker' s.version = '1.0.16' s.summary = 'IssueTracker lets a user select an test.' s.description = "A facebook like report a problem including media and markup images" s.homepage = 'https://github.com/maulik-brt/IssueTracker...
38.222222
107
0.613372
914e52d35344674f1218e3f6fdb810d52abe4b53
1,696
# # Be sure to run `pod lib lint SwiftyBase.podspec' to ensure this is a # valid spec before submitting. # # Any lines starting with a # are optional, but their use is encouraged # To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html # Pod::Spec.new do |s| s.name = 'SwiftyBas...
38.545455
108
0.646226
030751e525872e8880f7775172a212a1ed9df87c
3,715
# Copyright (c) 2009-2012 VMware, Inc. require 'spec_helper' require 'bosh_agent/platform/rhel/network' describe Bosh::Agent::Platform::Rhel::Network do let(:network_wrapper) { subject } let(:complete_settings) do settings_json = %q[{"vm":{"name":"vm-273a202e-eedf-4475-a4a1-66c6d2628742","id":"vm-51290"},"dis...
43.705882
658
0.6786
ffb32c2c47aa64fb1b88510aec712b0b0691ba34
1,874
# frozen_string_literal: true require 'spec_helper' RSpec.describe GitlabSchema.types['DastScannerProfile'] do let_it_be(:dast_scanner_profile) { create(:dast_scanner_profile) } let_it_be(:project) { dast_scanner_profile.project } let_it_be(:user) { create(:user) } let_it_be(:fields) { %i[id globalId profileN...
26.027778
159
0.635539
387a9a9f169c9cffb5ea1703c6c456d9e760731f
2,228
class Gflags < Formula desc "Library for processing command-line flags" homepage "https://gflags.github.io/gflags/" url "https://github.com/gflags/gflags/archive/v2.2.1.tar.gz" sha256 "ae27cdbcd6a2f935baa78e4f21f675649271634c092b1be01469440495609d0e" bottle do cellar :any # sha256 "a00d8dd8f4674384e72...
34.8125
93
0.683573
d588722dce4df54645dc5cfd9f906b2a4bae2daa
779
class CharacterizeJob < IdBasedJob include BackgroundTasks::Status def queue_name :characterize end def run raise "No file found for id #{id}" if generic_file.nil? with_status_update('characterize') do status_for_type('preservation') if generic_file.preservation? generic_file.charact...
23.606061
82
0.735558
6acb318aa0dda081c810eaf12f34556bb7467f3f
113
class Comment < ApplicationRecord belongs_to :user belongs_to :blog validates :content, presence: true end
18.833333
36
0.778761
ff6979b05eb4606b9ffa8b4c01175096f91a5504
1,534
class PasswordResetsController < ApplicationController before_action :get_user, only: [:edit, :update] before_action :valid_user, only: [:edit, :update] before_action :check_expiration, only: [:edit, :update] # (1) への対応 def new end def create @user = User.find_by(email: params[:password_reset][:e...
22.895522
73
0.667536
e830c237b20fe9c81d2443c0ea2a3313abcd3615
508
# Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is # regenerated. module Azure::AlertsManagement::Mgmt::V2018_05_05_preview module Models # # Defines values for SmartGroupsSortByFields # module SmartGroupsSortByFields ...
26.736842
70
0.720472
b96a7eb1fcbc4857c872ff805d405128a4754ea4
970
require "govspeak" require "plek" class SafeHtmlValidator < ActiveModel::EachValidator ALLOWED_IMAGE_HOSTS = [ # URLs for the local environment URI.parse(Plek.new.website_root).host, # eg www.preview.alphagov.co.uk URI.parse(Plek.new.asset_root).host, # eg assets-origin.preview.alphagov.co.uk # Ha...
30.3125
159
0.737113
1100d1b1134de169079d40528d30cf3fdeee0b1e
6,517
## # This module requires Metasploit: http://metasploit.com/download # Current source: https://github.com/rapid7/metasploit-framework ## require 'msf/core' class MetasploitModule < Msf::Exploit::Remote Rank = NormalRanking include Msf::Exploit::Remote::HttpClient ADDR_VIRTUALALLOC = 0x0041A140 ADDR_CREAT...
37.454023
95
0.540893
793bbbdd6d7331d733ad7677b626cc71e88a4ad8
5,453
# # Author:: Thom May (<thom@chef.io>) # Copyright:: 2017-2018 Chef Software, Inc. # # Copyright:: Copyright (c) 2016 Chef Software, Inc. # License:: Apache License, Version 2.0 # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You m...
30.80791
127
0.677609
61d12d1978f8e0127ad3a7dcf2736f1f54a1e5be
497
cask 'font-droid-serif' do version :latest sha256 :no_check # github.com/google/fonts was verified as official when first introduced to the cask url 'https://github.com/google/fonts/trunk/apache/droidserif', using: :svn, revision: '50', trust_cert: true name 'Droid Serif' homepage ...
27.611111
86
0.706237
33c595818ad937e515d86b0af09ca2ac6b8ffd75
1,289
class Rav1e < Formula desc "The fastest and safest AV1 encoder" homepage "https://github.com/xiph/rav1e" url "https://github.com/xiph/rav1e/archive/v0.3.3.tar.gz" sha256 "a091f3387055e472b6e028aa013cf0f37fb5acce9f4db2605d929bbffb448d01" bottle do cellar :any sha256 "b8c0b0614f67553f771f709f0849479a9a...
33.921053
93
0.657874
01098509424fd0396c8c39d8fac2e5f81cca37a6
719
require "test_helper" class DocumentTestCase < Minitest::Test def setup @class = Class.new(LivingStyleGuide::Document) end def render(input, options = {}) @doc = @class.new(options[:file]) do input.unindent(ignore_blank: true) end @doc.type = options[:type] || :lsg @doc.template = opti...
26.62963
68
0.691238
5dab1c2063d6a0d7f44679df63397e2a7ec186b2
413
class InstructionPolicy < ApplicationPolicy attr_reader :instruction def initialize(user, instruction) super(user, instruction) @instruction = record end def update? user.admin? || instruction.try(:user) == user end def destroy? user.admin? || instruction.try(:...
17.208333
52
0.617433
ac40831e4f969b9367fe295fea29ea93c0557a6d
1,904
class StudentsController < ApplicationController before_action :find_student, only: [:show, :udpate, :destroy] def index @students = Student.all student_instructor respond_to do |f| f.html f.json { render json: @student.to_json(include: :lesson)} en...
22.4
70
0.544118
219df3bfcee0ddab1a499bbedb29a589cfd3fd50
2,170
require 'selenium/webdriver' require 'webdrivers' module SeleniumBrowser def self.local(headless=true, browser=:chrome) browser = browser.to_sym options = {} if browser == :chrome options[:options] = Selenium::WebDriver::Chrome::Options.new options[:options].add_argument('headless') if headle...
32.38806
110
0.68341
39ba2e0d8c4bfa49d6dc4b1532fd68ab020b1ae9
1,368
# ORDER OF EVENTS # Calling "cap deploy" runs: # deploy:update which runs: # deploy:update_code # deploy:symlink # deploy:restart # # Calling "cap deploy:migrations" inserts the task "deploy:migrate" before deploy:symlink require 'capistrano/gitflow_version' server "test-app01.transformativeworks.org",...
38
110
0.763158
91dced620926178122465d8ff47bebfe879ed0d6
162
class Support::HomeController < Support::BaseController before_action { authorize :support } def show; end def schools; end def feature_flags; end end
16.2
55
0.746914
2102e6b1881b1796d6d861f343e711b61e9cedee
1,513
# frozen_string_literal: true if defined?(Picky) module Slack module Web module Api module Mixins module Users Member = Struct.new :id, :name, :first_name, :last_name, :real_name, :email # # This method searches for users. # # @o...
32.191489
87
0.486451
1a40b7c4956b814e3af73bff26fa0e5e6d3efc27
4,476
class ReconNg < Formula include Language::Python::Virtualenv desc "Web Reconnaissance Framework" homepage "https://github.com/lanmaster53/recon-ng" url "https://github.com/lanmaster53/recon-ng/archive/v5.0.1.tar.gz" sha256 "a090caa5d2a380cf34a54e3759cdad2da5dc17a0eaaf88260721f6a60a4064ab" bottle do ce...
42.628571
141
0.80496
793c7f1ed93842c69305c2cbf252a937d8398efe
2,647
require 'jinrai/active_record/cursor_methods' module Jinrai::ActiveRecord #:nodoc: module FinderMethods extend ActiveSupport::Concern included do include Jinrai::ConfigurationMethods def to_cursor cursor_format = self.class.default_cursor_format attributes = cursor_format.map do...
31.511905
146
0.628258
6ab9915b86de30e9ca31c2da3cc29361425e2f22
1,132
# typed: true require 'datadog/tracing/contrib/kafka/ext' require 'datadog/tracing/contrib/kafka/event' module Datadog module Tracing module Contrib module Kafka module Events module ProduceOperation # Defines instrumentation for send_messages.producer.kafka event ...
28.3
124
0.595406
01e4c22cef00ae2e587ddfd92ec0335881767843
774
class CreateSupportEntityCadastreMirrors < ActiveRecord::Migration[5.2] def change create_table 'sihab.entity_cadastre_mirrors' do |t| t.integer :cadastre_id t.string :name t.string :cnpj t.string :fantasy_name t.string :telephone t.string :telephone_optional t.strin...
25.8
71
0.631783
9119d141083f66c4f7bd184dcd989ffe2074098d
596
require 'json' package = JSON.parse(File.read(File.join(__dir__, 'package.json'))) Pod::Spec.new do |s| s.name = package['name'] s.version = package['version'] s.summary = package['description'] s.license = package['license'] s.authors = package['author'] s.homepage = pack...
28.380952
115
0.602349
f8794b03d5f6509cb07a1f51d3dbec036e526ade
45
module IntercomEvent VERSION = "0.1.0" end
11.25
20
0.711111
216aca06b48b383d54633c3b0e88f062b9bfd8a7
1,266
class Mpdas < Formula desc "C++ client to submit tracks to audioscrobbler" homepage "https://www.50hz.ws/mpdas/" url "https://www.50hz.ws/mpdas/mpdas-0.4.5.tar.gz" sha256 "c9103d7b897e76cd11a669e1c062d74cb73574efc7ba87de3b04304464e8a9ca" license "BSD-3-Clause" head "https://github.com/hrkfdn/mpdas.git" b...
34.216216
93
0.759874
03475d34a9f17d5fa7862e13966707a4892455f5
1,283
# frozen_string_literal: true module CernerSplunk # Mixin Helper methods for the Splunk Service resource module ServiceHelpers include ResourceHelpers # Returns a Pathname of the init.d script for Splunk # @return [Pathname] Splunk init.d script location def init_script_path Pathname.new('/e...
36.657143
111
0.698363
bf68362097f586372fa5fff599fc4e3ddfe2c3bf
1,397
# # Cookbook Name:: rabbitmq # Recipe:: default # # Copyright 2011, VMware # # node[:rabbitmq][:supported_versions].each do |version, install_version| #TODO, need more refine to actually support mutiple versions Chef::Log.info("Building rabbitmq version: #{version} - #{install_version}") case node['platform'] ...
29.723404
141
0.701503
1dffc9fc34819006c8fb4274418e4879365052f5
455
module Day2 class Main def initialize(input) @passwords = input.split("\n") .map { |p| /(\d+)-(\d+) (\w): (\w+)/.match(p).to_a } .map { |p| [p[1].to_i, p[2].to_i, p[3], p[4]] } end def part1 @passwords.count { |p| (p[0]..p[1]).include?(p[3].coun...
25.277778
82
0.417582
bf21c40c43ef0800d4a9d6960f723829ecd505be
9,890
# encoding: utf-8 require File.dirname(__FILE__) + "/stream_progress_methods.rb" module Parsers def parse_status(input) base_dir = path file_statuses = {} parse_status_hash(input).each do |file, status| file_statuses[expand_path_preserving_trailing_slash(file, base_dir)] = status end sort...
32.532895
140
0.502123
91f9ca10dc14b95239589bf79b0af28d58d7e1b7
3,713
# A collection of Rake tasks to facilitate importing data from yout models into Elasticsearch. # # Add this e.g. into the `lib/tasks/elasticsearch.rake` file in your Rails application: # # require 'elasticsearch/rails/tasks/import' # # To import the records from your `Article` model, run: # # $ bundle exec rake...
33.151786
94
0.62133
38327fb837c7914bab589928734a04d77aa754a1
129
json.extract! thread_object, :id, :id, :value, :created_at, :updated_at json.url thread_object_url(thread_object, format: :json)
43
71
0.775194