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
38e23f87eb8daf0ff9a5597abfe5c0dcd90c2515
811
class FontXits < Formula version "1.200" sha256 "039493b95b86d15e451e818e065e6f6719977a31e43504eb6946513ba09c8a72" url "https://github.com/khaledhosny/xits/archive/v#{version}.zip" desc "XITS" homepage "https://github.com/khaledhosny/xits" def install parent = File.dirname(Dir.pwd) != (ENV['HOMEBREW_TEM...
42.684211
84
0.68434
6281cd547fcce25c4b530c5f646a3917af7f4e26
640
module Odania module Config class Backend attr_accessor :service_name, :instance_name, :host, :port def initialize(service_name, instance_name, host, port) self.service_name = service_name self.instance_name = instance_name self.host = host self.port = port end def dump { 'serv...
20
60
0.646875
91fef171d57647b1f8b060c2e166a30c75e31a41
1,483
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 Daterizer class Application < Rails::Application config.i18n.default_locale = :es # Hobo:...
44.939394
101
0.718139
f8cd8df5df542e5930d47edf29935db71b7dedf8
75
Rails.application.routes.draw do mount Bancard::Engine => "/bancard" end
18.75
37
0.746667
0317e87517b025982424f475da8f0c93c7c38ccb
630
require_relative '../automated_init' context "Parse" do context "Singular ID" do id = 'some_id' parsed_id = ID.parse(id) test "Parsed IDis a list containing the ID" do assert(parsed_id == ['some_id']) end end context "Compound ID" do id = 'some_id+some_other_id' parsed_id = ID.p...
18.529412
62
0.631746
793e931ba2f87855292938619f0b5672c75ac088
1,355
class Ucloud < Formula desc "Official tool for managing UCloud services" homepage "https://www.ucloud.cn" url "https://github.com/ucloud/ucloud-cli/archive/0.1.35.tar.gz" sha256 "75d89abe8b6f170a0957dbc1742b060409337161d16988d14a9df8c05b81aa48" license "Apache-2.0" bottle do cellar :any_skip_relocation...
38.714286
108
0.746125
28c70c4a174b8e99954df4dae859671c8d11ef84
711
module Api class ToolsController < Api::AbstractController def index maybe_paginate tools end def show render json: tool end def destroy mutate Tools::Destroy.run(tool: tool) end def create mutate Tools::Create.run(raw_json, device: current_device) end ...
17.341463
64
0.64135
b991d00bb47f2962153d716fa2a66ad490abc5ee
1,610
module Typingpool class Amazon class HIT class Full #For more on why this subclass is neccesary, see the #documentation for #Typingpool::Amazon::HIT.cached_or_new_from_searchhits. In #short, RTurk::HITParser objects returned by RTurk::SearchHITs #are pointlessly and ...
35
70
0.635404
4accb6c318c76add320276da5562ccdc9b70eee6
224
# -*- encoding : ascii-8bit -*- require 'test_helper' class VMFixtureTest < Minitest::Test include Ethereum include VMTest run_fixtures "VMTests" def on_fixture_test(name, data) check_vm_test data end end
14
36
0.71875
28f6a21ceea1e1fa356608014b635d5a03235ed2
318
require 'bundler' begin Bundler.setup(:default, :development) rescue Bundler::BundlerError => e $stderr.puts e.message $stderr.puts "Run `bundle install` to install missing gems" exit e.status_code end $LOAD_PATH.unshift(File.dirname(__FILE__) + '/../../lib') require 'ulticoder' require 'rspec/expectations'
24.461538
61
0.742138
91027ab945cf7d9a41e66cd2588b8d8abbbefcbd
1,400
require 'test_helper' class UsersControllerTest < ActionDispatch::IntegrationTest def setup @user = users(:michael) @other_user = users(:archer) end test "should redirect index when not logged in" do get users_path assert_redirected_to login_url end test "should get new" do get signup_pat...
23.728814
64
0.739286
e272aa75e79fa19d25dbd54f17c028065c08a06d
1,083
#!/usr/bin/ruby # # Copyright 2019 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 # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agre...
30.083333
74
0.759926
1cc9bc13a10dfe5c10e00e594744bc2a1f52b018
2,685
require "spec_helper" describe Api::DevicesController do include Devise::Test::ControllerHelpers let(:user) { FactoryBot.create(:user) } let(:device) { user.device } describe "#sync" do EDGE_CASES = [:devices, # Singular resources :fbos_configs, :firmware_configs, ...
37.816901
74
0.631657
01dae5f71b3b898c39f530fcc036d3d2ef0fb66c
432
cask "aural" do version "3.5.6" sha256 "9214c40b8347ec6b0eaf6b50a1ee7479d5a5f6be51191c24fb8a199da416845e" url "https://github.com/maculateConception/aural-player/releases/download/v#{version}/AuralPlayer-#{version}.dmg" name "Aural Player" desc "Audio player inspired by Winamp" homepage "https://github.com...
30.857143
115
0.770833
b917bc48717a2eeec8ab510791f5c22dd81c9cc0
536
require 'tilt' module DocSiteBuilder class TemplateRenderer def self.template_cache @template_cache ||= {} end def self.initialize_cache(directory) Dir.glob(File.join(directory, "**/*")).each do |file| template_cache[file] = Tilt.new(file, :trim => "-") end end def ren...
20.615385
65
0.649254
e8fea0b85ff98e48b8cca330b1188c970f321ae2
383
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 before_filter :setup_user protected def setup_user if session[:account_id].present? @current_user = A...
23.9375
67
0.749347
26cf2ec96302f987bf24684fdab69c6823476246
5,474
#! /usr/bin/env ruby require 'spec_helper' describe Puppet::Parser::Functions do def callable_functions_from(mod) Class.new { include mod }.new end let(:function_module) { Puppet::Parser::Functions.environment_module(Puppet.lookup(:current_environment)) } let(:environment) { Puppet::Node::Environment.cre...
41.157895
159
0.695652
6a944665a256e3b36e8d53889be4e7be5d68f06b
3,485
module ListingViewUtils extend MoneyRails::ActionViewExtension module_function # parameters: # - units, array from shape[:units] # - selected, symbol of unit type # def unit_options(units, selected_unit = nil) units .map { |u| HashUtils.compact(u) } .map { |unit| renamed = HashUt...
34.50495
135
0.669154
acc7c54283633dddc94c8f19ef13efe07fc77cab
875
require 'spec_helper' describe 'puppetdb::master::puppetdb_conf', :type => :class do let :node do 'puppetdb.example.com' end on_supported_os.each do |os, facts| context "on #{os}" do let(:facts) do facts.merge({ :puppetversion => Puppet.version, :selinux => false ...
27.34375
107
0.604571
6163a966ce1162522f706b3a033b61a3b536649e
1,182
module FactoryHelpers def build(which, attrs = {}) method_name = "build_#{which}" if respond_to?(method_name) send(method_name) end end def create(which, attrs = {}) build(which, attrs).tap { |record| record.save! } end def build_star_event(attrs = {}) StarEvent.new({ event_i...
28.142857
79
0.611675
bb59b7929e9616a496aa526c3102fa8199cea38a
484
class Debunker class Command::ToggleColor < Debunker::ClassCommand match 'toggle-color' group 'Misc' #'Toggle syntax highlighting.' banner <<-'BANNER' Usage: toggle-color Toggle syntax highlighting. BANNER def process _debunker_.color = color_toggle output.puts "Syntax...
19.36
74
0.663223
39d12290822aaf5503d383b37a0c8f09c252842c
2,902
module Locomotive module Extensions module Page module Tree extend ActiveSupport::Concern included do include ::Mongoid::Tree include ::Mongoid::Tree::Ordering include PatchedTreeMethods ## fields ## field :depth, type: Integer, default: 0...
27.377358
103
0.591661
b942dd742eab283d37bdcc5159ac240eb1828354
7,533
require 'rbconfig' # ruby 1.8.7 doesn't define RUBY_ENGINE ruby_engine = defined?(RUBY_ENGINE) ? RUBY_ENGINE : 'ruby' ruby_version = RbConfig::CONFIG["ruby_version"] path = File.expand_path('..', __FILE__) $:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/concurrent-ruby-1.1.8/lib/concurrent-ruby" $:.unshift "...
80.138298
109
0.669189
39cfc2a697fd0f066869a18f825c673ff86af5be
2,455
Rails.application.configure do # Verifies that versions and hashed value of the package contents in the project's package.json config.webpacker.check_yarn_integrity = false # Settings specified here will take precedence over those in config/application.rb. # In the development environment your application's c...
34.577465
97
0.762933
f8c5893b0367b91b2d952daa8729fa97fd089f51
1,269
class Api::V2::RatingsController < ApiController respond_to :xml, :json # GET /api/v2/users/:user_id/ratings?given=true def index user_from_api_key = User.find_by(api_key: request.headers[:apiKey]) return render json: {ratings: [], message: "Access denied"}, status: :unauthorized if user_from_api_key.nil...
32.538462
112
0.694247
6a3b0dffae25d7ba4f150245255b19a61d17bc4e
2,588
# frozen_string_literal: true module Clusters module Aws class ProvisionService attr_reader :provider def execute(provider) @provider = provider configure_provider_credentials provision_cluster if provider.make_creating WaitForClusterCreationWorker.perform...
33.179487
102
0.664219
e81acf1fd5eb80352bd50d624a5b81b1f10e1109
229
class SetupController < ApplicationController def loadView self.view = SetupView.alloc.initWithFrame(UIScreen.mainScreen.bounds) self.view.setup_controller = self self.view.swipe(:down){ dismiss_modal } end end
22.9
73
0.764192
623ac0ae98897a3104d9acaa51a6d7a557eb23be
2,625
module CantoOAuth2 class AuthorizationServer < ::Sinatra::Base OAuthError = Class.new(RuntimeError) InvalidRequest = Class.new(OAuthError) # InvalidScope = Class.new(OAuthError) # AccessDenied = Class.new(OAuthError) # ServerError = Class.new(OAuthError) # UnauthorizedClient = ...
32.8125
102
0.614476
5df8ce41ffc76d3202736ebee147f3c090ef96ee
125
require 'spec_helper' describe "secret_key/index.html.haml" do pending "add some examples to (or delete) #{__FILE__}" end
20.833333
56
0.752
abdac07b97c6c6693e9bedcb2db8bd7e17924530
156
# frozen_string_literal: true class Tripletexer::Configuration attr_accessor :api_url def initialize @api_url = 'https://tripletex.no/' end end
15.6
38
0.74359
6164c4c44c55c145883621675e302225d10284b7
39
module GameEcs VERSION = "0.1.0" end
9.75
19
0.666667
61b674dd40142d0c37cc979f2531b130598a2fbf
34
module Hr VERSION = "0.0.3" end
8.5
19
0.617647
e896fa22712cc820ac44bdf5fffa8a81218f9ffc
60
require 'faraday' require 'json' module FutureLearnApi end
10
21
0.8
bbe15c6b49d693369ea2cb8254d8f67593dd13e9
13,058
# frozen_string_literal: true require "stringio" require "set" require "fisk/instructions" require "fisk/basic_block" require "fisk/errors" require "fisk/version" class Fisk class Operand def works? type; self.type == type; end def unknown_label?; false; end def register?; false; end def temp_regis...
22.020236
101
0.611885
ab689c5bd6418f2445dafa3669f34bda0df2976e
240
# frozen_string_literal: true require 'spec_helper' TestHosts.each_os(only: %w[opensuse]) do |os_name, host_json, spec_dir| RSpec.describe Kanrisuru::Core::Zypper do include_examples 'zypper', os_name, host_json, spec_dir end end
24
71
0.766667
f8a89a57dfa838564288fd05fda3d0a6467fe23c
170
# Cookbook Name:: oc-opsworks-recipes # Recipe:: maintenance-mode-off ::Chef::Recipe.send(:include, MhOpsworksRecipes::RecipeHelpers) toggle_maintenance_mode_to(false)
24.285714
63
0.794118
e966d3d382b281d37ed22d3c4438e6731b0dfa80
1,516
module KnifeBoxer class ConflictCheck # A Chef::Environment. This environment's version constraints will be # checked for conflicts to determine if a set of changes can be reverted. attr_reader :environment # A Hash of the form # cookbook_name<String> => { "old_version" => version<String>, "ne...
36.97561
151
0.688654
08ef5ff5794bf3fd222e502389320dd3476b3512
1,914
# Module containing the methods useful for child IFRAME to parent window communication module RespondsToParent # Executes the response body as JavaScript in the context of the parent window. # Use this method of you are posting a form to a hidden IFRAME or if you would like # to use IFRAME base RPC. def resp...
40.723404
148
0.624869
1c212a33099849a1911f0b41f381d1d9bdfa766c
619
module ApplicationHelper def format_time(time) time.strftime('%l %p, %b %e %z') end def full_time_format(time) time.strftime("%d %b %Y %I:%M%p %z") end def card_image_data(card) card_url = wall_snapshot_card_path(@wall, @wall.card_snapshot(card), card) { 'data-identifier' => card.ident...
24.76
78
0.592892
286adc3c2205c0e6a36c0043bfc04f0b373ff707
619
# Reload the browser automatically whenever files change activate :livereload ### # Compass ### compass_config do |config| config.output_style = :compressed end ### # Helpers ### helpers do def get_url absolute_prefix + url_prefix end end ### # Config ### set :css_dir, 'stylesheets' set :js_dir, 'javascrip...
16.289474
56
0.723748
bbc2ae0945d7f70689061f669f663d6177cd61d7
3,295
module Elastic module Transport module Transport module Connections # Wraps the collection of connections for the transport object as an Enumerable object. # # @see Base#connections # @see Selector::Base#select # @see Connection # class Collection ...
28.903509
116
0.529287
ff0f3ceca92e66ae979dea650b7292fd995653c7
2,698
require "formula" class Emscripten < Formula homepage "http://emscripten.org" url "https://github.com/kripken/emscripten/archive/1.21.0.tar.gz" sha1 "88967d336b50de17a4333e736b4ed3db67b7ea50" head "https://github.com/kripken/emscripten.git", :branch => "incoming" bottle do sha1 "c4632e68a9b31703e094a7e...
30.659091
98
0.689029
6106ed565dcbd32765db03a8d563f1b8ac2566fb
240
class Digitization::Fulltext < ApplicationRecord belongs_to :book, class_name: 'Digitization::Book', foreign_key: :digitization_book_id, primary_key: :id, inverse_of: :fulltext validates :text, presence: true end
26.666667
107
0.716667
112785434a577b28c1d3224b4f343f513d205021
19,232
require "pathname" require "securerandom" require "set" require "vagrant" require "vagrant/config/v2/util" require "vagrant/util/platform" require File.expand_path("../vm_provisioner", __FILE__) require File.expand_path("../vm_subvm", __FILE__) module VagrantPlugins module Kernel_V2 class VMConfig < Vagrant.pl...
35.880597
92
0.591514
7a57b2166770711dd6b58a6bc05058aacadf65c3
601
require 'ffi' module FFI module Elf class NoteHeader < FFI::Struct # Known names of notes NOTES = { :solaris => "SUNW Solaris", :gnu => "GNU" } # Value of descriptor (one word) is desired pagesize for the binary. PAGESIZE_HINT = 1 GNU_ABI_TAG = 1 ...
17.676471
74
0.535774
1ac55e2e7b8f8da0f22a5c87d7f4fe882358e559
3,669
# frozen_string_literal: true Synvert::Rewriter.new 'rails', 'strong_parameters' do default_columns = %w[id created_at updated_at deleted_at] description <<~EOS It uses string_parameters to replace `attr_accessible`. 1. it removes active_record configurations. ```ruby config.active_record.whitel...
29.352
103
0.583538
edff1d73687d37cd994d8469469fa39a3a99e3d1
710
cask :v1 => '1password-beta' do version '5.3.BETA-7' sha256 '9a640b58b0f929a1d4f5c34a4cb25d883b383b510a355479dd5df02e839c809d' url "https://cache.agilebits.com/dist/1P/mac4/1Password-#{version}.zip" name '1Password' homepage 'https://agilebits.com/onepassword/mac' license :commercial app '1Password 5.ap...
37.368421
100
0.660563
b9df2525752e0bf1b9c29d503c7e242767713ce0
999
# frozen_string_literal: true require_relative 'services/fetch_images' module JobBoard class ImageSearcher def search(request_body) JobBoard.logger.debug( 'handling request', request_body: request_body.inspect ) request_body.split(/\n|\r\n/).each do |line| images, para...
23.785714
65
0.647648
182945a502ec6c349b87dfb0dd4ac34e34c3fc3f
466
require 'test_helper' describe DragonflyFonts::Processors::CorrectMetrics do let(:app) { test_app.configure_with(:fonts) } let(:content) { app.fetch_file SAMPLES_DIR.join('sample.otf') } # TODO: figure out how to test # it { content.correct_metrics.font_info.must_equal '…' } # it { content.correct_metrics.f...
31.066667
69
0.729614
accb929394c65198a16b51f0844122c5ff33649d
475
cask 'audiobookbinder' do version '2.1' sha256 'ed0e722cbbbcad8ea305faa10e1f5f08c7719991118d015af132bb9d41f84170' url "https://bluezbox.com/audiobookbinder/AudiobookBinder-#{version}.dmg" appcast 'https://bluezbox.com/audiobookbinder/appcast.xml', checkpoint: '5513a6cc78863fd79e2779794a0767d241a066e1...
33.928571
88
0.793684
33f9a311bd35f2549c7afd9870b2eeaffcdfba38
198
class RemoveLocationColumnFromUsers < ActiveRecord::Migration def up remove_column :users, :location end def down add_column :useres, :location, :string, after: :avatar_url end end
19.8
62
0.742424
61bee4b4039e22ebe0b9afede8652db596c1fbd1
2,040
# coding: utf-8 Pod::Spec.new do |s| # MARK: - Description s.name = 'SwiftCommonsLang' s.summary = 'A collection of useful classes and Swift language extensions.' s.version = '1.4.0' s.platform = :ios s.ios.deployment_target = '9.0' s.swift_versio...
31.384615
129
0.661765
3991a9116e9c78112440a247040eb7e334aff15e
569
#!/usr/bin/env ruby dir = File.dirname(File.expand_path(__FILE__)) $LOAD_PATH.unshift dir + "/../lib" require "unimidi" # Prompts the user to select a midi output # Sends some arpeggiated chords to the output notes = [36, 40, 43] # C E G octaves = 5 duration = 0.1 # Prompt the user to select an output output = Uni...
18.966667
49
0.667838
01230baab36402dd00a5e5591ced83b05a2f6f05
1,448
class TreatiesController < ApplicationController # Controller rendering treaties index and show pages before_action :build_request ROUTE_MAP = { index: proc { ParliamentHelper.parliament_request.treaty_index }, show: proc { |params| ParliamentHelper.parliament_request.treaty_by_id.set_url_params({ tre...
38.105263
165
0.759669
1a72846f1ac18d6715746d07faea762b40580eb3
1,372
Pod::Spec.new do |s| s.name = "secp256k1-gm" s.version = "0.0.3" s.summary = "Optimized C library for EC operations on curve secp256k1" s.homepage = "https://github.com/greymass/secp256k1" s.license = { :type => "MIT", :file => "COPYING" } s.author = { "secp256k1 contributors" => "https://github.com/bitcoin...
50.814815
223
0.626093
39aaeb9303d38123286948571789ce52a614d55c
3,963
# 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::Automation::Mgmt::V2015_10_31 module Models # # Definition of the connection. # class Connection < ProxyResource incl...
30.022727
76
0.467323
0148e0c79ec0f9521cb72eb49c181ea2d86b5c98
4,004
class RegistrationsController < Devise::RegistrationsController after_action :add_account, only: [:create] after_action :attach_avatar, only: [:update] before_action :set_navbar_actions, only: [:edit, :preferences, :more_actions] before_action :set_navbar_color, only: [:edit, :preferences, :more_actions] de...
30.8
174
0.692807
2184d7fcc8cc80e958eb7571911a22e13420f6fc
665
cask 'visual-paradigm-ce' do version '16.1,20200601' sha256 'cdf2ba06bb9321e8836bb5a037ea9475293432fc9ef619bd396548ec25653b8b' url "https://www.visual-paradigm.com/downloads/vpce/Visual_Paradigm_CE_#{version.before_comma.dots_to_underscores}_#{version.after_comma}_OSX_WithJRE.dmg" appcast 'https://www.visual-p...
47.5
156
0.78797
5d15831315f0da15373bad7fb0f04e0a058005a6
182
$LOAD_PATH.unshift File.expand_path('../../lib', __FILE__) require 'runt' require 'date' require 'time' require 'rubygems' # Needed for minitest on 1.8.7 require 'minitest/autorun'
22.75
58
0.736264
e96af45dc115a7c9d81757f42cd05ff4864205d0
618
# frozen_string_literal: true require "openapi3_parser/node_factory/object" module Openapi3Parser module NodeFactory class Server < NodeFactory::Object allow_extensions field "url", input_type: String, required: true field "description", input_type: String field "variables", factory: :va...
22.071429
53
0.668285
032c49ed1590fa46950cf8b51a9f417aeb6232c4
685
module Gitlab module QuickActions class SubstitutionDefinition < CommandDefinition # noop?=>true means these won't get extracted or removed by Gitlab::QuickActions::Extractor#extract_commands # QuickActions::InterpretService#perform_substitutions handles them separately def noop? true ...
27.4
114
0.642336
622729e3274b01c07134477afad8e4adaa02e8fd
771
$:.push File.expand_path("../lib", __FILE__) # Maintain your gem's version: require "catcontacts/version" # Describe your gem and declare its dependencies: Gem::Specification.new do |s| s.name = "catcontacts" s.version = Catcontacts::VERSION s.authors = ["Jeff Shumate"] s.email = ["jeff@e...
29.653846
85
0.638132
01fc0a3cf0e8ad4fb6dab16e96c15656612d8294
1,567
# Settings specified here will take precedence over those in config/environment.rb # The test environment is used exclusively to run your application's # test suite. You never need to work with it otherwise. Remember that # your test database is "scratch space" for the test suite and is wiped # and recreated between...
47.484848
97
0.777281
1a75f93094b47b2648e2717d46b7411e9281a7c4
102
require 'shared_user' class User include Mongoid::Document include Shim include SharedUser end
12.75
27
0.784314
bbe02ee7162be35ff2491dd77502559ed06e6b28
453
module TPPlus module Nodes class RealNode < BaseNode def initialize(value) @value = value end def requires_mixed_logic?(context) false end def eval(context,options={}) val = if options[:as_string] ("%.2f" % @value).sub(/^0/,'') else ...
16.178571
40
0.465784
4af30ea13f1bee28616a4a980f6f4955622dae1b
39,575
require 'active_resource/connection' require 'cgi' require 'set' module ActiveResource # ActiveResource::Base is the main class for mapping RESTful resources as models in a Rails application. # # For an outline of what Active Resource is capable of, see link:files/vendor/rails/activeresource/README.html. # #...
38.534567
135
0.622186
18335ad83617a028514dd856f3a4c14f7421d386
3,506
class Grafana < Formula desc "Gorgeous metric visualizations and dashboards for timeseries databases" homepage "https://grafana.com" url "https://github.com/grafana/grafana/archive/v8.1.3.tar.gz" sha256 "0ba2e11ede1501c370e5f7634125d63cf6d6f8d6c65e9e256dd998bd4f0db1cc" license "AGPL-3.0-only" head "https://...
31.303571
122
0.673987
bf1d8d8b5fc9a6cbd8ba92405847e492a3c962ce
1,080
# frozen_string_literal: true module Projects module Registry class TagsController < ::Projects::Registry::ApplicationController before_action :authorize_destroy_container_image!, only: [:destroy] def index respond_to do |format| format.json do render json: ContainerTag...
22.5
73
0.571296
5d88a5daecd17e34ea4d870103d2a6f1ba23b812
45,823
require 'time' require 'ostruct' require 'uri' require 'rack' if ENV['SWIFT'] require 'swiftcore/swiftiplied_mongrel' puts "Using Swiftiplied Mongrel" elsif ENV['EVENT'] require 'swiftcore/evented_mongrel' puts "Using Evented Mongrel" end module Rack #:nodoc: class Request #:nodoc: # Set of request meth...
30.919703
120
0.631255
f81b4accd33ad93c4a8a4c9011076c73be530bb5
377
require 'formula' class Stress < Formula homepage 'http://weather.ou.edu/~apw/projects/stress/' url 'http://weather.ou.edu/~apw/projects/stress/stress-1.0.4.tar.gz' sha1 '7ccb6d76d27ddd54461a21411f2bc8491ba65168' def install system "./configure", "--disable-dependency-tracking", ...
26.928571
70
0.668435
bf679769074ed890e03e987e6aee6035995b0faf
950
# # To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html. # Run `pod lib lint flutter_yidun_captcha.podspec` to validate before publishing. # Pod::Spec.new do |s| s.name = 'flutter_yidun_captcha' s.version = '0.0.1' s.summary = 'A new flutter plugin proje...
36.538462
105
0.598947
018683305e0a310e46c1db079d18155041685f88
1,662
require 'spec_helper' java_7_path = '/usr/lib/jvm/java-7-openjdk-amd64/jre/bin/java' java_7_home = '/usr/lib/jvm/java-7-openjdk-amd64' java_8_path = '/usr/lib/jvm/oracle-java8-jre-amd64/bin/java' java_8_home = '/usr/lib/jvm/oracle-java8-jre-amd64' def unlink_and_delete(filename) if File.symlink?(filename) File....
30.218182
86
0.705776
87fa858cfc9e601a280d155b779b749449659312
73
(1..10).each do |i| ... 1.upto(10) do |i| ... 10.times do |n| i=n+1; ...
18.25
26
0.452055
f8d823f019ced023c3918cdc24ea691bb5bafa0e
3,511
# name: after-logout-endpoint # about: An endpoint to redirect to after logout which performs additional functions to the user browser # version: 0.0.2 # authors: Stackable Regiments pty ltd # url: https://github.com/StackableRegiments/discourseLogout enabled_site_setting :enhancedLogout_enabled after_initialize do ...
25.627737
105
0.71632
26594f7ccfa908155f751b419aae9c4bd706cc2a
3,115
# The helper methods here are used to build the main index template file for # a SproutCore application. See the commented index.rhtml in the plugin for # example usage. # module SproutCore module Helpers module StaticHelper # This method will return the HTML to link to all the stylesheets # r...
33.138298
100
0.5939
261388ba900ea91600cf444ed5b3aec5edfa63a6
1,960
#!/usr/bin/env ruby # # Sensu Logstash Handler # # Heavily inspried (er, copied from) the GELF Handler writeen by # Joe Miller. # # Designed to take sensu events, transform them into logstah JSON events # and ship them to a redis server for logstash to index. This also # generates a tag with either 'sensu-ALERT' or 's...
32.131148
101
0.602041
ff7fe985f7a8f40b084f23065cf06916405f1dda
285
#Sources: #https://www.railstutorial.org/book, Hartl Michael, 2014 #https://www.railstutorial.org/book/modeling_users class AddResetToUsers < ActiveRecord::Migration def change add_column :users, :reset_digest, :string add_column :users, :reset_sent_at, :datetime end end
25.909091
56
0.764912
d5e2ecce90ea88a52da5d71d522c17e8cd7e09d7
1,879
# # Cookbook:: ambari-chef # Spec:: default # # The MIT License (MIT) # # Copyright:: 2018, Ryan Hansohn # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including witho...
37.58
79
0.74827
26a2afd88b5962baba576f84fed53b50d9158695
426
cask 'navicat-for-oracle' do version '12.1.12' sha256 '63241b27dccb06ca54c0df5a843e8223ca817cfc33f2788b7b3c70ccc65af47d' url "http://download.navicat.com/download/navicat#{version.major_minor.no_dots}_ora_en.dmg" appcast 'https://www.navicat.com/products/navicat-for-oracle-release-note' name 'Navicat for Ora...
35.5
93
0.784038
33e08b80919154272be22533e832fe7c57006e08
1,040
# frozen_string_literal: true require "rails_helper" RSpec.describe "absence_requests/edit", type: :view do let(:absence_request) do FactoryBot.create(:absence_request, absence_type: "vacation") end before do assign(:request_change_set, AbsenceRequestChangeSet.new(absence_request, start_date: Date.parse(...
40
151
0.726923
7a44c10c1ee14cb891a99a53f26afddf37e7b7c8
1,874
=begin #EVE Swagger Interface #An OpenAPI for EVE Online OpenAPI spec version: 0.4.5 Generated by: https://github.com/swagger-api/swagger-codegen.git =end require 'spec_helper' require 'json' require 'date' # Unit tests for Esi::OpportunitiesGroup # Automatically generated by swagger-codegen (github.com/swagger-a...
26.027778
103
0.717716
11685bc8ff21926b746002c075bb1c2e39fcc045
384
# frozen_string_literal: true class NewsSerializer include JSONAPI::Serializer attributes :title, :description, :short_description, :url, :topic_url, :is_active, :created_at, :updated_at belongs_to :user attribute :news_banner do |banner| Rails.application.routes.url_helpers.rails_blob_url(banner.news_ban...
32
124
0.791667
e93763fddc6f0c7a7ef4f71c04da9e2f93c16c81
1,784
require 'support/shared/integration/integration_helper' require 'chef/mixin/shell_out' describe "LWRPs" do include IntegrationSupport include Chef::Mixin::ShellOut let(:chef_dir) { File.expand_path("../../../../bin", __FILE__) } # Invoke `chef-client` as `ruby PATH/TO/chef-client`. This ensures the # follo...
30.758621
138
0.676009
d5491332771f168549fc6e82e1382cbaa231b060
76
# -*- coding: utf-8 -*- module DirCat NAME='dircat' VERSION='0.2.2' end
12.666667
23
0.592105
4a6579be73a327bcbd1c8765ac93d9f5bbf14571
660
require File.expand_path("../../Abstract/abstract-php-extension", __FILE__) class Php73Mustache < AbstractPhp73Extension init desc "Mustache PHP Extension" homepage "https://github.com/jbboehr/php-mustache#mustache" url "https://github.com/jbboehr/php-mustache/archive/v0.7.2.tar.gz" sha256 "5eb0a25d42532db98...
30
75
0.751515
08cef2a89041e33db8c3ff81180bce89ace08685
849
# -*- encoding: utf-8 -*- lib = File.expand_path('../lib', __FILE__) $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib) # vendor = File.expand_path('../vendor', __FILE__) # puts "THE VENDOR = #{vendor}" # $LOAD_PATH.unshift(vendor) unless $LOAD_PATH.include?(vendor) require 'jcarousel/version' Gem::Specification...
33.96
83
0.631331
f84f4c2bfb03aa1a83c3a01fcae02173251a62e1
729
describe "", :type => :model do it "should do something" do author = Author.new({first_name: "Alan", last_name: "Turing", homepage: "http://wikipedia.org/Alan_Turing"}) expect(author.first_name).to eq("Alan") expect(author.last_name).to eq("Turing") expect(author.homepage).to eq("http://wikipedia.or...
36.45
112
0.685871
bfa6129a2184ce5ed5c774c59bcc25824604ba6e
2,711
require 'rails_helper' RSpec.describe TicketPolicy do context 'permissions' do subject { TicketPolicy.new(user, ticket) } let(:user) { FactoryGirl.create(:user) } let(:project) { FactoryGirl.create(:project) } let(:ticket) { FactoryGirl.create(:ticket, project: project) } context 'for anonymou...
31.16092
66
0.653633
798dac244ed053ec37838eefb761d600394990cb
1,324
require 'fileutils' cask 'unity@5.5.3f1' do version '5.5.3f1,4d2f809fd6f3' sha256 '3d9174919b3fd0adc0a749f8627a18715671720d54d2eb055bcbd33cd2f8b12b' url "http://download.unity3d.com/download_unity/#{version.after_comma}/MacEditorInstaller/Unity.pkg" name 'Unity Editor' homepage 'https://unity3d.com/unity/' ...
27.583333
102
0.69864
e9a84fcba6b193431cc1e77c168791cc46878908
275
class CreateEvents < ActiveRecord::Migration def change create_table :events do |t| t.string :name t.text :description t.datetime :date t.text :notes t.decimal :price t.string :image t.timestamps null: false end end end
18.333333
44
0.625455
d5b1e46c73d6351d59a53c9bc7637fd2dc3bfd94
2,075
Rails.application.configure do # Settings specified here will take precedence over those in config/application.rb. # In the development environment your application's code is reloaded on # every request. This slows down response time but is perfect for development # since you don't have to restart the web serv...
34.016393
85
0.761446
f77c686a2cf21de30d3f5b1d70974b21bd3a3291
1,652
require_relative 'node.rb' require_relative '../processors/check_assign_type.rb' require_relative '../concerns/localvar_definition_concern.rb' require_relative '../processors/convert_set_value.rb' class DabNodeSetLocalVar < DabNode include LocalvarDefinitionConcern attr_accessor :identifier attr_reader :my_type...
21.179487
70
0.732446
61423b1f83a6a0f5ce74a22d9a8a03358767b1b5
1,686
data_bag_name = node["sensu"]["data_bag"]["name"] enterprise_item = node["sensu"]["data_bag"]["enterprise_item"] begin unless get_sensu_state(node, "enterprise") enterprise = Sensu::Helpers.data_bag_item(enterprise_item, true, data_bag_name) set_sensu_state(node, "enterprise", enterprise) end rescue => e ...
38.318182
164
0.661329
bf2ea652605fe01e6e51c906bc2a2c767179e186
6,713
require "devise/hooks/lockable" module Devise module Models # Handles blocking a user access after a certain number of attempts. # Lockable accepts two different strategies to unlock a user after it's # blocked: email and time. The former will send an email to the user when # the lock happens, contai...
34.603093
135
0.647252
5de9409ad1ed2fde247260cf8ee41385be526b51
442
require 'shellwords' class MiningClass @file_path = nil def initialize(file_path) @file_path = file_path end def apache_referrer #sh = Shellwords.escape("cat /var/log/nginx/access.log | gawk -F\\\" '$4 !~ \"http://blog.kz-dev.com\" && $4 != \"-\" {system(\"echo \" $4)}' | awk -F/ '{print $3}' | sort | uni...
31.571429
200
0.61991
b9ce327b2ce54978f4569abee828c44e0745707a
579
class CreatePages < ActiveRecord::Migration def change create_table :pages do |t| t.string :name, null:false t.integer :kind, null:false t.integer :owner_id, null:false t.boolean :active t.string :sector t.string :no_employees t.string :links t.string :description ...
21.444444
44
0.626943
39a82dec98bfed358366087c4cc77c009f8b31e5
202
class CreateLocations < ActiveRecord::Migration[6.0] def change create_table :locations do |t| t.string :name t.decimal :lat t.decimal :lng t.timestamps end end end
16.833333
52
0.638614
014b24313b3e214c79bba1f7149781e01f97c735
1,050
require File.expand_path(File.dirname(__FILE__) + '/../../../spec_helper') module Rack::Bug describe TimerPanel do before do header "rack-bug.panel_classes", [TimerPanel] end describe "heading" do it "displays the elapsed time" do response = get "/" response.should have_h...
27.631579
77
0.601905
e96422ae787d629f258abdac1656b425cfae791a
630
# frozen_string_literal: true require_relative '../token' module Engine module Step module G18AL class Token < Token def place_token(entity, city, token, connected: true, extra: false, special_ability: nil) super @game.abilities(entity, :assign_hexes) do |ability| ...
24.230769
97
0.58254
1115a5e7f259f60665b22276855197353d61f6dd
1,801
# 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. require "json" package = JSON.parse(File.read(File.join(__dir__, "..", "..", "package.json"))) version = package['version'] source = { :git ...
40.022222
128
0.589117