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 |
|---|---|---|---|---|---|
87f0b8af55888f6eeacaa8bf3e587288c36201e0 | 376 | module Rubex
module DataType
class ULLInt
include UIntHelpers
def to_s
'unsigned long long int'
end
def to_ruby_object(arg)
"ULL2NUM(#{arg})"
end
def from_ruby_object(arg)
"NUM2ULL(#{arg})"
end
def ullint?
true
end
def... | 13.925926 | 32 | 0.521277 |
871fcbdfe310f2fc8bdd3f852dfd5143f2a70c0d | 184 | module Codebreaker
module Errors
class HintError < StandardError
def initialize(message = 'You have used all hints... ')
super(message)
end
end
end
end
| 18.4 | 61 | 0.646739 |
f8d555a82409ff12d5de6cf02caeecfdd72f345b | 1,556 | class Openrtsp < Formula
desc "Command-line RTSP client"
homepage "http://www.live555.com/openRTSP"
url "http://www.live555.com/liveMedia/public/live.2020.08.19.tar.gz"
mirror "https://download.videolan.org/pub/videolan/testing/contrib/live555/live.2020.08.19.tar.gz"
# Keep a mirror as upstream tarballs are r... | 31.12 | 100 | 0.703085 |
01800436b6df2d5844b8bc429e6f9f5ff67763f4 | 14,247 | # ----------------------------------------------------------------------------
#
# mkmath.rb
#
# This file is part of Ruby/CArray extension library.
# You can redistribute it and/or modify it under the terms of
# the Ruby Licence.
#
# Copyright (C) 2005 Hiroki Motoyoshi
#
# ----------------------------------------... | 19.200809 | 131 | 0.509792 |
08994f5d195ff7b9059b3683d479aa1c5c398c59 | 1,484 | # -*- encoding: utf-8 -*-
# stub: shell 0.7 ruby lib
Gem::Specification.new do |s|
s.name = "shell".freeze
s.version = "0.7"
s.required_rubygems_version = Gem::Requirement.new(">= 0".freeze) if s.respond_to? :required_rubygems_version=
s.require_paths = ["lib".freeze]
s.authors = ["Keiju ISHITSUKA".freeze]
... | 41.222222 | 253 | 0.674528 |
e87da09c5e896372104f4688d4c9c84142d6d2a5 | 1,574 | # encoding: UTF-8
lib = File.expand_path('../lib/', __FILE__)
$LOAD_PATH.unshift lib unless $LOAD_PATH.include?(lib)
require 'spree_stalnoy_import_export/version'
Gem::Specification.new do |s|
s.platform = Gem::Platform::RUBY
s.name = 'spree_stalnoy_import_export'
s.version = SpreeStalnoyImportExp... | 36.604651 | 109 | 0.741423 |
8715d9d2e968272fce5daf7660548aad97ac1b36 | 1,586 | #: * `edit`:
#: Open all of Homebrew for editing.
#:
#: * `edit` <formula>:
#: Open <formula> in the editor.
require "formula"
require "cli_parser"
module Homebrew
module_function
def edit
Homebrew::CLI::Parser.parse do
switch :force
switch :verbose
switch :debug
end
unless... | 25.580645 | 84 | 0.612863 |
216dd6848f8135a67aa27cbf2da953720d9e9f32 | 454 | class Sup < Formula
desc "Configurable changelog generator for git repositories."
homepage "https://github.com/umurgdk/sup"
url "https://github.com/umurgdk/sup/archive/v1.1.0.tar.gz"
version "1.1.0"
sha256 "d9f80b8c3368037e1058df698bd3d4451fd5b64bb6d554fc2593454d79e2a5f1"
depends_on "cmake" => :build
dep... | 26.705882 | 75 | 0.731278 |
edb09eb105a0f7ee9b4e702e2a08d08fceaa69d6 | 133 | require 'test_helper'
class SurgHospCrConditionTest < ActiveSupport::TestCase
# test "the truth" do
# assert true
# end
end
| 16.625 | 55 | 0.729323 |
26526c4a0a8ff52ce0940b5b2b7cba0d3709524d | 1,598 | =begin
#The Plaid API
#The Plaid REST API. Please see https://plaid.com/docs/api for more details.
The version of the OpenAPI document: 2020-09-14_1.64.13
Generated by: https://openapi-generator.tech
OpenAPI Generator version: 5.1.0
=end
require 'date'
require 'time'
module Plaid
class PaymentInitiationPaymentS... | 31.333333 | 80 | 0.737797 |
e9eaf5829b18b598b476495ec7ea597edefac299 | 172 | class AddSlackTeamIdToUser < ActiveRecord::Migration[5.1]
def change
add_column :users, :slack_team_id, :string
add_column :users, :slack_name, :string
end
end
| 24.571429 | 57 | 0.744186 |
339863d4cb134c180afaeb92bb4c942d1997fb59 | 577 | ##
# A migration that updates the object column size on PaperTrail's version table
# This is in a generator template because our migrations run before PaperTrail is installed
class ChangePaperTrailVersionsObjectColumnToMediumText < ActiveRecord::Migration[5.1]
# See https://github.com/paper-trail-gem/paper_trail/blob... | 48.083333 | 175 | 0.809359 |
edb0db05e07698111597c5ac239f6707bdba1a10 | 4,148 | require "formula"
class Imagemagick < Formula
homepage "http://www.imagemagick.org"
url "http://www.imagemagick.org/download/releases/ImageMagick-6.8.9-8.tar.xz"
sha256 "27360449c6f3d4cca548d1780ecd5f8313a57a0a83d6d953a5088cc81714e9b0"
head "http://www.imagemagick.org/subversion/ImageMagick/trunk"
bottle d... | 34.566667 | 107 | 0.672372 |
d5c5e893447798212bb8badbf83e033a2def2301 | 2,132 | require 'spec_helper'
describe jenkins_user_credentials('schisamo') do
it { should be_a_jenkins_credentials }
it { should have_description('passwords are for suckers') }
it { should have_password('superseekret') }
end
describe jenkins_user_credentials('schisamo2') do
it { should be_a_jenkins_credentials }
i... | 35.533333 | 112 | 0.773452 |
1d13769fef5bb57976a6191c2bafed9830e319de | 609 | class Locomotive::Translation
include Locomotive::Mongoid::Document
## fields ##
field :key
field :values, type: Hash, default: {}
## associations ##
belongs_to :site, class_name: 'Locomotive::Site'
## validations ##
validates_uniqueness_of :key, scope: :site_id
validates_presence_of :site, :key
... | 19.03125 | 61 | 0.70936 |
f81e038c66ec009312fe7818a83155d86435468b | 991 | class Ansifilter < Formula
desc "Strip or convert ANSI codes into HTML, (La)Tex, RTF, or BBCode"
homepage "http://www.andre-simon.de/doku/ansifilter/ansifilter.html"
url "http://www.andre-simon.de/zip/ansifilter-2.9.tar.bz2"
sha256 "f9c4c0d8a4532b89ee16ff5ac51eee46dc581fb4cc50d51a97dddd15385abc3a"
bottle do
... | 36.703704 | 94 | 0.764884 |
ffd56ba5342dd5ab09f0676bbc1865991bf86f7d | 3,046 | #!/opt/puppetlabs/puppet/bin/ruby
require_relative '../lib/puppet/util/task_helper'
require 'json'
require 'puppet'
require 'openssl'
# require 'pry-remote'; binding.remote_pry
# class PowerstoreImportStorageCenterInstanceQueryTask
class PowerstoreImportStorageCenterInstanceQueryTask < TaskHelper
def task(arg_hash)... | 35.011494 | 134 | 0.650361 |
3821f6b80b0149a787811de3e45866587047d058 | 275 | class Relationship < ApplicationRecord
# リレーションシップ/フォロワーに対して関連付け
belongs_to :follower, class_name: "User"
belongs_to :followed, class_name: "User"
# Relationshipモデルに対するバリデーション(省略可)
validates :follower_id, presence: true
validates :followed_id, presence: true
end
| 30.555556 | 42 | 0.785455 |
382872c8c80fbcf485c7cbfd434525a861a7b19e | 1,214 | Pod::Spec.new do |s|
s.name = "AVOSCloud"
s.version = "3.3.5"
s.platform = :ios, "7.0"
s.summary = "LeanCloud iOS SDK for mobile backend."
s.homepage = "https://leancloud.cn"
s.documentation_url = "https://leancloud.cn/api-docs/iOS/index.html"
s.license = {
:type => "Commercial",
:text => ... | 34.685714 | 149 | 0.632619 |
1c2a6f810a27d143c11bb49c1f26c66dc837419f | 586 | class Admin::TaxonomiesController < Admin::BaseController
resource_controller
create.wants.html {redirect_to edit_admin_taxonomy_url(@taxonomy)}
update.wants.html {redirect_to collection_url}
create.after do
taxon = Taxon.new(:name => @taxonomy.name, :taxonomy_id => @taxonomy.id, :position => 1 )
... | 21.703704 | 93 | 0.68942 |
111707fdf98a6d399f8cf98f11f2b21afcf04f64 | 10,897 | require 'test/unit'
require 'require_relative'
require_relative '/../../lib/classes/atom'
module ShouldBeAnAtom
def test_should_be_of_atom_class
assert_equal(MethodTrails::Atom, @atom.class)
end
def test_should_respond_to_atom?
assert(@atom.respond_to?(:atom?))
end
def test_should_be_an_atom
asse... | 25.224537 | 65 | 0.760485 |
38412e63e2d2aeb7298e2707b739fe2314539050 | 806 | include_recipe 'db-ssl::setup'
include_recipe 'mysql::client'
mysql_slave node['dna']['db_host'] do
password node['owner_pass']
end
def self.mysql_slave_is_slavey?
begin
foo = `mysql -e "show slave status"`
!foo.empty?
rescue
false
end
end
# Only run the mysql_slave recipes if it isn't already a ... | 23.028571 | 75 | 0.7134 |
613c32ade8bd73f3f3041f6c02121ab497013be2 | 82 | # frozen_string_literal: true
class ApplicationBlueprint < Blueprinter::Base
end
| 16.4 | 46 | 0.829268 |
bbdc6c2bc07e9c4d55590bedd2b11e24a4b83d8f | 370 | # coding: utf-8
# Process :next_history
module MiniReadline
# Process :next_history
class Edit
# The insert_text command. We are DONE!
def next_history(_keyboard_args)
if (temp = @history.get_next_history)
@edit_buffer = temp
@edit_posn = temp.length
else
... | 18.5 | 44 | 0.608108 |
91c1fcbceab4475c3641837d3bf5e23d64433535 | 1,524 | cask "pycharm-edu" do
arch = Hardware::CPU.intel? ? "" : "-aarch64"
version "2022.1.1,221.5591.62"
if Hardware::CPU.intel?
sha256 "b27a1ebff26e341570ffcae4dce8a5124c6d904667ceac51d02d0ccd9e6b8903"
else
sha256 "b68584964badfb0241b27f71898f9a797ede86e69ade1b6228bceab8db1c1bde"
end
url "https://down... | 31.75 | 115 | 0.701444 |
2802592aaabafb2f68030d0b31516e5d2f653ad5 | 660 | # Be sure to restart your server when you modify this file.
# Your secret key is used for verifying the integrity of signed cookies.
# If you change this key, all old signed cookies will become invalid!
# Make sure the secret is at least 30 characters and all random,
# no regular words or you'll be exposed to diction... | 50.769231 | 175 | 0.815152 |
ab12e79446f7d8f69aa820960aae1338dc61f64b | 450 | # frozen_string_literal: true
module System32FFI
extend FFI::Library
ffi_convention :stdcall
ffi_lib :shell32
attach_function :SHGetFolderPathW, %i[hwnd dword handle dword lpwstr], :dword
ffi_convention :stdcall
ffi_lib :kernel32
attach_function :IsWow64Process, %i[handle pointer], :win32_bool
ffi_c... | 21.428571 | 79 | 0.768889 |
4a3b1368a673fba4dc77acf44ed6b3a0d6c30991 | 435 | # frozen_string_literal: true
require 'spec_helper'
require 'vk/api/messages/methods/delete_chat_photo'
RSpec.describe Vk::API::Messages::Methods::DeleteChatPhoto do
subject(:model) { described_class }
it { is_expected.to be < Dry::Struct }
it { is_expected.to be < Vk::Schema::Method }
describe 'attributes' d... | 27.1875 | 61 | 0.733333 |
bb3481c68cc8bf151f1585bb881967cdfe766bbd | 143 | # @type var x: foo
x = ""
x + 123
# @type var y: bar
y = x
y = []
# @type var z: Symbol
case x
when String
z = x
when Integer
z = x
end
| 8.411765 | 21 | 0.538462 |
91cada819c84edc7134dd00e677ef061509e090d | 3,522 | module SignUpSheetHelper
# if the instructor does not specific the topic due date, it should be the same as assignment due date;
# otherwise, it should display the topic due date.
def check_topic_due_date_value(assignment_due_dates, topic_id, deadline_type_id = 1, review_round = 1)
due_date = get_topic_deadli... | 42.433735 | 138 | 0.665531 |
bfd94a1d05fa6ae38d99ae1633b94255918bd938 | 1,221 |
describe GridServices::Scale, celluloid: true do
let(:grid) { Grid.create!(name: 'test-grid', initial_size: 1) }
let(:host_node) { grid.create_node!('test-node', node_id: 'aa') }
let(:redis_service) {
GridService.create(
grid: grid, name: 'redis', image_name: 'redis:2.8'
)
}
let(:subject) {
... | 25.4375 | 78 | 0.642097 |
619479f90b68ca92a8614f585c2446b37ef9ad09 | 291 | module Ebay # :nodoc:
module Types # :nodoc:
class PaymentMethodSearchCode
extend Enumerable
extend Enumeration
PayPal = 'PayPal'
PaisaPay = 'PaisaPay'
PayPalOrPaisaPay = 'PayPalOrPaisaPay'
PaisaPayEscrowEMI = 'PaisaPayEscrowEMI'
end
end
end
| 20.785714 | 45 | 0.670103 |
2134b2f94ae36e083b055381c18217df83e3c8d9 | 5,296 | class Apt < Formula
desc "Advanced Package Tool"
homepage "https://wiki.debian.org/apt"
url "https://deb.debian.org/debian/pool/main/a/apt/apt_1.9.3.tar.xz"
sha256 "f84d5028da78de8b60d80c8639d094422947c8fdc918625ed8f23cbce5e59265"
bottle do
sha256 x86_64_linux: "3ee78dbad649cf2acedacbf8d049001118133d2bdc... | 30.790698 | 92 | 0.690332 |
ff79e565bb8d6325da5c3fe32cf3d1fa1015d870 | 1,377 | # frozen_string_literal: true
# Cloud Foundry Java Buildpack
# Copyright 2013-2018 the original author or authors.
#
# 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.... | 33.585366 | 97 | 0.740741 |
08629818fdc8561700c325ed612b212e21d24a3e | 2,035 | class ChromeCli < Formula
desc "Control Google Chrome from the command-line"
homepage "https://github.com/prasmussen/chrome-cli"
url "https://github.com/prasmussen/chrome-cli/archive/1.6.0.tar.gz"
sha256 "ff1fba560743cba7b661e8daef52d4494acc084da4a21c3fad211f7cdf5e971f"
license "MIT"
head "https://github.co... | 45.222222 | 122 | 0.763636 |
6a2e823a9eb603287e335e2e09eb906c3266769b | 1,314 | module Jets
class TmpLoader
include AwsServices
def self.load!
new.load
end
def initialize(yaml_path=nil)
yaml_path ||= "#{Jets.root}/handlers/data.yml"
return unless File.exist?(yaml_path)
@data = YAML.load_file(yaml_path)
@s3_bucket = @data['s3_bucket']
@rack_zi... | 24.333333 | 101 | 0.621766 |
b9f597b7d3b44490f89121fd82d6eac2de808c1f | 896 | # frozen_string_literal: true
require 'rubygems/test_case'
require "rubygems/simple_gem"
require 'rubygems/validator'
class TestGemValidator < Gem::TestCase
def setup
super
@simple_gem = SIMPLE_GEM
@validator = Gem::Validator.new
end
def test_alien
@spec = quick_gem 'a' do |s|
s.files = ... | 19.478261 | 66 | 0.641741 |
28f6d8b45d42ea7442300ff7dde4b262db90fabb | 2,041 | class CameraSet
attr_accessor :cameras, :output, :sequence, :identity_photo_expected_time, :processed_photos
def initialize(output: nil, identity_photo_expected_time: nil)
@cameras = []
@sequence = 1
@identity_photo_expected_time = identity_photo_expected_time
@processed_photos = []
if output.... | 26.855263 | 127 | 0.66928 |
bf92c3dce444a2199d6529297cd4ba7670864266 | 247 |
require 'rubygems'
require 'mechanize'
require 'nokogiri'
require 'pp'
login_url = "http://unitrix.cs.unipi.gr/grader.php?oker=1"
a = Mechanize.new
a.verify_mode = OpenSSL::SSL::VERIFY_NONE
while true do
a.get( login_url )
sleep( 5 )
end
| 15.4375 | 58 | 0.716599 |
7a4ebe5dfa102fd6e73358813b9ef377d41afc2c | 1,075 | # frozen_string_literal: false
# ----------------------------------------------------------------------------
#
# *** AUTO GENERATED CODE *** AUTO GENERATED CODE ***
#
# ----------------------------------------------------------------------------
#
# This file is automatically generated by Magic ... | 30.714286 | 78 | 0.514419 |
3873cdf9881a81939942ad8b67975b1a8100ab08 | 2,360 | require "minitest/unit"
##
# Show your testing pride!
class PrideIO
# Start an escape sequence
ESC = "\e["
# End the escape sequence
NND = "#{ESC}0m"
# The IO we're going to pipe through.
attr_reader :io
def initialize io # :nodoc:
@io = io
# stolen from /System/Library/Perl/5.10.0/Term/ANSI... | 20.884956 | 76 | 0.55339 |
f875f4fcf8983d8bc86056d2b8b2d5420e70fb72 | 186 | Puppet::Type.newtype(:mksuser) do
@doc = "Manage an User for the PTC Integrity Server"
ensurable
newparam(:name, :namevar => true) do
desc "The name of the user."
end
end
| 16.909091 | 54 | 0.672043 |
2157181bbc62597cb9b5421133b0db64a888a46d | 905 | require "rails_helper"
describe Releaf::Content::Nodes::ContentFormBuilder, type: :class do
class FormBuilderTestHelper < ActionView::Base
include Releaf::ApplicationHelper
include Releaf::ButtonHelper
include FontAwesome::Rails::IconHelper
def controller_scope_name; end
def generate_url_releaf_c... | 36.2 | 88 | 0.697238 |
4a675625055ad65a8f8634ddd86bd0890853911a | 359 | class PhoneDecorator < ApplicationDecorator
delegate_all
# Define presentation-specific methods here. Helpers are accessed through
# `helpers` (aka `h`). You can override attributes, for example:
#
# def created_at
# helpers.content_tag :span, class: 'time' do
# object.created_at.strftime("%a... | 25.642857 | 75 | 0.671309 |
bb15731bba60cef1aa74a55d23f5d28fbbe6fdef | 333 | # frozen_string_literal: true
module Fog
module Compute
class Hyperv
class Real
def connect_vm_network_adapter(options = {})
requires options, :vm_name, :switch_name
run_shell('Connect-VMNetworkAdapter', options.merge(_skip_json: true)).exitcode.zero?
end
end
e... | 22.2 | 95 | 0.663664 |
5d2805df95d8fa297ac84ac5c137106d9af197a0 | 132 | require "pages_core/configuration/base"
require "pages_core/configuration/pages"
module PagesCore
module Configuration
end
end
| 16.5 | 40 | 0.825758 |
1c973fd5002d38dc149ee2f377279ac5d094bbef | 716 | cask 'hockey' do
version '2.0.16'
sha256 '782b2355341251989b28021d07c28c44ac3d9c388547fc5a06b777bbd4a536d6'
url 'https://rink.hockeyapp.net/api/2/apps/67503a7926431872c4b6c1549f5bd6b1/app_versions/396?format=zip'
appcast 'https://rink.hockeyapp.net/api/2/apps/67503a7926431872c4b6c1549f5bd6b1',
checkp... | 37.684211 | 112 | 0.790503 |
1cda3224f08aeca31c3ccdf077f065b25317e4be | 812 | class Zplug < Formula
desc "The next-generation plugin manager for zsh"
homepage "https://zplug.sh/"
url "https://github.com/zplug/zplug/archive/2.2.3.tar.gz"
sha256 "530b7d1a6be39e54bda8ee8286dc46380154c7f440cff3c9645f25e38bdbe35a"
head "https://github.com/zplug/zplug.git"
bottle :unneeded
depends_on "... | 26.193548 | 83 | 0.682266 |
ed114222344eb47983917ffcb1505478b0a5cfa8 | 113 | class Image
include Her::JsonApi::Model
belongs_to :page
use_api PUB
collection_path "/api/images"
end
| 12.555556 | 31 | 0.734513 |
ab077cea08713b1b3a5e3d3a1472e5e6fc4ad75a | 3,586 | Feedbin::Application.configure do
# Settings specified here will take precedence over those in config/application.rb.
# Code is not reloaded between requests.
config.cache_classes = true
# Eager load code on boot. This eager loads most of Rails and
# your application in memory, allowing both thread web serv... | 38.148936 | 105 | 0.755438 |
180cc0d9de158f5fd00468307e553fbc576c41ef | 1,680 | require 'json'
test_name "CVE 2013-1652 Improper query parameter validation" do
confine :except, :platform => 'windows'
confine :except, :platform => /osx/ # see PUP-4820
confine :except, :platform => /aix/
tag 'audit:high', # risk low, high (security) impact
'audit:integration',
'server'
... | 35.744681 | 102 | 0.584524 |
2117c5ffb4b8ab371074294f4d2306ec6f142d94 | 708 | Pod::Spec.new do |s|
s.name = "CRMotionView"
s.version = "0.2"
s.summary = "A custom photo viewer that implements device motion scrolling, inspired by Facebook Paper."
s.homepage = "https://github.com/chroman/CRMotionView"
s.screenshots = "http://chroman.me/wp-content/uploads/2014/02/m... | 33.714286 | 111 | 0.605932 |
f73d528706a3703211ad789570c018c52769a68c | 165 | require File.expand_path('../../../../../spec_helper', __FILE__)
describe "Resolv::DNS::Message#authority" do
it "needs to be reviewed for spec completeness"
end
| 27.5 | 64 | 0.709091 |
26abb63a7ec300208c9eae0bd05f5ded17c68c6e | 485 | # -*- encoding : utf-8 -*-
class AdminUser < ActiveRecord::Base
# Include default devise modules. Others available are:
# :token_authenticatable, :confirmable,
# :lockable, :timeoutable and :omniauthable
devise :database_authenticatable,
:recoverable, :rememberable, :trackable, :validatable
# Setup... | 37.307692 | 73 | 0.74433 |
87144fc307890710a25a1340d438254f007c712c | 5,691 | #ckwg +28
# Copyright 2015 by Kitware, Inc. All Rights Reserved. Please refer to
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyrig... | 31.269231 | 84 | 0.674925 |
b9e8362df315a107322b326169558fb6cb476f4e | 2,604 | require 'spec_helper'
describe GeoRepositoryUpdateWorker do
include RepoHelpers
let(:user) { create :user }
let(:project) { create :project }
let(:blankrev) { Gitlab::Git::BLANK_SHA }
let(:oldrev) { sample_commit.parent_id }
let(:newrev) { sample_commit.id }
let(:ref) { 'refs/heads/master' }
let(:se... | 26.04 | 94 | 0.670123 |
bb90c1a4c62a7402520ba9d1cc21825305965036 | 4,305 | module ScoutApm
module Instruments
class Mongoid
attr_reader :context
def initialize(context)
@context = context
@installed = false
end
def logger
context.logger
end
def installed?
@installed
end
def install
@installed =... | 32.368421 | 131 | 0.513589 |
5dc56de130ee4b8b899e2afdf9241f25a3b1ef96 | 637 | # frozen_string_literal: true
# Generated via
# `rails generate hyrax:work Dataset`
class DatasetIndexer < Hyrax::WorkIndexer
# This indexes the default metadata. You can remove it if you want to
# provide your own metadata and indexing.
include Hyrax::IndexesBasicMetadata
# Fetch remote labels for based_near... | 31.85 | 77 | 0.756672 |
33c38c501f0cb6b41918c94d49edb2f0569d18c6 | 1,134 | class Bulb < ApplicationRecord
validates :hue, numericality: { only_integer: true,
greater_than_or_equal_to: 0,
less_than: 65536 }
validates :saturation, numericality: { only_integer: true,
greater_than_o... | 34.363636 | 64 | 0.531746 |
1a4ec29021a146175571c3e404a45adfd86c7718 | 1,471 | module DataLoch
class Zipper
BATCH_SIZE = 120000
STAGING_DIRECTORY = Pathname.new Settings.data_loch.staging_directory
def self.zip_courses(term_id)
path = staging_path "courses-#{term_id}.gz"
Zlib::GzipWriter.open(path) do |gz|
courses = EdoOracle::Bulk.get_courses(term_id)
... | 28.843137 | 101 | 0.665534 |
791b1ab46259d3cb5f714d8230c19d2b263baf55 | 2,283 | require 'chefapi'
require 'helpers'
require 'tilt/erubis'
require 'sinatra'
require 'chefservice'
# The Sinatra application
module ChefNetworkViewer
# Sinatra modular application
class App < Sinatra::Base
set :chef_api, ChefNetworkViewer::ChefAPI.new
# set :chefservice, EnvironmentNetwork.new(settings.chef... | 27.178571 | 167 | 0.662724 |
b9ee33b290bb853ae62c225bc02756d6876ab8d2 | 5,764 | ##
# This module requires Metasploit: https://metasploit.com/download
# Current source: https://github.com/rapid7/metasploit-framework
##
class MetasploitModule < Msf::Exploit::Local
Rank = ExcellentRanking
include Msf::Post::File
include Msf::Post::Common
prepend Msf::Exploit::Remote::AutoCheck
def initia... | 30.336842 | 118 | 0.523074 |
e9fd519826f8f05081fe80d6b4b6480d3dbd1d57 | 1,035 | # frozen_string_literal: true
require "rails_helper"
require_relative '../../fabricators/event_fabricator'
describe PostSerializer do
before do
Jobs.run_immediately!
SiteSetting.calendar_enabled = true
SiteSetting.discourse_post_event_enabled = true
end
context 'post has an event' do
let(:user)... | 28.75 | 70 | 0.689855 |
397086bce53d7984180cd8a971177e4658d49e98 | 1,529 | class Cryptol < Formula
desc "Domain-specific language for specifying cryptographic algorithms"
homepage "https://www.cryptol.net/"
url "https://hackage.haskell.org/package/cryptol-2.12.0/cryptol-2.12.0.tar.gz"
sha256 "1746b1ca1fa27d127bbb9f3a50956f1c04e99d2b42a1ddb0347d40dc4d5b058e"
license "BSD-3-Clause"
... | 40.236842 | 121 | 0.742969 |
abecdaa551fec82d7b0fc862aca37bac5f9c81f4 | 9,382 | # frozen_string_literal: true
# Hearing Prep repository.
class HearingRepository
class HearingDayFull < StandardError; end
class << self
def fetch_hearings_for_parent(hearing_day_id)
# Implemented by call the array version of this method
fetch_hearings_for_parents([hearing_day_id]).values.first ||... | 42.261261 | 117 | 0.710509 |
5d9b440e28a6c91d320dc515628b83cdc6776909 | 4,750 | # frozen_string_literal: true
module Valkyrie::Persistence::Fedora
# Represents a node in an ORE List. Used for persisting ordered members into
# an Resource Description Framework (RDF) Graph for Fedora, to keep order maintained.
#
# RDF graph nodes are used to implement a linked list
# An RDF hash URI is ref... | 36.259542 | 124 | 0.665053 |
6afee99685d8cc67738657b7bf724c756f8f0761 | 3,416 | # -*- encoding: utf-8 -*-
require File.expand_path('../../../spec_helper', __FILE__)
require File.expand_path('../fixtures/classes.rb', __FILE__)
describe "String#chop" do
it "removes the final character" do
"abc".chop.should == "ab"
end
it "removes the final carriage return" do
"abc\r".chop.should == "... | 26.48062 | 93 | 0.655738 |
ed077432a69f6bdc2ac28d5680a0b08dfb9973c8 | 217 | module ApplicationHelper
def full_title(page_title = '')
base_title="Ruby on Rails Tutorial Sample App"
if page_title.empty?
base_title
else
page_title + ' | ' + base_title
end
end
end
| 19.727273 | 50 | 0.663594 |
11703d270f8a8eef5d98e8f49076cd14c1d9561e | 69 | json.array! @messagges, partial: "messagges/messagge", as: :messagge
| 34.5 | 68 | 0.753623 |
62d3967f62cb00c9eab327a0d95984420ab3a4f2 | 156 | require File.expand_path('../../../../spec_helper', __FILE__)
describe "OpenSSL::ASN1.Enumerated" do
it "needs to be reviewed for spec completeness"
end
| 26 | 61 | 0.724359 |
0103c05d49c008457585c61122ab88aba3c2e853 | 593 | Pod::Spec.new do |s|
s.name = 'CodePush'
s.version = '1.6.0-beta'
s.summary = 'React Native plugin for the CodePush service'
s.author = 'Microsoft Corporation'
s.license = 'MIT'
s.source = { :git => 'https://github.com/matts310/react-native-code-pu... | 39.533333 | 118 | 0.536256 |
e87fd42ac352c9275835b809a6fd7228263132de | 711 | require './config/environment'
class ApplicationController < Sinatra::Base
configure do
set :public_folder, 'public'
set :views, 'app/views'
enable :sessions
set :session_secret, SESSION_SECRET
end
get "/" do
erb :index
end
get '/home' do
authenticate
erb :home
end
help... | 14.8125 | 53 | 0.614627 |
1d5bf89162df55847c3e698ceddb8de0874d32b2 | 711 | class DataoneCounter < Agent
# include common methods for DataONE
include Dataoneable
def get_query_url(options={})
work = Work.where(id: options.fetch(:work_id, nil)).first
return {} unless work.present? && work.dataone.present?
params = { q: "pid:#{work.dataone_escaped} AND isRepeatVisit:false AND... | 35.55 | 98 | 0.586498 |
ff4d9762baaccc6c7a1748582720bf83c94bca2d | 575 | require File.expand_path(File.dirname(__FILE__) + '/../test_helper')
## Canada
class CATest < Phonie::TestCase
def test_local
parse_test('+1 416 856 3348', '1', '416', '8563348', 'Canada')
end
def test_long_with_default_country_code
Phonie::Phone.default_country_code = '1'
parse_test('9059735100', ... | 27.380952 | 68 | 0.70087 |
01ea6a9b81c3b98c8a493374ea39b0168465a73e | 896 | cask "exodus" do
arch = Hardware::CPU.intel? ? "macos" : "macos-arm64"
version "22.5.10"
if Hardware::CPU.intel?
sha256 "ef526020d128405239bec78e5b1db74e44083efed66127fa5ad27e87f7cb203d"
else
sha256 "655b1b9e48b4e4859c89d999d55bd5a109167667d169046f77531261ce2d1c44"
end
url "https://downloads.exod... | 27.151515 | 77 | 0.706473 |
08dd05bec2540d71edc8c71796358ada520c52ae | 497 | require 'fastlane/plugin/update_entitlements/version'
module Fastlane
module UpdateEntitlements
# Return all .rb files inside the "actions" and "helper" directory
def self.all_classes
Dir[File.expand_path('**/{actions,helper}/*.rb', File.dirname(__FILE__))]
end
end
end
# By default we want to im... | 29.235294 | 79 | 0.760563 |
ff35804163cdb4a5021e5f588a148c671d622a9b | 6,431 | module Solargraph
class YardMap
module CoreFills
Override = Pin::Reference::Override
KEYWORDS = [
'__ENCODING__', '__LINE__', '__FILE__', 'BEGIN', 'END', 'alias', 'and',
'begin', 'break', 'case', 'class', 'def', 'defined?', 'do', 'else',
'elsif', 'end', 'ensure', 'false', 'for... | 31.52451 | 113 | 0.61048 |
5d97034b5875c44d117b6e6a76c309aefa652b17 | 1,581 | module Alchemy
class UserSessionsController < Devise::SessionsController
# Necessary because this controller is also used for general login.
include Ferret::Search
helper 'Alchemy::Admin::Base', 'Alchemy::Pages'
before_filter(except: 'destroy') { enforce_ssl if ssl_required? && !request.ssl? }
be... | 23.25 | 102 | 0.639469 |
620d12e680d7071034d0ff1d4923118dc922162f | 471 | class CreateDocCaptures < ActiveRecord::Migration[5.1]
disable_ddl_transaction!
def change
create_table :doc_captures do |t|
t.integer :user_id, null: false
t.string :request_token, null: false
t.datetime :requested_at, null: false
t.string :acuant_token
t.timestamps
end
a... | 29.4375 | 75 | 0.700637 |
f84703d08058fba04d7fbd6e4a0d54bd5215139c | 3,043 | module UbiquoMedia
module MediaSelector
module Helper
# Helper to build media selectors.
# form => the form object
# field => field name, which has been defined as a media_attachment
# options => can include the following:
# :object_name => to override the form object name
... | 36.22619 | 112 | 0.623727 |
0134a65c688fae115bcb2ba4a2e879d5c0cd4803 | 4,590 | module BigBlueButton
# Helper class to format the response hash received when the BigBlueButtonApi makes API calls
class BigBlueButtonFormatter
attr_accessor :hash
def initialize(hash)
@hash = hash || {}
end
# converts a value in the @hash to boolean
def to_boolean(key)
unless @ha... | 27.987805 | 130 | 0.565359 |
e9cc8d6f94032123d2974548ba6aec8c3d02748d | 656 | require_relative 'boot'
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 SHELF
class Application < Rails::Application
# Initialize configuration defaults for originally generated Rails ver... | 32.8 | 82 | 0.76372 |
213e65b1baede365d8b1f74de0942d0b2ddd0f3a | 867 | #
# To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html
#
Pod::Spec.new do |s|
s.name = 'flt_video_player'
s.version = '0.0.1'
s.summary = 'A Video Player Flutter plugin based on TXVodPlayer'
s.description = <<-DESC
A Video Player Flutter plugin b... | 36.125 | 95 | 0.611303 |
5d8fee46c2c69ae6f9c5a9e91edf50a52b2dab9c | 897 | require 'spec_helper'
require 'yaml'
require 'puppet/provider/vcenter'
require 'rspec/mocks'
require 'fixtures/unit/puppet/provider/vm_vnic/vm_vnic_fixture'
describe "Create vm_snapshot behavior testing" do
before(:each) do
@fixture = Vm_vnic_fixture.new
end
context "when vm_vnic provider is created " do
... | 28.935484 | 73 | 0.731327 |
91626441effe200ae831c5f7366d0c62d2b6aac4 | 1,271 | require 'spec_helper'
describe ModuleShims::Switch do
before do
module FakeModule
def target
'fake_module'
end
end
class FakeClass
include FakeModule
def target
'fake_class'
end
end
module Mine
module FakeClass
extend ModuleShims::Swit... | 22.298246 | 66 | 0.667978 |
33a67e913f789653f555787a5d15353ce4bff904 | 1,416 | # -*- coding: utf-8 -*- #
# frozen_string_literal: true
describe Rouge::Lexers::Markdown do
let(:subject) { Rouge::Lexers::Markdown.new }
describe 'guessing' do
include Support::Guessing
it 'guesses by filename' do
assert_guess :filename => 'foo.md'
assert_guess :filename => 'foo.mkd'
a... | 29.5 | 99 | 0.642655 |
e9c6ae2ca15c69b489ba81238d583ce5a9d386ba | 900 | class MoveThemePath < ActiveRecord::Migration
def self.up
base_path = Pathname.new(File.join(RAILS_ROOT, 'themes'))
Site.find(:all).each do |site|
site_path = base_path + "site-#{site.id}"
new_path = site_path + 'current'
FileUtils.mkdir_p(new_path)
%w(templates layouts javascripts st... | 32.142857 | 72 | 0.651111 |
ac5d9d8860cfaf3fbc510926b7c3c0a02b206874 | 690 | # -------------------------------------------------------------
# Valid phone
# -------------------------------------------------------------
class PhoneValidator < ActiveModel::EachValidator
MIN_PHONE_LENGTH = 8
MAX_PHONE_LENGTH = 12
def validate_each(record, attribute, value)
unless value =~ /\A(\d)*\z/i
... | 30 | 90 | 0.552174 |
3376c3b63498c6cc6eeadf86a67cb72d1218c856 | 1,777 | # frozen_string_literal: true
require 'rails_helper'
describe Tracking do
let(:tracking_attributes) { attributes_for(:tracking) }
context 'with valid attributes' do
subject { described_class.new(tracking_attributes) }
it 'has attributes' do
expect(subject).to have_attributes(prescription_name: 'Dr... | 35.54 | 115 | 0.646595 |
e9b5722dc26f9eb926e3ef7a461ed2e770606b96 | 137 | class AddCaseConcludedAtToClaims < ActiveRecord::Migration[4.2]
def change
add_column :claims, :case_concluded_at, :date
end
end
| 22.833333 | 63 | 0.773723 |
ffca3a7d68f0ff707d7e313d6b1acb44b5b98d71 | 496 | # Be sure to restart your server when you modify this file.
# Your secret key for verifying the integrity of signed cookies.
# If you change this key, all old signed cookies will become invalid!
# Make sure the secret is at least 30 characters and all random,
# no regular words or you'll be exposed to dictionary attac... | 62 | 171 | 0.832661 |
e9f8ed277a5445bbfdfecd653e005c15b968b1da | 4,459 | require 'spec_helper'
require 'html/pipeline'
module Gitlab::Markdown
describe LabelReferenceFilter do
include FilterSpecHelper
let(:project) { create(:empty_project) }
let(:label) { create(:label, project: project) }
let(:reference) { label.to_reference }
it 'requires project context' do... | 33.276119 | 111 | 0.613815 |
38faf01077f12c5d2382855cc673943fb773b9ee | 41 | module WebexApi
VERSION = "0.4.12"
end
| 10.25 | 20 | 0.682927 |
1a7cc7f5e511d638d575202344e3a8ec7ac9eda4 | 51 | json.array! @sties, partial: "sties/sty", as: :sty
| 25.5 | 50 | 0.666667 |
186811d37d04d8e15d11db332952be9fb448dbba | 11,572 | #
# tk/optiondb.rb : treat option database
#
require 'tk'
module TkOptionDB
include Tk
extend Tk
TkCommandNames = ['option'.freeze].freeze
(CmdClassID = ['CMD_CLASS'.freeze, '00000'.taint]).instance_eval{
@mutex = Mutex.new
def mutex; @mutex; end
freeze
}
module Priority
WidgetDefault = 2... | 30.613757 | 79 | 0.614673 |
0103c03273892ba947bb2079aa701c84270cff7e | 3,629 | # frozen_string_literal: true
require 'spec_helper'
RSpec.describe Admin::Geo::NodesController do
shared_examples 'unlicensed geo action' do
it 'redirects to the 403 page' do
expect(response).to have_gitlab_http_status(:forbidden)
end
end
let(:user) { create(:user) }
let(:admin) { create(:admin)... | 25.027586 | 116 | 0.640397 |
0897326ca2e19dd80cf8f81528c08836fe775656 | 2,824 | require 'spec_helper'
describe Capybara do
describe '.string' do
let :string do
Capybara.string <<-STRING
<div id="page">
<div id="content">
<h1 data="fantastic">Totally awesome</h1>
<p>Yes it is</p>
</div>
<div id="footer" style="display: none... | 31.377778 | 83 | 0.602337 |
39a6119a9214e4f5fbba2147ba33d1b260116150 | 612 | #config/initializers/database_connection.rb
Rails.application.config.after_initialize do
ActiveRecord::Base.connection_pool.disconnect!
ActiveSupport.on_load(:active_record) do
config = ActiveRecord::Base.configurations[Rails.env] ||
Rails.application.config.database_configuration[Rails.env]
config... | 47.076923 | 89 | 0.738562 |
7a565d2b8085bfc77cab49883601fe45d8d61484 | 5,289 | # Copyright (c) 2016, 2021, Oracle and/or its affiliates. All rights reserved.
# This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either lic... | 35.02649 | 245 | 0.675931 |
621cdc63c8ef9c4520160ca9c8f37b8d0ce5501a | 1,948 | cask 'skype' do
version '8.34.0.78'
sha256 '814b60d85381d4a6332944cdf5f67f0e067b01843821989e685e53b49e6edf80'
# endpoint920510.azureedge.net/s4l/s4l/download/mac was verified as official when first introduced to the cask
url "https://endpoint920510.azureedge.net/s4l/s4l/download/mac/Skype-#{version}.dmg"
app... | 51.263158 | 147 | 0.649897 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.