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
f7d771477014f111e19116b939fa19b9b65d6601
787
#Fedena #Copyright 2011 Foradian Technologies Private Limited # #This product includes software developed at #Project Fedena - http://www.projectfedena.org/ # #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 ...
35.772727
73
0.794155
7a1ca84100aa2346439afc2e1c1ec32b7ae2f662
1,275
# frozen_string_literal: true # isitup.rb # Author: William Woodruff # ------------------------ # A Cinch plugin that provides IsItUp.org functionality for yossarian-bot. # ------------------------ # This code is licensed by William Woodruff under the MIT License. # http://opensource.org/licenses/MIT require "...
23.611111
83
0.607059
3305d681ad92a165230332e1769c21fca85be113
3,058
# Copyright 2019 Grabtaxi Holdings PTE LTE (GRAB), All rights reserved. # Use of this source code is governed by an MIT-style license that can be found in the LICENSE file require "rgl/adjacency" require "rgl/dot" require_relative "graph_visualizer" # Using RGL graph because GraphViz doesn't store adjacent of a node/...
28.055046
118
0.679529
212be09d663d8d8b7453a15c4855bcd5b31f1af3
2,534
# -*- encoding: utf-8 -*- # stub: bootsnap 1.5.1 ruby lib # stub: ext/bootsnap/extconf.rb Gem::Specification.new do |s| s.name = "bootsnap".freeze s.version = "1.5.1" s.required_rubygems_version = Gem::Requirement.new(">= 0".freeze) if s.respond_to? :required_rubygems_version= s.metadata = { "allowed_push_hos...
46.072727
302
0.657459
f83e980ad0188573b68f46d5714f369b53182713
37,380
module BossRandomizer def randomize_bosses verbose = false puts "Shuffling bosses:" if verbose dos_randomize_final_boss() boss_entities = [] game.each_room do |room| boss_entities_for_room = room.entities.select do |entity| if !entity.is_boss? next e...
43.465116
259
0.673703
bf0c105e0eaf17076f64e552d0eda1ef34f40b05
2,821
module Sprockets # `Caching` is an internal mixin whose public methods are exposed on # the `Environment` and `Index` classes. module Caching protected # Cache helper method. Takes a `path` argument which maybe a # logical path or fully expanded path. The `&block` is passed # for finding and...
29.082474
94
0.589153
392f545f2ebacf410b0a5361628e304f6d812a11
1,635
module Payday # Basically just an invoice. Stick a ton of line items in it, add some details, and then render it out! class Invoice include Payday::Invoiceable attr_accessor :invoice_number, :bill_to, :ship_to, :notes, :line_items, :shipping_rate, :shipping_description, :tax_rate, :tax_description, :...
39.878049
114
0.677676
abdece39381d737446dc09850aa26d3e947b916b
2,612
=begin #DockGenius API #No descripton provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) OpenAPI spec version: 0.1.0 Contact: hi@dockgenius.com Generated by: https://github.com/swagger-api/swagger-codegen.git Licensed under the Apache License, Version 2.0 (the "License"); you may ...
36.788732
101
0.819678
390ccb20bc7b0ff2f8dcb31ce1decc43b0429cd1
1,792
class TestTrack::ABConfiguration include TestTrack::RequiredOptions def initialize(opts) @split_name = require_option!(opts, :split_name).to_s true_variant = require_option!(opts, :true_variant, allow_nil: true) @split_registry = require_option!(opts, :split_registry, allow_nil: true) raise Argumen...
28
109
0.743304
6aec1d0b53ad8849bca5d5805bd3b6dffff44c65
1,051
Pod::Spec.new do |s| s.name = "VKFoundation" s.version = "0.1.0" s.summary = "VKFoundation provides convinient utilities that is used in Viki." s.homepage = "https://github.com/viki-org/VKFoundation" s.license = 'Apache License, Version 2.0' s.author ...
35.033333
105
0.607992
d564e1a038ca458e31ce0c2cb214d251adb52d23
525
require 'simplecov' require 'bundler/setup' SimpleCov.start do add_filter '/spec/' end Bundler.require require 'toros' RSpec.configure do |config| config.expect_with :rspec do |expectations| expectations.include_chain_clauses_in_custom_matcher_descriptions = true expectations.on_potential_false_positives ...
22.826087
76
0.79619
876e03ef1385861c0673a3b091ac973663c4cdb4
66
module Coveralls module Cobertura VERSION='1.0.0' end end
11
19
0.69697
336b2f009166a89321a231d2e6e55226a5907c96
900
class Users::OmniauthCallbacksController < Devise::OmniauthCallbacksController def facebook #Store facebook oauth token for session (nasty) oauth_token = request.env["omniauth.auth"].credentials.token session["oauth_token"] = oauth_token # You need to implement the method below in your model @use...
37.5
86
0.715556
ab7596b87cd9fdbef2611421333dd66efc5f4af0
235
require 'pry' require 'nokogiri' require 'open-uri' require_relative '../lib/afi_searcher/cli' require_relative '../lib/afi_searcher/scraper' require_relative '../lib/afi_searcher/movies' require_relative '../lib/afi_searcher/version'
29.375
46
0.791489
287c0139cf1e72e1f6b535aebff66f4c50745b19
909
# # Cookbook Name:: oneview_test_api300_synergy # Recipe:: ethernet_network_create # # (c) Copyright 2016 Hewlett Packard Enterprise Development LP # # 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 Licens...
33.666667
84
0.752475
7947fadba679de9b42faac243d18b541ef428867
5,537
# Copyright 2017 Google Inc. All rights reserved. # # 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 a...
43.944444
198
0.651616
d5e1acafea19eefe908183b85017768a3366d53b
1,750
require "rails_helper" RSpec.describe PlanCategory, :type => :model do it_behaves_like "a yearly model" let(:cat) { create :plan_category } let(:plan) { create :plan, plan_category: cat } let(:attendee) { create :attendee } before(:each) do plan.attendees << attendee end it "has a valid factory" d...
31.818182
81
0.705143
79ff90d4ca02c3f310683427a577271fbb86204b
93
require 'test_helper' module Lit class SourcesHelperTest < ActionView::TestCase end end
13.285714
48
0.784946
39038f66c87d430d230d62dfe7c17ec323493639
161
require 'test_helper' module SimpleFormCreator class QuestionTest < ActiveSupport::TestCase # test "the truth" do # assert true # end end end
16.1
46
0.695652
7947b1bad9af203127bec3d2cd22d8f27ca47d3e
5,697
# frozen_string_literal: true describe RatingAtIssue do let(:disability_sn) { "1234" } let(:diagnostic_code) { "7611" } let(:reference_id) { "1555" } let(:latest_disability_date) { Time.zone.today - 6.days } let(:claim_type_code) { "030HLRRPMC" } let(:profile_date) { Time.zone.today - 5.days } let(:promu...
27.389423
69
0.644374
e256746823d32de77b61f4a624595bcabfe97ea2
11,793
# # Original knife-windows author:: Steven Murawski (<smurawski@chef.io) # Copyright:: Copyright (c) 2015-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 may obta...
37.31962
141
0.581786
875fe0dc5f9de3918e33d56621bd103bcaf8dc62
155
# Be sure to restart your server when you modify this file. Rails.application.config.session_store :cookie_store, key: '_rails_app_with_knapsack_session'
38.75
93
0.825806
e8d26d0b3dff7b6ad99c098e839164c1d19b7822
71
class ExternalAuthor < ApplicationRecord belongs_to :publication end
17.75
40
0.84507
f8a23ef9378d29f98a8c36cc3a62c3511c0bc95f
167
# This file is used by Rack-based servers to start the application. require ::File.expand_path('../config/environment', __FILE__) run SpeakerinnenListe::Application
33.4
67
0.784431
4a6fe6c34aa08902eea977a76ab3a3a3feb27562
2,010
# -*- ruby -*- # encoding: utf-8 require File.expand_path("lib/google/cloud/metastore/v1/version", __dir__) Gem::Specification.new do |gem| gem.name = "google-cloud-metastore-v1" gem.version = Google::Cloud::Metastore::V1::VERSION gem.authors = ["Google LLC"] gem.email = "googlea...
52.894737
596
0.693532
bfe229f9fa603800e5331e4a12c743576bf758cf
390
module Bosh module Director module Models class CpiConfig < Sequel::Model(Bosh::Director::Config.db) def before_create self.created_at ||= Time.now end def manifest=(cpi_config_hash) self.properties = YAML.dump(cpi_config_hash) end def manifest ...
19.5
64
0.592308
39841c01b2f8d80a0cc31308c8be0ccc7914146d
313
class ApplicationController < ActionController::Base # Prevent CSRF attacks by raising an exception. # For APIs, you may want to use :null_session instead. # protect_from_forgery with: :exception protect_from_forgery with: :null_session, :if => Proc.new { |c| c.request.format == 'application/json' } end
44.714286
106
0.753994
1c49c23924f830b979b6fa067df9f71d83578ca7
324
cask :v1 => 'unity' do version '4.6.4' sha256 'd5d840f30d0987b3aef29dc3b651141cb5fb77fc3c28405b5ff667e03b01360a' url "http://netstorage.unity3d.com/unity/unity-#{version}.dmg" name 'Unity' homepage 'https://unity3d.com/unity/' license :commercial pkg 'Unity.pkg' uninstall :pkgutil => 'com.unity3d.*' ...
23.142857
75
0.722222
2174dbef5e1f4b882aeb1b256c7d8fed69904817
642
class CreateOldRatings < ActiveRecord::Migration def up create_table :old_ratings do |t| # Warning: column order should match CSV import file (see below). t.integer :icu_id t.integer :rating, :games, limit: 2 t.boolean :full, default: false end # This is fast, despite the large...
32.1
132
0.699377
e8abbf205256b2c57f89c93fffc06f736e29af72
211
require File.dirname(__FILE__) + "/helper" class DeleteNodeTest < NodeTestCase def test_to_sexp node = DeleteNode.new(ResolveNode.new('foo')) assert_sexp([:delete, [:resolve, 'foo']], node) end end
23.444444
51
0.706161
262cf441ae77d73fa77dd813e122f460e2992dc7
246
class AddImportDeclarationCollection < ActiveRecord::Migration def change add_column :import_declarations, :project, :string add_column :import_declarations, :source_id, :string add_index :import_declarations, :source_id end end
27.333333
62
0.788618
1afda8c8316792a24c2bbc092dc19e79ab89cfb9
96
class DeprecatedController < ApplicationController def mrl render layout: false end end
16
50
0.78125
6aade60724f897f074adde2453c11199686cd4c4
12,603
require File.dirname(__FILE__) + '/../test_helper.rb' class TestUser < Test::Unit::TestCase def setup @user = Scrobbler::User.new('jnunemaker') end test 'should be able to find one user' do assert_equal(@user.username, Scrobbler::User.find('jnunemaker').username) end test 'should be able to fi...
43.309278
118
0.72324
f8447b9f5fd17ddd3ed1e52f03c037bf496fe85a
159
require 'test_helper' class ApplicationSystemTestCase < ActionDispatch::SystemTestCase # driven_by :selenium, using: :chrome, screen_size: [1400, 1400] end
26.5
66
0.792453
61d53ddcc4263aa59c66842cb94695e2a62328c2
82
Rails.application.routes.draw do root 'stream#index' get 'stream/stream' end
13.666667
32
0.743902
f86dcd370e496b075f643d85e8ad6f75fae49107
8,904
# This cannot take advantage of our relative requires, since this file is a # dependency of `rspec/mocks/argument_list_matcher.rb`. See comment there for # details. require 'rspec/support/matcher_definition' module RSpec module Mocks # ArgumentMatchers are placeholders that you can include in message # expec...
27.738318
90
0.588275
ff41d9553ec29983861d4ec2e756db4e154b2974
849
require 'combinatorics/extensions/math' module Combinatorics module PowerSet # # Get number of elements in power set from number of elements in input # set. # # @param [Fixnum] n # Number of elements input set. # # @return [Fixnum] # Number of elements in power set. # ...
22.945946
78
0.62073
917824f5f1994e482f9bced324eb7a842ddf80a8
2,807
require_relative '../../helper' require_relative '../parser/folio/helper.rb' module Kramdown describe AdjacentElementMerger do # TODO: add spec for parallel strings of mergable elements several levels deep describe "recursively_merge_adjacent_elements!" do em_a1 = ElementRt.new(:em, nil, 'class' => 'a', ...
31.897727
87
0.443178
b9b5e99bf2b5d003682820c9712441052928fc46
782
require 'date' require_relative '../../spec_helper' describe "Date#<<" do it "subtracts a number of months from a date" do d = Date.civil(2007,2,27) << 10 d.should == Date.civil(2006, 4, 27) end it "returns the last day of a month if the day doesn't exist" do d = Date.civil(2008,3,31) << 1 d.sh...
30.076923
82
0.653453
1cbe27977a03381aa21e51442e7bca2bef85eb65
21,914
require 'rexml/document' require 'facebooker/session' begin require 'nokogiri' rescue Exception end module Facebooker class Parser module REXMLElementExtensions # :nodoc: def content self.text || '' end def [] key attributes[key] end def text? false ...
30.520891
127
0.677466
6abdd92f09d59d47b1e5bf635d2b8f6ae103dcc0
93
class AjaxController < CrudController respond_to :html, :json, :js def ajax end end
10.333333
37
0.709677
38be7f7c4ceba40f4fe789b87799acfa2af9c187
1,765
module Users class PasswordsController < Devise::PasswordsController # Intercept the creation of the reset token given an email address, and check this # value as otherwise Devise will not error if the email address is left blank. # This will not error on malformed email addresses as we are in Paranoid mo...
31.517857
95
0.700283
f896949ff17ae9a1694e08e55b653a446d529ce3
1,037
class UserOrganisationClaimer def initialize(listener, user, current_user) @listener = listener @user = user @current_user = current_user end def call(organisation_id) request_admin_status_if(organisation_id) error_message_if_not_superadmin_or_not(organisation_id) promote_user_if_supera...
24.690476
61
0.781099
f828e8318e6fc7cb72e80080157d53e86ddad8b4
543
module Iterm2 module Viewer # Render new object in terminal # @param object [Iterm2::Viewer::Entity] class Render def initialize(object) fail ArgumentError, 'incorrect media file' unless object.is_a? Iterm2::Viewer::Media @data ||= object end # Display media file d...
27.15
92
0.631676
265656217a09a440c204d270f9b2cfc9ab3399c5
152
require "gramophone/version" module Gramophone # Your code goes here... class Clazz def self.run puts "Hello from gem" end end end
13.818182
28
0.664474
d52dbf4e1b7e21787017744b8d5d09e7e51e19cb
1,798
# frozen_string_literal: true require 'test_helper' class Minitest::Heat::TimerTest < Minitest::Test def setup @timer = ::Minitest::Heat::Timer.new end def test_starting_timer assert_nil @timer.start_time @timer.start! refute_nil @timer.start_time end def test_stopping_timer assert_nil...
26.057971
70
0.735261
abddad3c23f166150ace2a611dce12b7aa5a2158
365
class User include Mongoid::Document field :name, :type => String field :email, :type => String field :nickname, :type => String field :location, :type => Array has_one :post has_many :comments, :inverse_of => :user has_many :moderated_comments, :class_name => "Comment", :inverse_of => :moderator ha...
26.071429
83
0.693151
38100c74bdb7e386c44a186c06612423ae212667
314
When /^I choose to reply a comment$/ do within "#comments li:first-child" do page.click_link "Reply" end end When /^I send the reply$/ do @message = "This is a reply" send_comment(@message) end Then /^I should see my reply$/ do within '.replies' do page.should have_content(@message) end end
18.470588
39
0.681529
ed657b16ea9de6bfe52be79cc37b9bb66ae317b2
798
class ApplicationPolicy attr_reader :user, :record def initialize(user, record) @user = user @record = record end def index? false end def show? false end def create? @user != nil && @user.has_role?(:editor) end def new? create? end def update? @user != nil && @...
14.777778
145
0.602757
1a4afb7f65fe357b72baf86ece16b6761fa98693
3,392
## # 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 = LowRanking include Msf::Exploit::FILEFORMAT def initialize(info = {}) super(update_info(info, 'N...
32.304762
99
0.576061
913abee2e25972039bd7cfdd4ed7b605a0a5c5a5
378
require 'pad_utils' require_relative '../template/test' # Test name test_name = "EncryptionEncryptCli" class EncryptionEncryptCliTest < Test def prepare # Add test preparation here end def run_test PadUtils.puts_c "Should display encrypted hello:", :blue PadUtils.main ["-e", "hello", "dev_key"] ...
16.434783
60
0.706349
e940f95a7cfbec65f3a1026aa38dc5df68f155e3
1,190
def whyrun_supported? true end def load_current_resource @mime_mapping = OO::IIS.new.mime_mapping(new_resource.site_name) @current_mime_types = @mime_mapping.mime_types @web_site = OO::IIS.new.web_site(new_resource.site_name) @new_mime_type = {'file_extension' => "#{new_resource.file_extension}", 'mime_type'...
27.674419
117
0.739496
912d03e9f7a5e18733518ec2893a23a28a4d3e7b
3,563
# encoding: utf-8 require 'uuidtools' require_relative '../../../spec_helper' require_relative '../../../../app/controllers/carto/api/user_creations_controller' describe Carto::Api::UserCreationsController do include_context 'organization with users helper' describe 'show' do it 'returns 404 for unknown use...
43.987654
141
0.734774
7a8faa181fe209e69e5c529c883bfed715fabd31
217
class BroadcastPostsChannelWorker include Sidekiq::Worker def perform(post_id) @post = Post.find(post_id) serialized_post = @post.serialize PostsChannel.broadcast_to(@post, serialized_post) end end
21.7
53
0.760369
39949dbbc1e8813bcb56b87af276f57847b0e24d
387
class CreateRelationships < ActiveRecord::Migration[5.1] def change create_table :relationships do |t| t.string :follower_id t.string :integer t.integer :followed_id t.timestamps end add_index :relationships, :follower_id add_index :relationships, :followed_id add_index :r...
25.8
72
0.710594
185d62890d02c943e29a804e8309c218b5732196
669
class Ability include CanCan::Ability def initialize(user) user ||= User.new # guest user if user.role? Role::ROLES[:premium][:name] can :manage, :all elsif user.role? Role::ROLES[:business][:name] can :manage, [Product, Asset, Issue] elsif user.role? Role...
29.086957
54
0.527653
7ac95eaa1e5d64a13135963c1ffe4d9015a787b3
462
module Ebay # :nodoc: module Requests # :nodoc: # == Attributes # text_node :item_id, 'ItemID', :optional => true # text_node :post_id, 'PostID', :optional => true class RespondToWantItNowPost < Abstract include XML::Mapping include Initializer root_element_name 'RespondToWantItNo...
25.666667
55
0.660173
08fea0a5b3a7808f1a3325c3592e6a544902d3d9
2,436
class Api::ProjectsController < ApplicationController prepend_before_action :set_parent, only: [:create, :index] prepend_before_action :authorize_teacher, :authorize_super_user, only: [:destroy, :update, :create] prepend_before_action :authenticate before_action :hide_unpublished, only: ...
30.45
208
0.71757
f7d2459dead49d48d51841d7c790d2c9c1e0dd2f
762
# Copyright by Shlomi Fish, 2018 under the Expat licence # https://opensource.org/licenses/mit-license.php Cache = { 1 => 0 } def num_distinct_factors_helper(n, start_from) if not Cache.has_key?(n) then to_add = 0 d = n if ((d % start_from) == 0) then while d % start_from == 0 ...
23.8125
72
0.576115
e80f32637940689ad431f92196180e50af45837d
833
module Gitlab module Ci module Status module Build class Play < Status::Extended def label 'manual play action' end def has_action? can?(user, :update_build, subject) end def action_icon 'icon_action_play' ...
20.825
70
0.457383
d5f12ff190ec0f0e07c308260ec3a4978e17c84c
2,870
# 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::Network::Mgmt::V2020_08_01 module Models # # Result of the request to list VirtualHubs. It contains a list of # VirtualHubs and ...
28.415842
80
0.529965
218c78b7e2c1b597e1bd14b37446451e51914fa0
401
class StopJobOnBuildServerJob < ApplicationJob queue_as :default def perform(project_id, *job_names) prj = Project.find(project_id) build_server = prj.build_server job_names.each {|job_name| build_server.api_client.job.stop_build(job_name) if build_server.api_client.job.exists?(job_name) ...
26.733333
103
0.735661
87d244962a047eee2017bca6e08e860b7a3f99b8
50
def perform w = 1 ensure w end puts perform
5.555556
12
0.66
33010550c9cd48855a608edf61bafd5582ed0ae3
591
cask 'camtasia' do version '2018.0.2,143' sha256 'c10c10f76e28eda0154a074b59417518f06b1bd8daa305d3450798554517bc16' # rink.hockeyapp.net/api/2/apps/5d440dc130030d8a5db2ee6265d8df09 was verified as official when first introduced to the cask url "https://rink.hockeyapp.net/api/2/apps/5d440dc130030d8a5db2ee6265d8...
39.4
125
0.800338
4a45cb1b5caec7f67c33988bc652e1bb20e922ed
1,235
module Cryptoexchange::Exchanges module CoinEgg module Services class Market < Cryptoexchange::Services::Market class << self def supports_individual_ticker_query? true end end def fetch(market_pair) output = super(ticker_url(market_pair)) ...
30.875
114
0.608907
ed1cde7f76190eeeb3edeb6eaf05f5530f680b35
3,469
# Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is # regenerated. module Azure::Logic::Mgmt::V2018_07_01_preview module Models # # The integration account session. # class IntegrationAccountSession < Resource includ...
28.669421
70
0.433554
392eb6aadb1201d2fd2e83ff9995183135fcb5f6
377
# frozen_string_literal: true # after modify stack, generate new stack Stack = Struct.new(:contents) do def push(character) # new character in the head Stack.new([character] + contents) end def pop # drop head Stack.new(contents.drop(1)) end def top contents.first end def inspect ...
16.391304
47
0.655172
b9e1c29ed6351498dea5332efa308311b88119da
290
module Fog module Network class StormOnDemand class Real def set_default_zone(options={}) request( :path => '/Network/Zone/setDefault', :body => Fog::JSON.encode(:params => options) ) end end end end end
17.058824
57
0.524138
e24f58aa7805d8f53f373f600b41307d5ac48de3
14,492
# encoding: utf-8 # author: Christoph Hartmann # author: Dominik Richter require 'thor' require 'inspec/log' require 'inspec/profile_vendor' require 'inspec/ui' # Allow end of options during array type parsing # https://github.com/erikhuda/thor/issues/631 class Thor::Arguments def parse_array(_name) return shif...
33.238532
141
0.616616
26d67109e9f777927e4db53e0f92c6e80b144792
7,067
# frozen_string_literal: true require_relative '../helper' describe Bade::AST::Node do context '#==' do it 'equals correctly for same instances' do node1 = Bade::AST::Node.new(:random_tag_123) expect(node1).to eq node1 end it 'equals correctly for same types' do node1 = Bade::AST::Nod...
32.56682
68
0.652894
4ac6d3c1418948e0e6062679dfebb16a4979f1a6
12,086
# 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::Consumption::Mgmt::V2019_10_01 module Models # # An marketplace resource. # class Marketplace < Resource include MsRe...
31.069409
79
0.458216
39bc530bfcea783caad56e07e5c90aa097d2e7c1
1,487
module Ttdrest module Concerns module IpTargetingList def get_ip_targeting_lists(options = {}) advertiser_id = self.advertiser_id || options[:advertiser_id] path = "/iptargetinglist/query/advertiser" params = { AdvertiserId: advertiser_id, PageStartIndex: 0, PageSize: nil } ...
34.581395
134
0.622058
33ff32429ed72e44260b4cc37dfb9066a80a4c86
381
require "sequel" require "omoikane/logging" jobsdb_url = ENV["OMOIKANE_DATABASE_URL"] raise "Missing OMOIKANE_DATABASE_URL environment variable: can't connect to internal Omoikane database" unless jobsdb_url ENV["QUIET"] = "yes" if ARGV.delete("--quiet") DB = Sequel.connect(jobsdb_url, logger: ENV["QUIET"] == "yes" ...
34.636364
121
0.766404
1a878b3a1602b07fefd9da543488cb451f9f9ae6
2,826
#!/usr/bin/env ruby =begin bindings.rb - Ruby/GTK sample script. Copyright (c) 2002-2006 Ruby-GNOME2 Project Team This program is licenced under the same licence as Ruby-GNOME2. $Id: bindings.rb,v 1.7 2006/06/17 13:18:12 mutoh Exp $ =end =begin Usage: bindings.rb <filename> Following key bindings are e...
26.166667
66
0.66242
ac1f0d06eed47a6647875f08fb6c24d6fa08076e
1,167
## System setup # Hey neat - our packages have chef from main now # which means we can: package node['install_packages'] # Time and zone should match the host so that erlang's sync module plays nicely with rsync'd files. file "/etc/timezone" do content node["tz"] owner 'root' group 'root' mode 0644 notifies ...
20.839286
99
0.718937
ed643b89523af08f577440435c99a9829f6ef529
60
require 'bundler/setup' require 'rspec' require 'timed_lru'
15
23
0.783333
79c3a180b4ab1f770335f2bd190ed9c86ab6409e
72
# frozen_string_literal: true module GHtml2Pdf VERSION = "0.4.0" end
12
29
0.736111
bfb94f651544302057bd9a6990d81d86060ea00c
490
class CreateTwitterDbStatuses < ActiveRecord::Migration[5.1] def change # I decided not to compress this table for performance reasons. create_table :twitter_db_statuses do |t| t.bigint :uid, null: false t.string :screen_name, null: false t.integer :sequence, null: fals...
27.222222
67
0.642857
28423eb8caa5568c3a75e5fe39f5783f28dee6ad
369
require 'spec_helper' describe 'Help Pages', feature: true do describe 'Show SSH page' do before do login_as :user end it 'replace the variable $your_email with the email of the user' do visit help_page_path(filepath: 'ssh/README', format: 'md') expect(page).to have_content("ssh-keygen ...
26.357143
77
0.663957
11667675399d76840a97e1d72943106fa267b263
1,693
class JdnssecTools < Formula desc "Java command-line tools for DNSSEC" homepage "https://www.verisignlabs.com/jdnssec-tools/" url "https://www.verisignlabs.com/dnssec-tools/packages/jdnssec-tools-0.12.tar.gz" sha256 "3fa0bfe062051d9048c5186adbb04d8f5e176e50da3cdcf9b0d97e1c558efc22" head "https://github.com/d...
42.325
95
0.786769
ed010282c8accbd52ffa52310bf40f222d3f1c6f
375
lib_dir = File.expand_path(File.join(File.dirname(__FILE__), '../../lib')) if File.exist?(File.join(lib_dir, 'daemons.rb')) $LOAD_PATH.unshift lib_dir else begin; require 'rubygems'; rescue ::Exception; end end require 'daemons' options = { :log_output => true, :backtrace => true } Daemons.run(File.join(Fil...
22.058824
79
0.709333
eddc584f265038556e379cd67f3b1342bea6bf51
395
describe EhjobAuthentication do describe '.config' do it 'inits Configs obj' do EhjobAuthentication.configure do |config| config.eh_url = 'http://www.employmenthero.com' end config = EhjobAuthentication.config expect(config).to be_instance_of(EhjobAuthentication::Config) exp...
28.214286
67
0.703797
d5c0f92b76189fdaa2bf02f5997095ca266067f9
17,514
=begin #NSX-T Data Center Policy API #VMware NSX-T Data Center Policy REST API OpenAPI spec version: 3.1.0.0.0 Generated by: https://github.com/swagger-api/swagger-codegen.git Swagger Codegen version: 2.4.19 =end require 'date' module NSXTPolicy # Bidirectional Forwarding Detection configuration for BGP peers ...
34.408644
508
0.634407
1aa4432d100ef11898d1518ab9eb9a7ff2949e33
172
require 'test_helper' class TextToTenantControllerTest < ActionController::TestCase # Replace this with your real tests. test "the truth" do assert true end end
19.111111
61
0.761628
1d8fe44030951bd7d1e425a5bd10060fcebf94fb
1,510
module NetSuite module Records class MatrixOptionList # Deals with both hash and arrays of attributes[:matrix_option_list] # # Hash: # # <listAcct:matrixOptionList> # <listAcct:matrixOption internalId="47" scriptId="custitem15"> # <platformCore:value internalI...
31.458333
74
0.563576
ff6537d43438592c16508b0d7c39f219bee0180a
680
# frozen_string_literal: true require 'rails_helper' describe RangeGenerator do let!(:question) do { section_start: 'De hoofddoelen', hidden: true, id: :v2, type: :range, min: 23, max: 36, step: 1, title: 'Was het voor jou duidelijk over wie je een vragenlijst inv...
22.666667
79
0.644118
ac39b6096c4bf63b055bec95394ca5818dbea763
254
require 'mkmf' # warnings save lives $CFLAGS << " -Wall " if RbConfig::CONFIG['GCC'] != "" if RUBY_PLATFORM =~ /(mswin|mingw|cygwin|bccwin)/ File.open('Makefile','w'){|f| f.puts "default: \ninstall: " } else create_makefile('posix_spawn_ext') end
21.166667
63
0.665354
1d172979ccc46318dd1142f78f11451874af0c36
15,385
# frozen_string_literal: true # Assuming you have not yet modified this file, each configuration option below # is set to its default value. Note that some are commented out while others # are not: uncommented lines are intended to protect your configuration from # breaking changes in upgrades (i.e., in the event that...
48.686709
154
0.752681
d5151cc15146b7751fc9e40aec0826997ce77daf
2,848
# 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::ContainerInstance::Mgmt::V2018_04_01 module Models # # The container group list response that contains the container group # pro...
28.48
80
0.534761
0818cf9f35a61996259d3a4a538a697ee0cd5adf
93
class Management::DashboardsController < Management::BaseController def index end end
15.5
67
0.784946
1d155324bb4cd696219215aeabe7208bdd9a3696
3,355
# frozen_string_literal: true require "erb" require "nokogiri" module Archimate module Svg class Diagram attr_reader :diagram attr_reader :svg_doc attr_reader :options DEFAULT_SVG_OPTIONS = { legend: false, format_xml: true }.freeze def initialize(diagram, o...
27.727273
116
0.585097
21438ce27e7853e95e58c392852dfb4f9a1d28ab
5,170
#!/opt/puppetlabs/puppet/bin/ruby require 'json' require 'puppet' def frontend_endpoints_delete(*args) header_params = {} argstring = args[0].delete('\\') arg_hash = JSON.parse(argstring) # Remove task name from arguments - should contain all necessary parameters for URI arg_hash.delete('_task') operatio...
32.929936
233
0.6706
ff236a77f82333d65c9e681804ee411ac4b00d35
371
require "bundler/setup" require "str_helpers_djp" RSpec.configure do |config| # Enable flags like --only-failures and --next-failure config.example_status_persistence_file_path = ".rspec_status" # Disable RSpec exposing methods globally on `Module` and `main` config.disable_monkey_patching! config.expect_w...
24.733333
66
0.757412
013ef288cf360cdc4503af4f210f57fd31247fe9
1,018
# typed: false require 'rails_helper' RSpec.describe GameGenre, type: :model do subject(:game_genre) { build(:game_genre) } describe "Validations" do it "is valid with valid attributes" do expect(game_genre).to be_valid end it { should validate_uniqueness_of(:game_id).scoped_to(:genre_id) } e...
25.45
71
0.669941
e99f33aea14e49eeddf85c93685e5d52e59b7836
1,486
module SessionsHelper # 渡されたユーザーでログインする def log_in(user) session[:user_id] = user.id end # 永続的セッションを破棄する def forget(user) user.forget cookies.delete(:user_id) cookies.delete(:remember_token) end # ユーザーのセッションを永続的にする def remember(user) user.rememb...
23.587302
75
0.637281
e8190f7afec36f95092e7dc4ad2b7fe9d75fb979
301
# frozen_string_literal: true class ChangeRawDocumentsResourceData < ActiveRecord::Migration def change change_table :raw_documents do |t| t.remove :resource_data_json t.remove :resource_data_xml t.remove :resource_data_string t.string :resource_data end end end
21.5
62
0.740864
e8c79f631240d661653fe348d65560fce04be259
1,602
class API # API for ExternalLink class ExternalLinkAPI < ModelAPI self.model = ExternalLink self.high_detail_page_length = 100 self.low_detail_page_length = 1000 self.put_page_length = 1000 self.delete_page_length = 1000 self.high_detail_includes = [ :external_site, ...
29.666667
78
0.62422
f88c85a0a0b682e232e030ddde428dc99e586f35
673
require 'dm-core' require 'stringex' module DataMapper class Property class Slug < String # Maximum length chosen because URI type is limited to 2000 # characters, and a slug is a component of a URI, so it should # not exceed the maximum URI length either. length 2000 def typecast...
22.433333
74
0.6211
ff13b2185c8bbcd41f1540d7685f6453d82a58bc
3,155
require "capybara/rspec" RSpec.configure do |config| config.before :all do FileUtils.cp('spec/stubs/hostspecs/Hostspec', './Hostspec') if File.exist?('spec/stubs/hostspecs/Hostspec') end config.before :each do File.delete('spec/stubs/hosts/hosts.tmp') if File.exist?('spec/stubs/hosts/hosts.tmp') Fi...
36.686047
138
0.72393
e9f788458ff013cc4ca33ae8c10fe4efcb01337e
404
cask "font-kaisei-harunoumi" do version :latest sha256 :no_check url "https://github.com/google/fonts/trunk/ofl/kaiseiharunoumi", verified: "github.com/google/fonts/", using: :svn name "Kaisei HarunoUmi" homepage "https://fonts.google.com/specimen/Kaisei+HarunoUmi" font "KaiseiHarunoUmi-Bol...
26.933333
66
0.727723