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 |
|---|---|---|---|---|---|
019e3fc84506c562c0b6b02ce592760383abcb5b | 3,027 | require_relative 'matlab_clone/version'
module MatlabClone
require_relative 'matlabclone_class'
require 'colorize'
include Hassan
test = MatLabclone.new
puts '...........................................................'.yellow
puts '| |'.yellow
puts '| Welcome t... | 32.202128 | 80 | 0.6148 |
21bd1856c46b4a25026096ee0754d62d9efa2825 | 532 | class IqQueryStanza
def initialize(params = {})
@doc = Nokogiri::XML::Document.new
@iq = Nokogiri::XML::Node.new("iq", @doc)
@iq["type"] = params[:type].to_s
@iq["to"] = Superfeedr.conf[:superfeedr_jid]
@iq["id"] = "#{random_iq_id}"
@iq["from"] = params[:from] if params[:from]
end
d... | 14.777778 | 48 | 0.539474 |
7a688530917e1a54f57cc9807c592c72c5b12bbb | 1,114 | class KitchenSync < Formula
desc "Fast efficiently sync database without dumping & reloading"
homepage "https://github.com/willbryant/kitchen_sync"
url "https://github.com/willbryant/kitchen_sync/archive/0.38.tar.gz"
sha256 "786bf30caca4e58347c0880dc1ca54685cd01d0834024c425029fb5466c96041"
head "https://githu... | 32.764706 | 95 | 0.750449 |
d58d43b83aeada05d70b818b5039e8794dbdf91f | 146 | # This is an example of a good cronotab for tests
class TestJob
def perform
puts 'Test!'
end
end
Crono.perform(TestJob).every 5.seconds
| 14.6 | 49 | 0.726027 |
fff5864b2b6b38fb8767fd9fe40639c9dfd20117 | 156 | # encoding: utf-8
BUILD_INFO = {"build_date"=>"2016-12-06T13:17:53+00:00", "build_sha"=>"aa36c4f4b702c6d379e5a97c22627933bca04f68", "build_snapshot"=>false} | 78 | 138 | 0.762821 |
26da3a5dfbc159719fdc62b2296f2881a4266766 | 1,865 | require 'logger'
require 'logstash-event'
module LogStasher
class << self
attr_reader :append_fields_callback
attr_writer :enabled
attr_writer :include_parameters
attr_writer :serialize_parameters
attr_writer :silence_standard_logging
attr_accessor :metadata
def append_fields(&block)
... | 22.743902 | 89 | 0.639142 |
6a76d80c47b0fd59dc8446ce7e6766ff25145d38 | 7,442 | require 'concurrent/map'
require 'active_support/core_ext/module/remove_method'
require 'active_support/core_ext/module/attribute_accessors'
require 'action_view/template/resolver'
module ActionView
# = Action View Lookup Context
#
# <tt>LookupContext</tt> is the object responsible for holding all information
... | 31.268908 | 109 | 0.639076 |
332944d11b7251f93929479e69ec6d60059004c8 | 2,960 | # 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::V2019_12_01
module Models
#
# Rewrite rule of an application gateway.
#
class ApplicationGatewayRewriteRule
... | 31.489362 | 91 | 0.528716 |
bf75e4fcafd6ee0b1bc1036d7f4d6dbb98aad1c6 | 1,989 | #
# Copyright (c) 2014 Constant Contact
#
# 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 without limitation the rights
# to use, copy, modify, merge, publish, ... | 36.163636 | 79 | 0.703369 |
26bdabfbac898051f6f2bbe5602e5e5e86217997 | 12,980 | # frozen_string_literal: true
require 'test_helper'
# was the web request successful?
# was the user redirected to the right page?
# was the user successfully authenticated?
# was the correct object stored in the response?
# was the appropriate message delivered in the json payload?
class OmniauthTest < ActionDi... | 29.366516 | 109 | 0.631279 |
79e5a028ed33e36596bf5daaf29e3554403f0b1e | 2,481 | #
# = strrand.rb: Generates a random string from a pattern
#
# Author:: tama <repeatedly@gmail.com>
#
# (Stripped down to only relevant methods)
class StringRandom
Upper = Array('A'..'Z')
Lower = Array('a'..'z')
Digit = Array('0'..'9')
Punct = [33..47, 58..64, 91..96, 123..126].map { |r| r.map { |val| val.c... | 22.351351 | 89 | 0.516727 |
331e4470238f68eb8132fee1f4819c33c37669d5 | 4,534 | require 'rails/generators/resource_helpers'
module Butler
class AdminScaffoldGenerator < Rails::Generators::NamedBase
include Rails::Generators::ResourceHelpers
source_root File.expand_path('../templates', __FILE__)
class_option :orm, banner: 'NAME', type: :string, required: true
class_option :pref... | 32.618705 | 161 | 0.685487 |
bb80506312db8bc67fab951dd534452ff06daf18 | 1,397 | #!/usr/bin/env ruby
# https://adventofcode.com/2020/day/10
# Run with: 'ruby solve10.rb'
# using Ruby 2.5.1
# by Zack Sargent
INPUTS = File.readlines("input10.txt").map(&:chomp)
GET_OPENER = {
')' => '(',
']' => '[',
'}' => '{',
'>' => '<',
}
GET_CLOSER = GET_OPENER.to_a.map(&:reverse).to_h
POINT_VALUE_1 = ... | 18.878378 | 72 | 0.609878 |
6a35f24835f545793fdf1b3800e44f9cbfb71501 | 42 | ActsAsTaggableOn.strict_case_match = true
| 21 | 41 | 0.880952 |
790abd6296163544a0bb02cbf047a0b0902c68dc | 43 | module TacoTuesday
VERSION = "0.2.0"
end
| 10.75 | 19 | 0.697674 |
ffbf038c93945dc1647676a9c886c6ebded3cf09 | 1,993 | # frozen_string_literal: true
describe Facter::Resolvers::Kernel do
before do
ver_ptr = double('FFI::MemoryPointer')
ver = double('OsVersionInfoEx', size: nil)
allow(FFI::MemoryPointer).to receive(:new).with(OsVersionInfoEx.size).and_return(ver_ptr)
allow(OsVersionInfoEx).to receive(:new).with(ver_p... | 32.145161 | 104 | 0.685901 |
613fc99e054f1db9a256a76bfb2aef48b8e769f1 | 173 | Embulk::JavaPlugin.register_input(
"salesforce_bulk", "org.embulk.input.salesforce_bulk.SalesforceBulkInputPlugin",
File.expand_path('../../../../classpath', __FILE__))
| 43.25 | 82 | 0.757225 |
1dd8e085e7c9559eebd5c2bfcb7f92e17b11adb8 | 653 | class GetFieldTreeListTransaction < Cortex::ApplicationTransaction
step :init
step :process
def init(input)
field = Field.find_by_id(input[:args]['field_id'])
field ? Success({ content_item: input[:content_item], field: field }) : Failure(:not_found)
end
def process(input)
tree_array = input[:f... | 34.368421 | 125 | 0.699847 |
1c48196762c35d4ed8d171163dea5d8e3f7e9848 | 16,675 | module ActiveRecord
# See ActiveRecord::Transactions::ClassMethods for documentation.
module Transactions
extend ActiveSupport::Concern
#:nodoc:
ACTIONS = [:create, :destroy, :update]
included do
define_callbacks :commit, :rollback,
scope: [:kind, :name]
end
# ... | 41.071429 | 165 | 0.678081 |
7a2dc24d1b35ce1f2aa00bdcf089474468e3dea8 | 701 | require 'test_helper'
require 'vertex_array_expression_tests'
require 'test_adapter'
class NamedTest < Test
include VertexArrayExpressionTests
def setup
RPath.use TestAdapter.new
end
def vertex_array_expression
RPath::Named.new(RPath::Adjacent.new(RPath::Root.new), 'foo')
end
def test_eval_retur... | 25.035714 | 69 | 0.707561 |
018aa4fd1c680cec07bdd7fe376ed63bfdaf39a6 | 319 | class CreateExecutingCommands < ActiveRecord::Migration
def change
create_table :redmine_chat_telegram_executing_commands do |t|
t.integer :account_id
t.string :name
t.integer :step_number
t.text :data
end
add_index :redmine_chat_telegram_executing_commands, :account_id
end
end
| 26.583333 | 68 | 0.746082 |
ed5cde21ea33668c60351a79c474b31aca387e83 | 4,393 | require_relative '../global/dice'
require_relative '../global/weapon'
require_relative '../global/intro'
require 'yaml'
class Global
include Dice
include Intro
attr_accessor :main_stat
attr_accessor :main_stat_modify
attr_accessor :size
attr_accessor :speed
attr_accessor :languages
attr_accessor :visi... | 27.803797 | 187 | 0.638288 |
1c22369d0d78a1c5b9be2db8b261e1c5622ee5e7 | 1,539 | class Notcurses < Formula
desc "Blingful character graphics/TUI library"
homepage "https://nick-black.com/dankwiki/index.php/Notcurses"
url "https://github.com/dankamongmen/notcurses/archive/refs/tags/v2.3.15.tar.gz"
sha256 "146e83723e5f5c486b9f16ec11b70ad682e76b6d01f10e4d9c27d07f3de72811"
license "Apache-2.... | 37.536585 | 95 | 0.736842 |
3945b537d0fbe171fbfef5232914fe986b156b42 | 1,223 | class Duti < Formula
desc "Select default apps for documents and URL schemes on macOS"
homepage "https://github.com/moretension/duti/"
url "https://github.com/moretension/duti/archive/duti-1.5.4.tar.gz"
sha256 "3f8f599899a0c3b85549190417e4433502f97e332ce96cd8fa95c0a9adbe56de"
head "https://github.com/moretens... | 34.942857 | 93 | 0.751431 |
01dddb76414b19895ed4a186cfee4bc3bfde980a | 176 | class AdminController < ApplicationController
def dashboard
end
def sales
end
def visitors
end
def orders
@orders_roasted
@orders_delivered
end
end
| 11 | 45 | 0.715909 |
b9f8687f25d7b9064261c91c6c6780615f8083e9 | 4,348 | # frozen_string_literal: true
require "rom/schema"
require "rom/attribute"
require_relative "core"
module ROM
module Components
module DSL
# @private
class Schema < Core
key :schemas
option :attributes, default: -> { EMPTY_HASH.dup }
# Defines a relation attribute with its... | 28.794702 | 92 | 0.557498 |
1a04e7f546d41ff73a8b8e6973bf48a89ae0a7eb | 738 | class SessionsController < ApplicationController
def new
end
def create
@user = User.find_by(email: params[:session][:email].downcase)
if @user && @user.authenticate(params[:session][:password])
if @user.activated?
log_in @user
params[:session][:remember_me] == "1"?remember(@user):f... | 25.448276 | 75 | 0.639566 |
21f920c6865618816eee5dd3c4a0e89875f37c3e | 930 | # -*- encoding: utf-8 -*-
$:.push File.expand_path("../lib", __FILE__)
require "devise_castle/version"
Gem::Specification.new do |s|
s.name = 'devise_castle'
s.version = DeviseCastle::VERSION.dup
s.platform = Gem::Platform::RUBY
s.email = 'johan@castle.io'
s.homepage = 'https://github.com/castle/devise_... | 35.769231 | 177 | 0.688172 |
1afdddc6bd45eab19a5e51ca342525c88600cefc | 161 | require 'singleton'
class Logger
include Singleton
def initialize
@f = File.open 'log.txt', 'a'
end
def log_something wat
@f.puts wat
end
end | 13.416667 | 33 | 0.670807 |
d5876d9dd0a4d058f12e3d58dd1bf903a3783189 | 57,457 | require "test_helper"
class RBS::DefinitionBuilderTest < Test::Unit::TestCase
include TestHelper
AST = RBS::AST
Environment = RBS::Environment
EnvironmentLoader = RBS::EnvironmentLoader
Declarations = RBS::AST::Declarations
TypeName = RBS::TypeName
Namespace = RBS::Namespace
DefinitionBuilder = RBS::D... | 29.450026 | 130 | 0.63571 |
ffcc03620b010ff4109d30c5ec50a388183364ff | 921 | Pod::Spec.new do |s|
s.name = "CWUtils"
s.version = "0.15.2"
s.summary = "iOS 어플리케이션 개발용 유틸리티 모음"
s.description = "RxSwift 를 기반으로 하고 있음. (Dependancy : RxSwift, RxCocoa, RxOptional)"
s.homepage = "https://github.com/iamchiwon/CWUtils"
s.license = { :type => "MIT", :file => "LICEN... | 29.709677 | 97 | 0.617807 |
d5c0d8a5632b3ce8958c5a38b77feeacf0555249 | 143 | class AddSentColumnToApproval < ActiveRecord::Migration[5.0]
def change
add_column :approvals, :sent, :boolean, default: false
end
end
| 23.833333 | 60 | 0.755245 |
d50ae3140ae18caa4183a3adafe00fb24344a704 | 164 | default["pimon"]["listen_interface"] = "0.0.0.0"
default["pimon"]["port"] = 80
default["pimon"]["number_of_stats"] = 6
default["pimon"]["time_period_in_secs"] = 30
| 32.8 | 48 | 0.676829 |
e81db24d7cb2a750a86cd8279462b4eafbb45122 | 1,496 | module Formtastic
module Inputs
# Outputs a simple `<label>` with a `<textarea>` wrapped in the standard
# `<li>` wrapper. This is the default input choice for database columns of the `:text` type,
# but can forced on any text-like input with `:as => :text`.
#
# @example Full form context and out... | 28.769231 | 116 | 0.548797 |
e27340979c3adc733b5375cc4c653d11b997ea68 | 135 | class AddAuthorIdToSquirrelPosts < ActiveRecord::Migration
def change
add_column :squirrel_posts, :author_id, :integer
end
end
| 22.5 | 58 | 0.792593 |
e9578d0625c55ebcd4622e1d93088b6f50b78632 | 3,910 | module ApplicationController::Timelines
SELECT_EVENT_TYPE = [[N_('Management Events'), 'timeline'], [N_('Policy Events'), 'policy_timeline']].freeze
DateOptions = Struct.new(
:end_date,
:days,
:end,
:start,
:typ
) do
def update_from_params(params)
self.typ = params[:tl_typ] if param... | 25.225806 | 110 | 0.598721 |
e2d2e0fbc3bdc9ef90fcba3c59a717c0df6849a2 | 120 | class AuthorsController < ApplicationController
def index
end
def show
@author = Author.find(params[:id])
end
end | 15 | 47 | 0.758333 |
6a2c751f2e24d0dd7dfa6343fa512854a474f86f | 1,148 | require_relative "./../../test_helper"
require_relative "./../../helpers/with_server"
require "test/unit"
require "json"
require "bibliotheca-client/client"
class TestOperations < Test::Unit::TestCase
extend WithServer
setup do
@auth_header = Bibliotheca::Client.class_variable_get(:@@auth_header)
Biblio... | 20.872727 | 77 | 0.632404 |
abc019cb6abf13baf1a1b84a88df40e672c5932f | 667 | cask "alt-tab" do
version "4.18.0"
sha256 "c04e2c68c5ffcaa5ad5a637499e2cff998f035926032dc6e1ce17a9ac6589bd4"
url "https://github.com/lwouis/alt-tab-macos/releases/download/v#{version}/AltTab-#{version}.zip"
appcast "https://github.com/lwouis/alt-tab-macos/releases.atom"
name "alt-tab"
homepage "https://git... | 29 | 99 | 0.722639 |
e2d9d290ec73dec3a3a6e23fc76c81846f40f841 | 12,873 | # == Schema Information
#
# Table name: transactions
#
# id :integer not null, primary key
# starter_id :string(255) not null
# starter_uuid :binary(16) not null
# listing_id :integer not n... | 37.313043 | 164 | 0.681271 |
ab579318d4b728a754b6ca32479703ea78e06a62 | 16,572 | # frozen_string_literal: true
require 'spec_helper'
describe 'php', type: :class do
on_supported_os.each do |os, facts|
context "on #{os}" do
let :facts do
facts
end
php_cli_package = case facts[:os]['name']
when 'Debian'
case facts[:o... | 42.821705 | 163 | 0.493483 |
79052c0de706c0fab8d6b42fb7153fee11107433 | 1,416 | # coding: utf-8
lib = File.expand_path('../lib', __FILE__)
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
require 'cancannible/version'
Gem::Specification.new do |spec|
spec.name = "cancannible"
spec.version = Cancannible::VERSION
spec.authors = ["Paul Gallagher"]
spec.email ... | 40.457143 | 141 | 0.711864 |
bb8c447bdbf3c596017570cdd7112e31350b8e99 | 747 | Pod::Spec.new do |s|
s.name = "Annotated"
s.version = "0.1.0"
s.summary = "Easy String Annotation"
s.description = <<-DESC
Annotate your Strings, render them in NSAttributedString or Text
DESC
s.homepage = "https://github.com/jegnux/Annotated"
s.license = { :type => "MIT", ... | 37.35 | 96 | 0.606426 |
1c0d33511fdcf90401c7c9fed8d59382c080e9ba | 4,133 | describe 'create latest matrix (latest pact revision/latest verification for provider version)', migration: true do
before do
PactBroker::Database.migrate(50)
end
def shorten_row row
"#{row[:consumer_name]}#{row[:consumer_version_number]} #{row[:provider_name]}#{row[:provider_version_number] || '?'} (r#{... | 36.254386 | 192 | 0.664408 |
33ec5eeffaf5536140cb8517c1c911de88076c99 | 1,139 | #
# Be sure to run `pod lib lint LanguageManger-iOS.podspec' to ensure this is a
# valid spec before submitting.
#
# Any lines starting with a # are optional, but their use is encouraged
# To learn more about a Podspec see https://guides.cocoapods.org/syntax/podspec.html
#
Pod::Spec.new do |s|
s.name = '... | 36.741935 | 115 | 0.646181 |
ed047beda4e3639075905a969f7defd106184cbc | 861 | require 'test_helper'
class TestStore
def initialize
@test_hash = {}
end
def write(uid, value)
@test_hash[uid] = value
end
def read(uid)
@test_hash[uid]
end
end
class ConfigurationTest < Minitest::Test
def test_configuration_defaults
assert_nil ActiveWaiter.configuration.layout
end
... | 19.568182 | 73 | 0.722416 |
015331461276f490c6a05e9cfaf7e169b65c4916 | 563 | class CreateServices < ActiveRecord::Migration
def change
create_table :services do |t|
t.belongs_to :location
t.text :audience
t.text :description
t.text :eligibility
t.text :fees
t.text :how_to_apply
t.text :name
t.text :short_desc
t.text :urls
t.text ... | 23.458333 | 53 | 0.634103 |
bfad98515764cbe64ed41ec89a30a232c21ca1b8 | 560 | require 'jump_back/options_parser'
module JumpBack
module Redirection
def save_referer
session[:jump_back_stored_referer] ||= request.referer
end
def return_to_referer(path=root_path, options={})
options = OptionsParser.new(path: path, options: options, default: root_path)
se... | 28 | 149 | 0.7375 |
5dbcb491d7902f31240060b45d5b148ea9a85252 | 60 | class Instrument < ApplicationRecord
belongs_to :user
end
| 15 | 36 | 0.816667 |
39581cf27c9cb54147ac578f5ed98d0ac63a0b4e | 1,789 | # 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::Cosmosdb::Mgmt::V2021_01_15
module Models
#
# The read-only access keys for the given database account.
#
class DatabaseAcco... | 29.816667 | 78 | 0.580212 |
e99d787f21038e0f33b7e27559ef8fe3a3a3efa3 | 6,245 | module ActiveMerchant #:nodoc:
module Billing #:nodoc:
class PayboxDirectGateway < Gateway
class_attribute :live_url_backup
self.test_url = 'https://preprod-ppps.paybox.com/PPPS.php'
self.live_url = 'https://ppps.paybox.com/PPPS.php'
self.live_url_backup = 'https://ppps1.paybox.com/PP... | 31.225 | 114 | 0.584628 |
28e1fce2b67a58f0322b5487e233fbd29ed79a08 | 4,265 | #--
# This file is part of the X12Parser library that provides tools to
# manipulate X12 messages using Ruby native syntax.
#
# http://x12parser.rubyforge.org
#
# Copyright (C) 2012 P&D Technical Solutions, LLC.
#
# This library is free software; you can redistribute it and/or
# modify it ... | 33.320313 | 309 | 0.67034 |
91628ccfba7216fcb37dd89303cee268a29b622b | 2,904 | require "spec_helper"
require "httpi/auth/config"
describe HTTPI::Auth::Config do
let(:auth) { HTTPI::Auth::Config.new }
describe "#basic" do
it "lets you specify the basic auth credentials" do
auth.basic "username", "password"
auth.basic.should == ["username", "password"]
end
it "also... | 24.610169 | 61 | 0.642218 |
7a7b4453609264de5d6be82a3756cf78118d388f | 2,226 | # frozen_string_literal: true
module Hyrax
##
# Provides tools for interpreting form input as a visibility.
#
# @since 3.0.0
class VisibilityIntention
PUBLIC = Hydra::AccessControls::AccessRight::VISIBILITY_TEXT_VALUE_PUBLIC
PRIVATE = Hydra::AccessControls::AccessRight::VISIBILITY_TEX... | 28.177215 | 87 | 0.651393 |
386238a8478c5faa977f498f3077ced9c6cd5ee3 | 2,005 | module SSHKit
module Sudo
module Backend
module Netssh
private
def execute_command!(cmd)
output.log_command_start(cmd)
cmd.started = true
exit_status = nil
with_ssh do |ssh|
ssh.open_channel do |chan|
chan.request_pty
... | 34.568966 | 80 | 0.487781 |
26682621735bca53955fb317967f7d0059ede7c7 | 3,971 | require 'raindrops'
require 'cdo/aws/metrics'
require 'honeybadger'
require 'concurrent/timer_task'
module Cdo
# UnicornListener extends the Raindrops::Middleware class,
# which instruments a Rack application to collect the number of
# currently-executing requests using an atomic counter shared across
# all Un... | 38.182692 | 112 | 0.679174 |
7a5663cfd744f931e9007c3964fc0bd46de6aea8 | 1,053 | class Highlight < Formula
desc "Convert source code to formatted text with syntax highlighting"
homepage "http://www.andre-simon.de/doku/highlight/en/highlight.html"
url "http://www.andre-simon.de/zip/highlight-3.33.tar.bz2"
sha256 "64b530354feccabc3e8eeec02a0341be0625509db1fa5dd201c4d07e4d845c3c"
head "svn:/... | 37.607143 | 92 | 0.756885 |
b94d3beb76cdeda9639f8a45ae575e08343f532f | 678 | cask 'termius-beta' do
version '5.12.0'
sha256 '629060c853ef4ffab88098f2bf3fbeb0e5b9ee55b659ce278d300a4267860c72'
url 'https://www.termius.com/beta/download/mac/Termius+Beta.dmg'
name 'Termius Beta'
homepage 'https://www.termius.com/beta-program'
app 'Termius Beta.app'
zap trash: [
'~/.t... | 33.9 | 83 | 0.640118 |
f83186e13b3d91ef62299b499b962306d975208e | 356 | require 'contentful/management'
require 'contentful_migrations/utils'
require 'contentful_migrations/version'
require 'contentful_migrations/migration_content_type'
require 'contentful_migrations/migration_proxy'
require 'contentful_migrations/migration'
require 'contentful_migrations/migrator'
load 'tasks/contentful_... | 35.6 | 58 | 0.867978 |
d53556b086604e3e249453af0da0cea5dd0429ff | 219 | # frozen_string_literal: true
require_relative "spec_helper"
require_relative "../lib/my_module"
describe MyModule do
it "extends with OpencBot methods" do
described_class.should respond_to :save_data
end
end
| 19.909091 | 48 | 0.794521 |
f849830b99d147f80c05724f4a8e81b695e71a48 | 4,795 | # -*- coding: binary -*-
module Rex
module Proto
module Kerberos
module Model
# This class provides a representation of an Authenticator, sent with a
# ticket to the server to certify the client's knowledge of the encryption
# key in the ticket.
class Authenticator < Element... | 33.531469 | 106 | 0.559958 |
e9a5888e093a07e977e3b08aa7e02cee5e55b312 | 93 | collection roles
attributes :id, :name, :color, :billable, :technical, :show_in_team, :admin
| 31 | 75 | 0.752688 |
0818c6f7c07e58b5e5ef7e0bf936346f45c16676 | 1,779 | Pod::Spec.new do |s|
s.name = "CocoaExtension"
s.version = "2.1.0"
s.summary = "Foundation/UIKit extension kit. It is category based and looks familiar to Foundation/UIKit. It includes many common snippets as shortcut."
s.description = <<-DESC
This library includes small F... | 48.081081 | 198 | 0.659921 |
91f593b5a58586237ea41632b6a62aa94e2f80d3 | 1,628 | # frozen_string_literal: true
require 'spec_helper'
RSpec.describe Rumale::NeuralNetwork::MLPRegressor do
let(:x) { two_clusters_dataset[0] }
let(:single_target) { x[true, 0] + x[true, 1]**2 }
let(:multi_target) { Numo::DFloat[x[true, 0].to_a, (x[true, 1]**2).to_a].transpose.dot(Numo::DFloat[[0.6, 0.4], [0.8, 0... | 33.22449 | 128 | 0.679975 |
61ac78d29996c449fd4eeb0f48a14a8d12a6b70f | 1,178 | # This file is auto-generated from the current state of the database. Instead
# of editing this file, please use the migrations feature of Active Record to
# incrementally modify your database, and then regenerate this schema definition.
#
# This file is the source Rails uses to define your schema when running `rails
#... | 40.62069 | 86 | 0.750424 |
f87e1949005bfe7a33fbdecba981f9984e4ad93b | 170 | class ChangeProxyDepositRequestPidToGenericFileId < ActiveRecord::Migration[4.2]
def change
rename_column :proxy_deposit_requests, :pid, :generic_file_id
end
end
| 28.333333 | 80 | 0.817647 |
33dd59e65f18569042231a35e04265d29afd3b34 | 3,832 | module Togodb
class DatabaseList
class DataTables < Togodb::DataTables
include ActionView::Helpers::NumberHelper
include Togodb::Management
class << self
def columns
[
{
name: 'name',
label: 'Name',
method: 'n... | 26.427586 | 179 | 0.471033 |
089066dd2010bd834c584da79fe604d3929bb256 | 662 | require 'spec_helper'
require 'cfn-model'
require 'cfn-nag/custom_rules/ElasticLoadBalancerAccessLoggingRule'
describe ElasticLoadBalancerAccessLoggingRule do
context 'two load balancers without access logging enabled' do
it 'returns offending logical resource id' do
cfn_model = CfnParser.new.parse read_te... | 38.941176 | 138 | 0.824773 |
bff6defc24165635f5f1361739bd99cfe3cb7945 | 969 | require 'minitest/autorun'
require_relative '../libtoc.rb'
class LibTocTest < MiniTest::Unit::TestCase
def test_basic
options = {}
options[:bullets] = true
toc = md_to_toc( File.read(__dir__ + '/test.md'), options )
assert toc.include?("* Top-level topic (Heading 2)")
ass... | 26.916667 | 73 | 0.607843 |
d593618fc0ae0aa862731d1176c56a8616702f4b | 1,492 | class Backupmyapp
class Transfer
MAX_RETRY_ATTEMPTS = 4
def initialize(config, server)
@connection = Net::SCP.start(config[:domain], config[:user], :password => config[:password])
@failed_downloads = @failed_uploads = Array.new
@server = server
end
def upload(file)
puts... | 28.150943 | 98 | 0.616622 |
283f5f13e824d9f7a2a169d4416ad7543ea8710b | 243 | class CreatePosts < ActiveRecord::Migration[5.1]
def change
create_table :posts do |t|
t.string :title
t.text :body
t.attachment :photo
t.references :user, foriegn_key: true
t.timestamps
end
end
end
| 17.357143 | 48 | 0.63786 |
18192e24d7bf79547c94e18a61e5d7786799b5a3 | 2,370 | class ApplicationHelper::Toolbar::MiqAeDomainCenter < ApplicationHelper::Toolbar::Basic
button_group('miq_ae_domain_vmdb', [
select(
:miq_ae_domain_vmdb_choice,
'fa fa-cog fa-lg',
t = N_('Configuration'),
t,
:items => [
button(
:miq_ae_domain_edit,
'pficon... | 33.857143 | 87 | 0.537975 |
f733440b461c8ecfc1d014152f73bd0d6e81dc2e | 5,190 | # SOAP4R - XML Literal EncodingStyle handler library
# Copyright (C) 2001, 2003-2005 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
# This program is copyrighted free software by NAKAMURA, Hiroshi. You can
# redistribute it and/or modify it under the same terms of Ruby's license;
# either the dual license version in 2003, ... | 22.863436 | 74 | 0.649518 |
d5eb4abe7e43177157fdf0a32235cdb67d5464c6 | 286 | # frozen_string_literal: true
class TestChannel < ApplicationCable::Channel # :nodoc:
periodically :refresh, every: 1.second
def subscribed
@bad_var = 'bad'
stream_from 'all' do |msg|
transmit msg
end
end
def follow
@another_var = 'not_good'
end
end
| 15.888889 | 55 | 0.674825 |
7910aad128eb8d1532366af1cbe317876cc2936e | 542 | module HasHierarchy
module OrmAdapter
module Mongoid
def ancestors
tree_scope.where(path_part_column.in => path_parts)
end
def siblings
tree_scope.where(:parent_id => parent_id, :id.ne => id)
end
def subtree
tree_scope.or({ id: id }, descendants_conditions)
... | 19.357143 | 63 | 0.621771 |
28ae846adabec494f832d4e3904499bab27aeade | 804 | require File.dirname(__FILE__) + '/spec_helper'
describe Exceptional do
describe "with no configuration" do
before(:each) do
Exceptional.stub!(:to_stderr) # Don't print error when testing
end
it "should raise a remoting exception if not authenticated" do
exception_data = mock(Exceptional::Ex... | 36.545455 | 123 | 0.707711 |
910800307a83a22bbbee28bc0d0462ee872a69f3 | 146 | class CreateCalendars < ActiveRecord::Migration
def change
create_table :calendars do |t|
t.timestamps null: false
end
end
end
| 16.222222 | 47 | 0.705479 |
bf99422083e899bad0226e43144f7a91eb7a7b4e | 13,335 | # frozen_string_literal: true
module Sapience
# rubocop:disable ClassLength
class Base
# Class name to be logged
attr_accessor :name, :filter, :log_hooks
include Sapience::LogMethods
# Set the logging level for this logger
#
# Note: This level is only for this particular instance. It does n... | 34.457364 | 181 | 0.632696 |
bfd4581b0878e776af22aab0ae3c8f9f679809d9 | 747 | module Rouge
module Themes
class Atelier Estuary < Base16
name 'base16.Atelier Estuary'
# author Bram de Haan (http://atelierbram.github.io/syntax-highlighting/atelier-schemes/estuary)
light!
palette base00: "#22221b"
palette base01: "#302f27"
palette base02: "#5f5e4e"
p... | 27.666667 | 102 | 0.626506 |
1dac57c1cc24fa53103785c24aa321756eeaeeb9 | 987 | class EntriesController < ApplicationController
#GET /forums/:forum_id/entries
def index
forum_id = params[:forum_id]
@entries = Entry.where(:forum_id => forum_id)
entries = []
@entries.each do |entry|
entries.push(
{
id_tag: entry.user.id_tag,
content:... | 19.352941 | 52 | 0.586626 |
1d8e36200c8bb0bbfc76a5d6adcb1622deb805df | 162 | # frozen_string_literal: true
class AddIsDryRunToFlagLogs < ActiveRecord::Migration[5.0]
def change
add_column :flag_logs, :is_dry_run, :boolean
end
end
| 20.25 | 58 | 0.771605 |
1a43505d7c37faba7a39a792a09c6d9e82469cf8 | 3,708 | require 'rubygems/command'
require 'rubygems/local_remote_options'
require 'rubygems/version_option'
require 'rubygems/source_info_cache'
class Gem::Commands::DependencyCommand < Gem::Command
include Gem::LocalRemoteOptions
include Gem::VersionOption
def initialize
super 'dependency',
'Show the d... | 24.556291 | 79 | 0.617853 |
edb52c4cbcc9b3671e9aea32b1de29eb3d7eb7df | 12,164 | #!/usr/bin/env ruby
# encoding: UTF-8
#
# Copyright © 2012-2014 Cask Data, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless r... | 32.437333 | 125 | 0.617642 |
388a8b3367230cab66ca140f411e8385ec2ac2d7 | 333 | class Author < ActiveRecord::Base
set_table_name "users"
has_one :address, :foreign_key => 'user_id'
has_one :working_topic, :as => :writer, :class_name => 'Topic'
has_one :country, :through => :address
has_one :living_country, :through => :address, :source => :country
should_bypass_all_callbacks_and_va... | 33.3 | 68 | 0.72973 |
b93a76a3b24da77b628ad74d601652f179d106e6 | 6,331 | # frozen_string_literal: true
require "formula"
require "keg"
require "cli/parser"
require "cask/cmd"
require "cask/caskroom"
module Homebrew
module_function
def outdated_args
Homebrew::CLI::Parser.new do
usage_banner <<~EOS
`outdated` [<options>] [<formula>|<cask>]
List installed cask... | 30.882927 | 108 | 0.611278 |
870e5e9ee946dfce35ff2a20ea885558ec813ecb | 2,459 | 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... | 32.355263 | 85 | 0.751525 |
e2a16f0a63da62131a35bece4ead426849a38225 | 4,948 | require 'rails_helper'
RSpec.describe AlmaAdapter::ScsbDumpRecord do
let(:host_record) do
file = file_fixture("alma/scsb_dump_fixtures/host.xml").to_s
MARC::XMLReader.new(file, external_encoding: 'UTF-8').first
end
let(:bad_host_record) do
file = file_fixture("alma/scsb_dump_fixtures/bad-host.xml").... | 33.432432 | 202 | 0.703517 |
bf814e9f405721a3ec335e523a865a2b077700d0 | 3,024 | # frozen_string_literal: true
require_relative 'argument_string_builder'
require_relative 'extensions/object_extensions'
require_relative 'errors/command_line_argument_error'
# The Jekyll module contains everything related to Jekyll.
module Jekyll
# The Jekyll::PlantUml module contains everything related to Jekyll:... | 30.24 | 87 | 0.58168 |
6269424ce180e0f75a16050f3df66c9686ec4788 | 689 | Pod::Spec.new do |s|
s.name = "RemoteImageServiceForMDCDemos"
s.version = "121.0.0"
s.summary = "A helper image class for the MDC demos."
s.description = "This spec is made for use in the MDC demos. It gets images via url."
s.homepage = "https://github.com/material-components/material-c... | 53 | 124 | 0.661829 |
28d51cd0936182e11802db9060c7fd953a87a259 | 3,925 | class User < ActiveRecord::Base
has_many :microposts, dependent: :destroy
has_many :active_relationships, class_name: "Relationship",
foreign_key: "follower_id",
dependent: :destroy
has_many :passive_relationships, class_name: "Relation... | 32.438017 | 138 | 0.654777 |
e2d38dc9903515299d33b021adc0dfe39ef2feb4 | 2,226 | # frozen_string_literal: true
# Note: initial thinking behind `icon_name` is for it to do triple duty:
# 1. one of our svg icon names, such as `external-link` or a new one `bug`
# 2. if it's an absolute url, then url to a user uploaded icon/image
# 3. an emoji, with the format of `:smile:`
module WorkItems
class Typ... | 33.727273 | 107 | 0.680144 |
e224d3456a95fcb233249c3949da4f094d2a73b7 | 4,735 | # frozen_string_literal: true
module ActiveRecord
module Associations
# = Active Record Has Many Association
# This is the proxy that handles a has many association.
#
# If the association has a <tt>:through</tt> option further specialization
# is provided by its child HasManyThroughAssociation.
... | 32.881944 | 99 | 0.622598 |
08c4910303f1cc3d41f584a77a5e378507e80149 | 1,133 | require 'test_helper'
class UsersIndexTest < ActionDispatch::IntegrationTest
def setup
@user = users(:lana)
@admin = users(:michael)
@non_admin = users(:archer)
end
test "index including pagination" do
log_in_as(@user)
get users_path
assert_template 'users/index'
assert_select 'div.... | 25.75 | 66 | 0.672551 |
e84a83966db8bd6490051b9327a3bc153e1e0889 | 1,847 | #!/usr/bin/env ruby
Dir.chdir(File.dirname(__FILE__))
require "optparse"
require "sqlite3" if RUBY_ENGINE != "jruby"
begin
args = {
:filename => "benchmark.rhtml"
}
OptionParser.new do |opts|
opts.banner = "Usage: benchmark.rb [options]"
opts.on("-f FILENAME", "--file FILENAME", "The filena... | 22.52439 | 139 | 0.642664 |
bfcf1ca734b3ae5819744c3589f073148853715a | 2,429 | require 'monitor'
require 'riemann/client/tcp_socket'
module Riemann
class Client
class TCP < Client
attr_accessor :host, :port, :socket
# Public: Set a socket factory -- an object responding
# to #call(options) that returns a Socket object
def self.socket_factory=(factory)
@sock... | 22.915094 | 127 | 0.540552 |
1c43b736a328f244428d8b40351c6e6d983cea91 | 1,517 | require File.expand_path('../helper', __FILE__)
class VisualOpsTest < Service::TestCase
def setup
@stubs = Faraday::Adapter::Test::Stubs.new
@data = {'username' => 'someuser', 'app_list' => 'abc123, madeira:master, xyz456:devel', 'consumer_token' => 'madeira-visualops'}
end
def test_push
svc = serv... | 27.089286 | 133 | 0.624258 |
e8e6c00fd531768535986b5470becc6c61dd3de8 | 561 | Rails.application.routes.draw do
# For details on the DSL available within this file, see https://guides.rubyonrails.org/routing.html
root 'welcome#landing_page'
get '/courses/cheapest', to: 'courses#cheapest'
get '/login', to: 'sessions#new'
post '/login', to: 'sessions#create'
post '/logout', to: 'se... | 22.44 | 102 | 0.686275 |
d5fbf9ce3a104a2ba80f2ac043be3589edd3400c | 2,367 | # This file is copied to spec/ when you run 'rails generate rspec:install'
require 'spec_helper'
ENV['RAILS_ENV'] ||= 'test'
require 'engine_cart'
EngineCart.load_application!
require 'sipity'
# Prevent database truncation if the environment is production
abort("The Rails environment is running in production mode!")... | 41.526316 | 86 | 0.747782 |
26fcc97d5652ab402c030c50bb013d0e8894caf7 | 2,929 | require 'beaker-rspec'
def ldapsearch(cmd, exit_codes = [0,1], &block)
shell("ldapsearch #{cmd}", :acceptable_exit_codes => exit_codes, &block)
end
hosts.each do |host|
# Install Puppet
install_puppet()
# Install ruby-augeas
case fact('osfamily')
when 'Debian'
install_package host, 'libaugeas-ruby'
... | 29.887755 | 118 | 0.556504 |
6179e54f1fec95d04a954e423c89c6f12825fe91 | 835 | Pod::Spec.new do |s|
s.name = 'YLProgressBar'
s.version = '0.0.1'
s.platform = :ios
s.license = 'MIT'
s.summary = 'Custom progress bar for iOS (4.0 or over) with an animated background'
s.homepage = 'https://github.com/YannickL/YLProgressBar'
s.authors = {'Yannick Loriot' => 'http://yannick... | 52.1875 | 98 | 0.649102 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.