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 |
|---|---|---|---|---|---|
abd1fdc9ff215aa1d7929f80ceb4e4457b6ea421 | 176 | class ChangeDataTypeForXboxpsn < ActiveRecord::Migration[6.1]
def change
change_column :songs, :xbox_link, :string
change_column :songs, :psn_link, :string
end
end
| 25.142857 | 61 | 0.75 |
1da22e1844d20dc715db4232a1afb5df9b891b5d | 320 | case ENV['RAILS_VERSION']
when '2.1' then
gem 'activerecord', '~>2.1.0'
when '3.0' then
gem 'activerecord', '~>3.0.0'
else
gem 'activerecord', '~>2.3.0'
end
require 'active_record'
require 'active_record/version'
puts "Running specs using Rails #{ActiveRecord::VERSION::STRING}"
require 'acceptance/models'
| 18.823529 | 65 | 0.69375 |
0820a436c60cc26c679b4022876b277353666bc0 | 35 | module HPI
VERSION = '0.1.0'
end
| 8.75 | 19 | 0.628571 |
ab04c9ca0eac7181e0b466476bdb152739246c46 | 608 | require_relative 'boot'
# Pick the frameworks you want:
# require "active_record/railtie"
require "action_controller/railtie"
require "action_view/railtie"
# require "action_mailer/railtie"
# require "rails/test_unit/railtie"
require "sprockets/railtie"
Bundler.require(*Rails.groups)
require "shiftcommerce-rails"
mo... | 28.952381 | 82 | 0.782895 |
0146bfe938f87988b80cce605ab95d62619e8bda | 188 | require File.expand_path('../shared/constants', __FILE__)
require File.expand_path('../shared/update', __FILE__)
describe "Digest::SHA384#<<" do
it_behaves_like(:sha384_update, :<<)
end
| 26.857143 | 57 | 0.744681 |
017a4b5b90770974661331fd70ccdfe61a8346ae | 1,226 | Pod::Spec.new do |s|
s.name = "GEOSwift"
s.version = "0.5.1"
s.summary = "The Swift Geographic Engine."
s.description = <<-DESC
Easily handle a geographical object model (points, linestrings, polygons etc.) and related topographical operations (intersections, overlapping etc.).
A type-safe,... | 35.028571 | 150 | 0.664763 |
7a3300ec1d20bd70597acacea054e7da9e547cd1 | 1,797 | class Dosfstools < Formula
desc "Tools to create, check and label file systems of the FAT family"
homepage "https://github.com/dosfstools"
url "https://github.com/dosfstools/dosfstools/releases/download/v4.2/dosfstools-4.2.tar.gz"
sha256 "64926eebf90092dca21b14259a5301b7b98e7b1943e8a201c7d726084809b527"
licen... | 41.790698 | 122 | 0.729549 |
33d59e33c1af8ce9b1561706d348034e210101f0 | 156 | class AddOmniauthToUsers < ActiveRecord::Migration[5.2]
def change
add_column :users, :name, :string
add_column :users, :uid, :text
end
end
| 19.5 | 55 | 0.692308 |
1af560b0c19949b08fbd2f38f430de190d04a6b0 | 1,435 |
class SoundProcessingUnit
def initialize
@instructions = []
@program_counter = 0
@register_file = Hash.new(0)
@current_sound = 0
@running = true
end
def get_value arg
v = nil
if /([a-z]+)/.match? arg
v = @register_file[arg]
else
v = arg.to_i
end
return v
e... | 17.9375 | 91 | 0.576307 |
ac3cd2418e211766b27798688eb27f756f735789 | 5,170 | # This file was generated by the `rails generate rspec:install` command. Conventionally, all
# specs live under a `spec` directory, which RSpec adds to the `$LOAD_PATH`.
# The generated `.rspec` file contains `--require spec_helper` which will cause
# this file to always be loaded, without a need to explicitly require ... | 49.238095 | 96 | 0.717988 |
ffb492e3761a4962440bef97d53881373ebfce1d | 1,864 | require 'rails_helper'
describe Friendship do
describe '#create_friendship' do
it 'this will create a new friendship' do
user1 = User.create!(email: 'test1fg@emewail.com', name: 'tesdfqwt1', gravatar_url: 'http://www.gravfatar.com/avatar/%22',
password: '1231e23')
user2 = U... | 45.463415 | 130 | 0.633047 |
aba693cceece533f3483f72681de75e3fe52398a | 181 | # Copyright (c) 2013 Universidade Federal Fluminense (UFF).
# This file is part of SAPOS. Please, consult the license terms in the LICENSE file.
module EnrollmentStatusesHelper
end | 36.2 | 84 | 0.79558 |
1dfc28ef04896b2cc0e348d2120cab4fc448f902 | 5,035 | require File.dirname(__FILE__) + '/../../../spec_helper'
describe Radiant::AdminUI::NavTab do
before :each do
@tab = Radiant::AdminUI::NavTab.new(:content, "Content")
end
it "should have a name" do
@tab.name.should == :content
end
it "should have a proper name" do
@tab.proper_name.should == "Co... | 30.149701 | 98 | 0.649851 |
acb12bae3af68e27437a870e3b25d8f239b9ca8c | 95 | module Biovision
module Comment
class ApplicationJob < ActiveJob::Base
end
end
end
| 13.571429 | 42 | 0.726316 |
b953f4d55aa3339ba1f74e85ca323cc3aef7ddc6 | 1,669 | #
# Author:: Davide Cavalca <dcavalca@fb.com>
# Copyright:: Copyright (c) 2016 Facebook
# 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 may obtain a copy of the License at
#
# http://... | 35.510638 | 91 | 0.723787 |
91e1eccf9dd2721871216d7b806ad0c689db1777 | 7,953 | require 'temporal/activity/task_processor'
require 'temporal/middleware/chain'
require 'temporal/configuration'
describe Temporal::Activity::TaskProcessor do
subject { described_class.new(task, namespace, lookup, middleware_chain, config) }
let(:namespace) { 'test-namespace' }
let(:lookup) { instance_double('Te... | 30.945525 | 104 | 0.636364 |
3885b1857a470425f64c5f15d1e436e1254c4c00 | 1,270 | require_relative '../automated_init'
context "Data Command" do
context "Insert Email Rejected" do
registration_id = Controls::Registration.id
user_id = Controls::User.id
email_address = Controls::Registration.email_address
time = Controls::Time::Effective.example
insert_email_rejected = DataComm... | 23.518519 | 64 | 0.647244 |
bb546977e5b8e423737599934f8ab6628aea75b7 | 260 | class Appointment < ApplicationRecord
belongs_to :day
validates :time, :client, :barber, presence: true
validates :client, :barber, length: {maximum: 10}
validates_uniqueness_of :barber, :case_sensitive => false, :scope => [:time, :day_id]
end | 37.142857 | 89 | 0.711538 |
8747fb1c46b15aac79d88943c2e0a4f80d94421d | 594 | require 'similar_users'
RSpec.describe SimilarUsers do
before :all do
user = User.find_user(35_914)
# user item_ids = [1253, 1532, 1298, 1314, 1366]
similar_users = [
User.find_user(143_554), # item_ids = [1253, 1301]
User.find_user(158_241) # item_ids = [1298]
]
@recommender = Sim... | 25.826087 | 73 | 0.683502 |
2800f70831c86421bd3776d51e63d1d6c485e9f1 | 661 | # frozen_string_literal: true
require_relative "../connectors/aoc_connector"
require_relative "../helpers/password_checker"
# Day 2 solver
class PasswordListParser
def solve
puts "part1: #{count_valid_passwords(strategy: "inclusion")}"
puts "part2: #{count_valid_passwords(strategy: "presence")}"
end
pr... | 28.73913 | 97 | 0.617247 |
e2a36ce2845100b7d2cfbc8e24ed49198d5aa592 | 202 | $LOAD_PATH.unshift File.expand_path('../../lib', __FILE__)
require 'organ_cooker'
require 'minitest/autorun'
require 'minitest/reporters'
Minitest::Reporters.use! Minitest::Reporters::SpecReporter.new
| 28.857143 | 62 | 0.787129 |
e802a3529ea0c058f6303fa8893aa758622efdc4 | 1,489 | class Squashfuse < Formula
desc "FUSE filesystem to mount squashfs archives"
homepage "https://github.com/vasi/squashfuse"
url "https://github.com/vasi/squashfuse/releases/download/0.1.103/squashfuse-0.1.103.tar.gz"
sha256 "42d4dfd17ed186745117cfd427023eb81effff3832bab09067823492b6b982e7"
license "BSD-2-Claus... | 36.317073 | 94 | 0.738079 |
1850725a9e83342ada2ca84144f2d4583414fb8f | 810 |
require File.dirname(__FILE__) + "/gruff_test_case"
class TestMiniBar < GruffTestCase
def test_simple_bar
setup_single_dataset
g = setup_basic_graph(Gruff::Mini::Bar, 200)
write_test_file g, 'mini_bar.png'
end
# def test_simple_bar_wide_dataset
# setup_wide_dataset
# g = setup_basic_grap... | 24.545455 | 69 | 0.628395 |
87ac3437ec33ded10a9842ae745c7a938b4a5316 | 661 | class Complement
DNA_PAIRINGS = {
'G' => 'C',
'C' => 'G',
'A' => 'U',
'T' => 'A'
}.freeze
RNA_PAIRINGS = {
'G' => 'C',
'C' => 'G',
'A' => 'T',
'U' => 'A'
}.freeze
def self.of_dna(strand)
raise ArgumentError if strand.include?('U')
strand.chars.map { |nucleobase| dna_pa... | 20.030303 | 70 | 0.608169 |
0386bea72ad4f981b20fd5f9157d64956b5785c6 | 29,082 | # frozen_string_literal: true
require "octokit"
require "spec_helper"
require "dependabot/dependency"
require "dependabot/source"
require "dependabot/metadata_finders/base/commits_finder"
RSpec.describe Dependabot::MetadataFinders::Base::CommitsFinder do
subject(:builder) do
described_class.new(
dependenc... | 32.530201 | 79 | 0.512207 |
ac73836df316c7519b61030f87dbcee92674197a | 382 | module Starling
module Resources
# A resource representing a Contact returned from the Contacts API
class ContactResource < BaseResource
# @return [String] the Starling internal ID of the contact
def id
parsed_data['id']
end
# @return [String] the name of the contact
def... | 22.470588 | 70 | 0.646597 |
79ee9d158aaaed9c8f22a603c53cea6aedc4ad06 | 1,425 | require "administrate/base_dashboard"
class PilotRegionDashboard < BaseDashboard
# ATTRIBUTE_TYPES
# a hash that describes the type of each of the model's fields.
#
# Each different type represents an Administrate::Field object,
# which determines how the attribute is displayed
# on pages throughout the da... | 27.941176 | 76 | 0.719298 |
08b2adc7a7593307a6071a353a76d9ff82acf731 | 923 | class ReviewsController < ApplicationController
before_action :set_recipe
def new
@review = Review.new
end
def create
if user_signed_in?
@review = Review.new(review_params)
@review.recipe = Recipe.find_by(id: params[:recipe_id])
@review.user = current_user
if @review.save
... | 23.666667 | 89 | 0.661972 |
395d882e25adc3e8ed41401fb62326c1fd8b7f4a | 15,629 | require 'enumerator'
require 'merb-core/controller/mime'
module Merb
# The ResponderMixin adds methods that help you manage what
# formats your controllers have available, determine what format(s)
# the client requested and is capable of handling, and perform
# content negotiation to pick the proper content for... | 33.610753 | 111 | 0.627935 |
ed07c88e081a995a559473116e93e3bd0db078c9 | 4,958 | require 'spaceship'
require_relative 'module'
module Produce
class DeveloperCenter
SERVICE_ON = "on"
SERVICE_OFF = "off"
SERVICE_COMPLETE = "complete"
SERVICE_UNLESS_OPEN = "unlessopen"
SERVICE_UNTIL_FIRST_LAUNCH = "untilfirstauth"
SERVICE_LEGACY = "legacy"
SERVICE_CLOUDKIT = "cloudkit"
... | 37.847328 | 154 | 0.669221 |
3823026771b76e9fe24fb3f1c5accefa17ac97f4 | 1,281 | require 'spec_helper'
shared_examples_for 'an searchable essence' do
let(:essence_type) { essence_class.model_name.name.demodulize }
let(:content) { create(:alchemy_content) }
before do
allow(content).to receive(:essence_class).and_return(essence_class)
end
context 'with searchable set to true' do... | 24.634615 | 71 | 0.661983 |
6241124af1cd7c7d5fb2753a6a1b5e9523b96300 | 2,594 | require_relative '../spec_helper'
describe "cnb" do
it "locally runs default_ruby app" do
Cutlass::App.new("default_ruby").transaction do |app|
app.pack_build
expect(app.stdout).to include("Installing rake")
app.run_multi("ruby -v") do |out|
expect(out.stdout).to match(LanguagePack::R... | 27.020833 | 105 | 0.595991 |
01eb17f58a8db86d185141bb40ed2a17a78ea292 | 2,848 | module Spec
module Extensions
module Main
# Creates and returns a class that includes the ExampleGroupMethods
# module. Which ExampleGroup type is created depends on the directory of the file
# calling this method. For example, Spec::Rails will use different
# classes for specs living in <... | 32.735632 | 115 | 0.596559 |
e9a9bd941955f171968ed11ec6e3aaa9c148ed3e | 290 | # 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 end
module Azure::Resources end
module Azure::Resources::Mgmt end
module Azure::Resources::Mgmt::V2019_05_10 end
| 29 | 70 | 0.782759 |
1895f83a7ef2fd69eabbda051b5fa7e4799b4e5a | 21 | depends "ruby_build"
| 10.5 | 20 | 0.809524 |
bb50921c7b0b7cca6e6d152fc14c4c4b20205cf6 | 3,253 | class Wangle < Formula
desc "Modular, composable client/server abstractions framework"
homepage "https://github.com/facebook/wangle"
url "https://github.com/facebook/wangle/releases/download/v2021.09.27.00/wangle-v2021.09.27.00.tar.gz"
sha256 "c23840578f73a0316ef58cd0e95ed001dbf5e893740d72c157f579ac2342558a"
... | 31.582524 | 122 | 0.659699 |
39a8553c3d056414e31c2eadc92a2cfc72db1c98 | 208 | require 'spec_helper'
describe TopSupplement do
it 'has a version number' do
expect(TopSupplement::VERSION).not_to be nil
end
it 'does something useful' do
expect(false).to eq(true)
end
end
| 17.333333 | 48 | 0.721154 |
4a2d57b75cd6b2ff891add171ac79bf1f5cddd93 | 1,602 | FactoryGirl.define do
factory :user do
password { "railsisomakase" }
password_confirmation { "railsisomakase" }
email { Faker::Internet.email }
factory :v1_user do
md5_password "e53522351c4cfce1b2c3ecb3f4dbf2cd" # letmeinplease
... | 26.262295 | 91 | 0.609863 |
79b1db4dbef4bbfdbd98ac095a84362fef33586e | 474 | # frozen_string_literal: true
require 'spec_helper'
require 'vk/api/groups/methods/get_catalog'
RSpec.describe Vk::API::Groups::Methods::GetCatalog do
subject(:model) { described_class }
it { is_expected.to be < Dry::Struct }
it { is_expected.to be < Vk::Schema::Method }
describe 'attributes' do
subject(:... | 27.882353 | 58 | 0.725738 |
33692c43b0649d80c4787ed73953d409d4ca0c49 | 2,670 | ##
# This module requires Metasploit: http://metasploit.com/download
# Current source: https://github.com/rapid7/metasploit-framework
##
require 'msf/core'
class Metasploit3 < Msf::Exploit::Remote
Rank = ExcellentRanking
include Msf::Exploit::Remote::SunRPC
def initialize(info = {})
super(upd... | 31.411765 | 81 | 0.553933 |
acdf6265e7a1e43f558fa96c119acffdecba057a | 793 | # encoding: UTF-8
require_dependency 'carto/superadmin/metrics_controller_helper'
module Carto
module Superadmin
class UsersController < ::Superadmin::SuperadminController
include MetricsControllerHelper
respond_to :json
ssl_required :usage
before_filter :load_user
rescue_from A... | 22.027778 | 74 | 0.67087 |
1a07e43145d4eec53f5f7842827fe6a85bb3afd2 | 79 | $LOAD_PATH.unshift File.expand_path('../../lib', __FILE__)
require 'smart_uri'
| 26.333333 | 58 | 0.734177 |
5db4872d29cbf658c14d26bc6b865e6df39c402f | 459 | # == Schema Information
#
# Table name: roles
#
# id :integer not null, primary key
# name :string(255)
# resource_id :integer
# resource_type :string(255)
# created_at :datetime not null
# updated_at :datetime not null
#
class Role < ActiveRecord::Base
has_... | 24.157895 | 61 | 0.64488 |
8761a23c28679282d651f96c6345f20e46aaefc9 | 233 | require "rspec-puppet"
fixture_path = File.expand_path(File.join(__FILE__, "..", "fixtures"))
RSpec.configure do |c|
c.manifest_dir = File.join(fixture_path, "manifests")
c.module_path = File.join(fixture_path, "modules")
end
| 25.888889 | 70 | 0.729614 |
01bd8fc6b207659a7c762ce2fca65a91174c190e | 318 | # frozen_string_literal: true
require_relative '../downloads/client'
module Crunchbase
# Utilities
module Utilities
# Daily csv export
module Downloads
def download_bulk(dir, extract: false)
Crunchbase::Downloads::Client.new.download_bulk(dir, extract: extract)
end
end
end
end
| 19.875 | 78 | 0.710692 |
0156bc1e17376942d740406d3cf9bf15f156aaf9 | 1,145 | ActiveAdmin.register_page "Dashboard" do
menu priority: 0, label: proc{ I18n.t("active_admin.dashboard") }
content :title => proc{ I18n.t("active_admin.dashboard") } do
# Here is an example of a simple dashboard with columns and panels.
columns do
column do
panel I18n.t("active_admin.statist... | 26.022727 | 86 | 0.665502 |
ac6a40e2f5459a69f51cf57b9dac247182c0e4fe | 2,084 | class Fn < Formula
desc "Command-line tool for the fn project"
homepage "https://fnproject.github.io"
url "https://github.com/fnproject/cli/archive/0.4.49.tar.gz"
sha256 "1378ca0e114666a5d7dfa726557d0196982269cbf91a38a6c667e0d7f4a2a32e"
bottle do
cellar :any_skip_relocation
sha256 "79525a473b2241f59f... | 34.733333 | 98 | 0.65499 |
084a4ddcf5d51be93f9f17f22524c79df5cda382 | 5,833 | # frozen_string_literal: true
require "liquid"
require "asciidoctor"
require "asciidoctor/reader"
require "lutaml"
require "metanorma/plugin/lutaml/utils"
require "metanorma/plugin/lutaml/utils"
require "metanorma/plugin/lutaml/express_remarks_decorator"
module Metanorma
module Plugin
module Lutaml
# Clas... | 34.720238 | 110 | 0.541917 |
21bfc21213e3450bf23aabe71f56eceb14c88b0c | 19,773 | # frozen_string_literal: true
module Engine
module Game
module G1862
module Map
TILES = {
'5' => 10,
'6' => 10,
'14' => 11,
'15' => 10,
'16' => 2,
'16_1a' =>
{
'count' => 2,
'color' => 'green',
... | 33.231933 | 117 | 0.396753 |
4a9cb78e1f2297058b7199e84f9133cba58b8294 | 756 | # 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... | 28 | 74 | 0.744709 |
e9a8551bcae307ebb055257ea87ee73d42d7913b | 176 | class CreateTipos < ActiveRecord::Migration[5.0]
def change
create_table :tipos do |t|
t.string :nome
t.text :descricao
t.timestamps
end
end
end
| 16 | 48 | 0.642045 |
ed1af7cde0654aac5298c7b652346790a14cf876 | 2,636 | # frozen_string_literal: true
# Copyright The OpenTelemetry Authors
#
# SPDX-License-Identifier: Apache-2.0
require 'google-cloud-env'
module OpenTelemetry
module Resource
module Detectors
# GoogleCloudPlatform contains detect class method for determining gcp environment resource attributes
module ... | 47.071429 | 142 | 0.67868 |
87085cf479f1287ba159f5d633706358ad73530c | 634 | module ActionView
module Helpers
module AssetTagHelper
def image_tag_with_retina(source, options={})
retina = options.delete(:retina)
if retina
retina_source = source.to_s
retina_source = retina_source.split('.')
filename = retina_source.slice!(-2)
... | 25.36 | 78 | 0.613565 |
7ab588f5a6d69f44b79150a7139d690499fe5e93 | 701 | require 'test_helper'
class MicropostTest < ActiveSupport::TestCase
def setup
@user = users(:john)
@micropost = @user.microposts.build(content: "Lorem ipsum")
end
test "should be valid" do
assert @micropost.valid?
end
test "user id should be present" do
@micropost.user_id = nil
assert_... | 21.90625 | 63 | 0.693295 |
e874263f99b85dffbecfeac6824828a1ec9334bb | 1,675 | # frozen_string_literal: true
require "digest"
require_relative "../../jekyll-postcss/socket"
module Jekyll
module Converters
class PostCss < Converter
safe true
priority :normal
def initialize(config = {})
super
@socket = config.fetch("socket") { ::PostCss::Socket.new }
... | 22.039474 | 81 | 0.575522 |
26bf0ec918b29f0627786ce66bd3ec67e7580644 | 158 | def sign_in_as(user)
visit new_user_session_path
fill_in 'Email', with: user.email
fill_in 'Password', with: user.password
click_button 'Sign in'
end
| 22.571429 | 41 | 0.759494 |
28b6620d91a3416978dbd56c6c34bbfaafa4b4f9 | 1,346 | require 'spec_helper'
describe 'duo_unix::repo' do
on_supported_os.each do |os, os_facts|
context "on #{os}" do
let(:facts) { os_facts }
it { is_expected.to compile.with_all_deps }
if os =~ %r{/ubuntu.*/}
if os != 'ubuntu-18.04-x86_64'
it {
is_expected.to contai... | 29.26087 | 133 | 0.580981 |
d5f27a63ef9d52207598d9c913adc0f0f5a41e75 | 8,640 | module ActiveMerchant #:nodoc:
module Billing #:nodoc:
class VisanetPeruGateway < Gateway
include Empty
self.display_name = 'VisaNet Peru Gateway'
self.homepage_url = 'http://www.visanet.com.pe'
self.test_url = 'https://devapi.vnforapps.com/api.tokenization/api/v2/merchant'
self.liv... | 34.979757 | 150 | 0.636574 |
e979a39f833d9e034cd9ef34ce0ace39445286fe | 387 | # frozen_string_literal: true
require 'forwardable'
require_relative 'utils'
module OpenapiFirst
# Represents an OpenAPI Response Object
class ResponseObject
extend Forwardable
def_delegators :@parsed,
:content
def_delegators :@raw,
:[]
def initialize(parsed... | 17.590909 | 41 | 0.638243 |
21bb707df71ba758ecfd257d2603ad82d162020b | 75 | class EvidenceType < ApplicationRecord
validates_presence_of :title
end
| 15 | 38 | 0.84 |
082ba48aa6c5129b5f14895924a0bfb7d99a99fc | 47 | module StellarSpectrum
VERSION = "1.3.1"
end
| 11.75 | 22 | 0.723404 |
0322b82cc78922ca3f577762a7b10300cf954c6a | 15,946 | require File.expand_path(File.join(File.dirname(__FILE__),'..','..','test_helper'))
require 'action_controller/test_case'
class NewRelic::Agent::AgentTestControllerTest < ActionController::TestCase
require 'action_controller/base'
require 'new_relic/agent/agent_test_controller'
self.controller_class = NewRelic::... | 38.424096 | 189 | 0.717108 |
39558ae43caa9021300a3d6206f81504c52a3595 | 10,339 | # 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 applicable law or agreed to in writing, ... | 50.931034 | 186 | 0.625206 |
bf104bf8a401f19b26b2d81f11e816fb3976b446 | 9,058 | require 'yaml'
require 'erb'
require 'attack_api'
class AtomicRedTeam
ATTACK_API = Attack.new
ATOMICS_DIRECTORY = "#{File.dirname(File.dirname(__FILE__))}/atomics"
# TODO- should these all be relative URLs?
ROOT_GITHUB_URL = "https://github.com/redcanaryco/atomic-red-team"
#
# Returns a list of paths ... | 50.044199 | 182 | 0.684257 |
87593108ffd57935a0bd4a976dd5a53c2c0ee234 | 2,777 | require File.expand_path('../../../spec_helper', __FILE__)
require File.expand_path('../fixtures/classes', __FILE__)
describe "Method#to_proc" do
before :each do
ScratchPad.record []
@m = MethodSpecs::Methods.new
@meth = @m.method(:foo)
end
it "returns a Proc object corresponding to the method" do
... | 29.542553 | 121 | 0.676269 |
7a7bab3820592d20d4583b2184eacf458ec8f47f | 376 | # 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::V2019_05_05_preview
module Models
#
# Defines values for State
#
module State
New = "New"
Acknowledged = "... | 22.117647 | 70 | 0.68617 |
79b0a7ff432c352e9c5488e8e6ed99fabf10febd | 176 | class DropUnusedColumns < ActiveRecord::Migration[5.0]
def change
remove_column :links, :impressions_count, :integer
remove_column :links, :score, :integer
end
end
| 25.142857 | 54 | 0.75 |
6a90e74db1ba1c031605cb40ab5363609a21a016 | 8,251 | require 'json'
require_relative '../../../models/synchronization/member'
require_relative '../../../models/synchronization/collection'
require_relative '../../../../services/datasources/lib/datasources'
require_relative '../../../../services/platform-limits/platform_limits'
require_dependency 'carto/url_validator'
cla... | 33.404858 | 100 | 0.668767 |
ed0004d64f436d7d0bea5b5605d3a8d8053584ff | 62 | module Transbank
module Sdk
VERSION = "1.4.0"
end
end
| 10.333333 | 21 | 0.645161 |
1159dab3715a6645a99965d38877d9a3df1d91fc | 9,055 | # frozen_string_literal: true
class Fisk
module Instructions
# Instruction VMOVAPS: Move Aligned Packed Single-Precision Floating-Point Values
VMOVAPS = Instruction.new("VMOVAPS", [
# vmovaps: m128{k}{z}, xmm
Form.new([
OPERAND_TYPES[73],
OPERAND_TYPES[24],
].freeze, [
... | 28.296875 | 85 | 0.480066 |
e2274a9080659491fa3fddde00f423ca391b510f | 13,642 | # Use this hook to configure devise mailer, warden hooks and so forth.
# Many of these configuration options can be set straight in your model.
Devise.setup do |config|
# The secret key used by Devise. Devise uses this key to generate
# random tokens. Changing this key will render invalid all existing
# confirmat... | 49.071942 | 154 | 0.751356 |
1a1f2faaabbdc4a623bc0a5f1db3ca90b07a3283 | 1,484 | require File.expand_path '../../test_helper', __dir__
# Test class for Detach Data Disk from VM Request
class TestDetachDataDiskFromVM < Minitest::Test
def setup
@service = Fog::Compute::AzureRM.new(credentials)
@compute_client = @service.instance_variable_get(:@compute_mgmt_client)
@virtual_machines = @... | 44.969697 | 133 | 0.764151 |
d56830318a328f6d3c4c97e206ed307136001b79 | 37,035 | # 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... | 51.797203 | 137 | 0.56992 |
f7f351a95c6a3871abd68cfcebba9839bf9cec8c | 14,885 | require 'fluent/input'
require 'fluent/time'
require 'fluent/plugin/kafka_plugin_util'
class Fluent::KafkaGroupInput < Fluent::Input
Fluent::Plugin.register_input('kafka_group', self)
config_param :brokers, :string, :default => 'localhost:9092',
:desc => "List of broker-host:port, separate with com... | 38.264781 | 197 | 0.645348 |
bf43be3f328dbbf76c126ae8303d27582d25af31 | 1,119 | require File.expand_path('../boot', __FILE__)
require 'rails/all'
# Require the gems listed in Gemfile, including any gems
# you've limited to :test, :development, or :production.
Bundler.require(*Rails.groups)
module Topicsources
class Application < Rails::Application
# Settings in config/environments/* take ... | 41.444444 | 99 | 0.734584 |
ab367dc14bdd9affac7a0fc77b9ba077e566ac23 | 30,647 | # 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... | 43.718973 | 312 | 0.73322 |
4a198ee6b1bba1f8a8791f0ecaf1c8e13533e0e3 | 1,632 | # Features of this script:
# * No need to modify, configurable via calling script
# * Runs as correct user even on system boot
# * Allows control over cruise environment and start command
# * Logs environment and startup errors to help debug failures when cruise is started via system boot
# * Returns correct return cod... | 27.661017 | 124 | 0.685662 |
ff1c2391b58c0aa107e1c2d53d1a8c594939143d | 289 |
def power_number(base, power)
aux = 0
result = 1
until aux == power
aux += 1
result *= base
end
# Caso não tenha um "return" no bloco executável da função
# Ela retorna o último resultado calculado em sua última linha
# Nesse caso, é o próprio result
result
end
| 18.0625 | 64 | 0.67128 |
016ed26594d9985fe1dd3a0d801306a8b1b2b1ce | 1,093 | {
matrix_id: '581',
name: 'mark3jac020sc',
group: 'Hollinger',
description: 'Jacobian from MULTIMOD Mark3, oldstack 020 (scaled)',
author: 'P. Hollinger',
editor: 'T. Davis',
date: '2001',
kind: 'economic problem',
problem_2D_or_3D: '0',
num_rows: '9129',
num_cols: '9129',
... | 31.228571 | 163 | 0.671546 |
bba26c758d2a57bbf31da4c71ec445d7b7f95893 | 3,159 | class PlaceInfectionCommand
prepend SimpleCommand
def initialize(game:, staticid:, quantity:, color: nil, outbreakids: [])
@game = game
@staticid = staticid
@quantity = quantity
@color = color || city.color
@outbreakids = outbreakids
end
def call
set_before_quantity
infection.updat... | 23.931818 | 79 | 0.721431 |
e8fadf1ae00e8d8f652e2f37a56250ca5bcc86c8 | 607 | class SoftDelete < ActiveRecord::Migration
def change
add_column :organizations, :deleted_at, :datetime
add_index :organizations, :deleted_at
add_column :assignments, :deleted_at, :datetime
add_index :assignments, :deleted_at
add_column :assignment_invitations, :deleted_at, :datetime
add_i... | 31.947368 | 68 | 0.771005 |
f7136f97bb3d90b09ec8184519b605ee137cc178 | 1,514 | require "tmpdir"
require "pathname"
module Resume
module CLI
# Module containing functions concerning interacting with the
# local file system.
#
# @author Paul Fioravanti
module FileSystem
# Represents the ?dl=1 parameter on a Dropbox link.
DOWNLOAD_PARAMETER_REGEX = /\?.+\z/
p... | 30.897959 | 75 | 0.635403 |
edc09532add4fb4fff91d6b9cf56abe365839ab1 | 373 | Rails.application.routes.draw do
root 'static_pages#home'
get '/help', to: 'static_pages#help'
get '/about', to: 'static_pages#about'
get '/contact', to: 'static_pages#contact'
get '/signup', to: 'users#new'
get '/login', to: 'sessions#new'
post '/login', to: 'sessions#create'
delete '/lo... | 31.083333 | 45 | 0.648794 |
1a3f039090e8fa22c2389b797c6b182206855982 | 2,266 | if ENV['SIMPLECOV']
require 'simplecov'
SimpleCov.start
end
if ENV['COVERALLS']
require 'coveralls'
Coveralls.wear_merged!
end
require 'factory_girl'
require 'composer'
# Requires supporting ruby files with custom matchers and macros, etc,
# in spec/support/ and its subdirectories.
Dir[File.join(File.dirname... | 37.147541 | 81 | 0.723742 |
01b4ae9c0d5e706dc7a0d71709c538113364076d | 2,448 | class AmplMp < Formula
desc "The AMPL modeling language solver library"
homepage "http://www.ampl.com"
url "https://github.com/ampl/mp/archive/3.1.0.tar.gz"
sha256 "587c1a88f4c8f57bef95b58a8586956145417c8039f59b1758365ccc5a309ae9"
bottle do
cellar :any
sha256 "4bf7fc7253661a1fb16fe1b07f6b4eeeb4dcecd6... | 34.478873 | 136 | 0.669935 |
bbef1bdc8dc14e751b907735b0361aede7bbd2b8 | 6,862 | require "logstash/devutils/rspec/spec_helper"
require "logstash/outputs/elasticsearch"
require "logstash/outputs/elasticsearch/http_client"
require "logstash/outputs/elasticsearch/http_client_builder"
describe LogStash::Outputs::ElasticSearch::HttpClientBuilder do
describe "auth setup with url encodable passwords" d... | 35.371134 | 115 | 0.598805 |
e9982edf1aeb345d170bb724d17a4bdbbecbb6e1 | 2,844 | require "test_helper"
class OtpTest < MiniTest::Unit::TestCase
def setup
@user = User.new
@user.email = 'roberto@heapsource.com'
@user.run_callbacks :create
@visitor = Visitor.new
@visitor.email = 'roberto@heapsource.com'
@visitor.run_callbacks :create
end
def test_authenticate_with_otp... | 36.935065 | 139 | 0.722925 |
ac34956fe853906b50b561d40d496d16a3475a8e | 1,042 | # coding: utf-8
lib = File.expand_path('../lib', __FILE__)
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
require 'nymphia/version'
Gem::Specification.new do |spec|
spec.name = 'nymphia'
spec.version = Nymphia::VERSION
spec.authors = ['mozamimy (Moza USANE)']
spec.email = ... | 35.931034 | 74 | 0.645873 |
e8f8383d0e2dfc1b319e055434b8e07a093a9617 | 1,327 | $:.unshift 'lib'
require 'benchmark/ips'
require 'mustache'
template = """
{{#products}}
<div class='product_brick'>
<div class='container'>
<div class='element'>
<img src='images/{{image}}' class='product_miniature' />
</div>
<div class='element description'>
<a href={{url}} c... | 17.460526 | 64 | 0.605878 |
7aa2f0fc0fca17d3e64acc6cc75887aa77b12acf | 361 | cask "snagit" do
version "2021.0.2"
sha256 :no_check # required as upstream package is updated in-place
url "https://download.techsmith.com/snagitmac/releases/Snagit.dmg"
name "Snagit"
desc "Screen capture software"
homepage "https://www.techsmith.com/screen-capture.html"
depends_on macos: ">= :mojave"
... | 25.785714 | 69 | 0.725762 |
e9d21e04a2cfadf644e1bfc3bba576fde74a822d | 4,015 | require 'winrm'
require 'winrm/wsmv/write_stdin'
require 'net/winrm/ctrl_c'
require 'net/winrm/receive_response_reader'
module Net
module MsfWinRM
# WinRM shell to use stdin, rather than sending isolated commands
class StdinShell < WinRM::Shells::Cmd
# We create our own empty finalizers because the bui... | 35.530973 | 111 | 0.645579 |
f716f6c1c5d1566ee0fb5c7346a9a01a5f8238f6 | 639 | require_relative '../../lib/inspect_parameter_source'
describe InspectParameterSource do
let(:source) { double }
let(:headers) { Hash.new }
subject { InspectParameterSource.new(source) }
describe "#language" do
before { source.stub_chain(:request, :headers).and_return(headers) }
context "when languag... | 24.576923 | 72 | 0.661972 |
bb1f87a9576b6f429a294ef339c3aed1b1ee7418 | 3,117 | # Copyright::
# Copyright (C) 2011 MISHIMA, Hiroyuki <missy at be.to / hmishima at nagasaki-u.ac.jp>
# License:: The Ruby licence (Ryby's / GPLv2 dual)
#
# In the hg18 database, this table is actually separated
# into "chr1_*", "chr2_*", etc. This class dynamically
# define *::Chr1_*, *::Chr2_*, etc. The
# Rmsk.f... | 38.012195 | 120 | 0.548284 |
872ba1ab43d56a3e1ae3bba49251dcee3924e0a2 | 1,557 | # frozen_string_literal: true
require 'spec_helper'
RSpec.describe Atlassian::JiraConnect::Serializers::PullRequestEntity do
let_it_be(:project) { create_default(:project, :repository) }
let_it_be(:merge_requests) { create_list(:merge_request, 2, :unique_branches) }
let_it_be(:notes) { create_list(:note, 2, sys... | 35.386364 | 101 | 0.722543 |
4a563e84dde4d8e84a15a6f86f0e159a4dc06f09 | 629 | # frozen_string_literal: true
require_relative '../../command'
require_relative '../../crawler/genrelist'
module Yomou
module Commands
class Genrerank
class Download < Yomou::Command
def initialize(period, genre, options)
@period = period
@genre = genre
@options = opt... | 23.296296 | 51 | 0.586645 |
334411f8476106ae3cc1c65e2ee6ca2b4d74bf6d | 156 | require 'test_helper'
class ExtensionTest < ActiveSupport::TestCase
# Replace this with your real tests.
test "the truth" do
assert true
end
end
| 17.333333 | 45 | 0.737179 |
62becaf9148776be3b6b672a72a094e293f9f693 | 572 | Pod::Spec.new do |s|
s.name = "SSApplication"
s.version = "0.0.1"
s.summary = "A UIApplication subclass to start your app off right."
s.homepage = "https://github.com/splinesoft/SSApplication"
s.license = { :type => 'MIT', :file => 'LICENSE' }
s.author = { "Jonathan Hersh" ... | 40.857143 | 104 | 0.589161 |
610cfdb13dd19634700d636f9b866ddc80f42671 | 32,487 | # Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
module Azure::Monitor::Mgmt::V2018_03_01
#
# Monitor Management Client
#
class ActionGroups
include MsRestAzure
#
# Creates and initializes a new instanc... | 45.950495 | 159 | 0.70502 |
1a1828405dd8bd43dde09fbc6945be2b9fc8980a | 1,063 | #
# Cookbook Name:: sysctl
# Recipe:: default
#
# Copyright 2011, Fewbytes Technologies LTD
# Copyright 2012, Chris Roberts <chrisroberts.code@gmail.com>
# Copyright 2013-2014, OneHealth Solutions, Inc.
#
include_recipe 'sysctl::service'
if node['sysctl']['conf_dir']
directory node['sysctl']['conf_dir'] do
owne... | 24.72093 | 72 | 0.697084 |
bb7f41b11e8a0e83893cc019652d05d7bc565972 | 296 | Vmdb::Application.routes.draw do
if Rails.env.development? && ENV['MOUNT_REMOTE_CONSOLE_PROXY']
logger = Logger.new(STDOUT)
logger.level = Logger.const_get(::Settings.log.level_remote_console.upcase)
mount RemoteConsole::RackServer.new(:logger => logger) => '/ws/console'
end
end
| 37 | 79 | 0.739865 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.