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 |
|---|---|---|---|---|---|
f8f54e767545f0e74b8f8dd74c6f9e37cdacc1a3 | 6,803 | ########################################################################################################################
# OpenStudio(R), Copyright (c) 2008-2019, Alliance for Sustainable Energy, LLC, and other contributors. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without m... | 35.994709 | 161 | 0.690284 |
618e51d10b8a6d3975b36e874fcccee601989b77 | 131 | require "test_helper"
class FutureGoalTest < ActiveSupport::TestCase
# test "the truth" do
# assert true
# end
end
| 16.375 | 47 | 0.671756 |
e9b4b2f6c431f4e9ea74909c93e10b83f470b53b | 472 | module DiscountNetwork
class Base
def self.method_missing(method_name, *arguments, &block)
if new.respond_to?(method_name, include_private: false)
new.send(method_name, *arguments, &block)
else
super
end
end
private
def build_array_params(array_params)
array_p... | 22.47619 | 61 | 0.669492 |
039adec39558231cbe6a806f668890463792afeb | 372 | require 'rubygems'
require 'bundler/setup'
require 'ostruct'
require 'oauth'
require 'typhoeus'
require 'mime/types'
require 'active_support/core_ext/hash/slice'
require 'rgeo'
require 'rgeo/geo_json'
require 'pg'
require 'json/ext'
require 'cartodb-rb-client/cartodb'
OpenSSL::SSL.send :remove_const, :VERIFY_PEER
Op... | 20.666667 | 53 | 0.77957 |
bbb9b0ceacd4837b6a334a53ce12f044075d109f | 290 | $:.unshift(File.dirname(__FILE__) + '/../lib/')
require 'rubygems'
require 'spec'
require 'adt'
require 'fileutils'
DB_PATH = File.dirname(__FILE__) + '/fixtures' unless defined?(DB_PATH)
Spec::Runner.configure do |config|
end
self.class.send :remove_const, 'Test' if defined? Test | 22.307692 | 71 | 0.713793 |
285a2ab2ed1f7eeef4a93320758f6c85cd2274fa | 8,934 | # rubocop:disable Style/CaseEquality
# rubocop:disable Style/MultilineTernaryOperator
# rubocop:disable Style/NestedTernaryOperator
module Fastlane
module Actions
class RocketChatAction < Action
def self.is_supported?(platform)
true
end
# As there is a text limit in the notifications, w... | 44.447761 | 179 | 0.531901 |
79a987d8dfdb1b78f83b4033a91db75abfc70a82 | 1,874 | Rails.application.configure do
# Settings specified here will take precedence over those in config/application.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 suit... | 39.87234 | 85 | 0.771612 |
62b2b64a4fb1787d57eecb2d2ccc6574cb5c93fa | 1,653 | # Copyright (c) 2017-present, Facebook, Inc. All rights reserved.
#
# You are hereby granted a non-exclusive, worldwide, royalty-free license to use,
# copy, modify, and distribute this software in source code or binary form for use
# in connection with the web services and APIs provided by Facebook.
#
# As with any so... | 44.675676 | 201 | 0.745917 |
e858861891a122507c11e9670cd3f966371d3291 | 360 | class Paper < ApplicationRecord
has_and_belongs_to_many :authors
validates :year, :title, :venue, presence: true
validates :year, numericality: { only_integer: true }
scope :written_in, ->(year) { where("year == ?", year) }
def authors_names
names = ""
authors.each do |author|
names += author... | 21.176471 | 58 | 0.65 |
ed0a07744e258da085d3eec48a40b37e79a4715b | 2,510 | class Artwork < ActiveRecord::Base
belongs_to :neighborhood
belongs_to :artist
# Data Import code
# def self.import!
# new.import!("SF_Civic_Art_Collection.csv")
# end
# def import!(file)
# CSV.foreach(file, encoding: "iso-8859-1:UTF-8", headers: true, header_converters: :symbol) do |row|
# ... | 24.134615 | 105 | 0.5749 |
e2370e0bda1e88e8764dec6a3a1f6088990d8f3d | 442 | # A special router to use to instantiate an OodApp
# object if all you have is the path to the app
class PathRouter
attr_reader :category, :caption, :url, :type, :path, :name, :token
def initialize(path)
@caption = nil
@category = "App"
@url = "#"
@type = :path
@path = Pathname.new(path)
@n... | 22.1 | 68 | 0.635747 |
ac58fba2c82619a56484252a3b8e4865ae1cb948 | 2,870 | # encoding: utf-8
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
module Azure::Network::Mgmt::V2019_09_01
module Models
#
# Result of the request to list VirtualHubs. It contains a list of
# VirtualHubs and ... | 28.415842 | 80 | 0.529965 |
1a50d246b3b042fc701fbabc80dbfe744b424696 | 153 | class CreatePhotos < ActiveRecord::Migration
def change
create_table :photos do |t|
t.string :filename
t.timestamps
end
end
end
| 15.3 | 44 | 0.673203 |
e90c502d01a2f1f8692f8ef48006ba0c9df8c62f | 721 | Rails.application.routes.draw do
get 'password_resets/new'
get 'password_resets/edit'
get 'sessions/new'
root 'static_pages#home'
get '/help', to: 'static_pages#help'
get '/about', to: 'static_pages#about'
get '/contact', to: 'static_pages#contact'
get '/signup', to: 'users#new'
get '/login', to: 'ses... | 31.347826 | 67 | 0.68516 |
382a5283aaf921aa274b92820d93a5e5747f84ab | 23,936 | require 'test_helper'
class VersionTest < ActiveSupport::TestCase
should belong_to :rubygem
should have_many :dependencies
context "#as_json" do
setup do
@version = create(:version)
end
should "only have relevant API fields" do
json = @version.as_json
assert_equal %w[number built_... | 39.563636 | 355 | 0.653702 |
39d1e0fd6a2b8ccfdbb67079e054d59599f510fc | 4,538 | class GdkPixbuf < Formula
desc "Toolkit for image loading and pixel buffer manipulation"
homepage "https://gtk.org"
url "https://download.gnome.org/sources/gdk-pixbuf/2.36/gdk-pixbuf-2.36.11.tar.xz"
sha256 "ae62ab87250413156ed72ef756347b10208c00e76b222d82d9ed361ed9dde2f3"
bottle do
sha256 "bd9e4d72a827f7... | 34.378788 | 94 | 0.684442 |
39d41fc0e744ee2863c926ed6e3fdea249a614b5 | 8,035 | require 'diego/action_builder'
require 'cloud_controller/diego/lifecycle_bundle_uri_generator'
require 'cloud_controller/diego/buildpack/task_action_builder'
require 'cloud_controller/diego/docker/task_action_builder'
require 'cloud_controller/diego/bbs_environment_builder'
require 'cloud_controller/diego/task_completi... | 47.544379 | 142 | 0.603858 |
bb882c4c263fc822dab957d10191abcb5d65257a | 6,720 | =begin
#Selling Partner API for Merchant Fulfillment
#The Selling Partner API for Merchant Fulfillment helps you build applications that let sellers purchase shipping for non-Prime and Prime orders using Amazon’s Buy Shipping Services.
OpenAPI spec version: v0
Generated by: https://github.com/swagger-api/swagger-cod... | 30.967742 | 252 | 0.632292 |
910f1015c95044ed5216592e9c8064e484baf36d | 6,612 | # frozen_string_literal: true
RSpec.describe RuboCop::Cop::Lint::SafeNavigationConsistency, :config do
let(:cop_config) do
{ 'AllowedMethods' => %w[present? blank? try presence] }
end
it 'allows && without safe navigation' do
expect_no_offenses(<<~RUBY)
foo.bar && foo.baz
RUBY
end
it 'all... | 30.611111 | 127 | 0.575923 |
ab2c84cb083105e49506a657a6b854b3c363dc6b | 9,442 | require 'rails_helper'
describe "items", js: true do
let!(:standup) { FactoryGirl.create(:standup, title: 'San Francisco', subject_prefix: "[Standup][SF]", closing_message: 'Woohoo', image_urls: 'http://example.com/bar.png', image_days: ['Mon']) }
let!(:other_standup) { FactoryGirl.create(:standup, title: 'New Yor... | 37.320158 | 196 | 0.667867 |
919f46a7537b785b87ef8e39f8576386e044273e | 338 | class HomeController < ApplicationController
before_action :authenticate_user!, only: :index
def index
@log = LogEntry.new(day: Date.today, time: Time.now.localtime.strftime("%H:%M"))
@google = Gloc.new()
@entries = LogEntry.all.where(user: current_user).order(:day, :time)
end
def policy
end
d... | 22.533333 | 84 | 0.695266 |
62201b9cb5134a02eeac2d718eb13e7fe20e22d1 | 6,665 | # vim: set ft=javascript:
# Collision checking algorithm, implemented in JavaScript.
# Available as `Opal.DXOpal.CollisionChecker` in the runtime.
%x{ (function(){
var intersect = function(x1, y1, x2, y2, x3, y3, x4, y4){
return ((x1 - x2) * (y3 - y1) + (y1 - y2) * (x1 - x3)) *
((x1 - x2) * (y4 - y1) + (y1 ... | 38.75 | 100 | 0.525281 |
1db73fa0262f8a7de56b52fd72521c954c6bc3bc | 2,237 | class E2fsprogs < Formula
desc "Utilities for the ext2, ext3, and ext4 file systems"
homepage "https://e2fsprogs.sourceforge.io/"
url "https://downloads.sourceforge.net/project/e2fsprogs/e2fsprogs/v1.46.4/e2fsprogs-1.46.4.tar.gz"
sha256 "7524520b291e901431ce59ea085955b601126de371bf3cfc0f5e4fad78684265"
licens... | 32.42029 | 101 | 0.689763 |
ff200c78254ba8b12f5a890d244b253e2144d97b | 1,801 | require 'spec_helper'
describe Sidekiq::Hierarchy::Observers::WorkflowUpdate do
let(:callback_registry) { Sidekiq::Hierarchy::CallbackRegistry.new }
subject(:observer) { described_class.new }
describe '#register' do
let(:msg) { double('message') }
before { observer.register(callback_registry) }
it ... | 36.02 | 88 | 0.68573 |
ac3f8884ecd223d4d30589ded9c67ad2382d2405 | 731 | cask "zotero" do
version "5.0.96.3"
sha256 "72ca698334ce4f453271c9fa7fd01ed5592eadcf69095044bea7f9539ef5edb6"
url "https://download.zotero.org/client/release/#{version}/Zotero-#{version}.dmg"
name "Zotero"
desc "Collect, organize, cite, and share research sources"
homepage "https://www.zotero.org/"
live... | 27.074074 | 83 | 0.69357 |
edb7afb46035912e984e0339f3517ff9ba3ed9c1 | 2,229 | class QuestionnaireNode < Node
belongs_to :questionnaire, class_name: 'Questionnaire', foreign_key: 'node_object_id', inverse_of: false
belongs_to :node_object, class_name: 'Questionnaire', foreign_key: 'node_object_id', inverse_of: false
def self.table
'questionnaires'
end
def self.get(sortvar = nil, s... | 33.772727 | 156 | 0.644235 |
ab916ad8c381b8e60e82e0f2cfe7286d19723c56 | 318 | module Fog
module Compute
class Ninefold
class Real
def query_async_job_result(options = {})
request('queryAsyncJobResult', options, :expects => [200],
:response_prefix => 'queryasyncjobresultresponse', :response_type => Array)
end
end
end
end
end
| 21.2 | 93 | 0.610063 |
62d7073966e12b289fc5647b3babdcc08164f551 | 173 | module StringHelpers
def remove_suffix(word, suffix_size)
word[0, word.size - suffix_size]
end
def ends_with?(word, suffix)
!!(word =~ /#{suffix}$/)
end
end | 19.222222 | 38 | 0.66474 |
b992bc1c59aa9b2142b59d60c2276b9d1eb79262 | 2,581 | #
# Author:: AJ Christensen (<aj@opscode.com>)
# Copyright:: Copyright (c) 2008 Opscode, Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# ... | 26.070707 | 156 | 0.686943 |
017d7f9f143a1243ec17c5023943ec86226eec09 | 784 | # frozen_string_literal: true
module SpreeMailchimpEcommerce
class ProductMailchimpPresenter
attr_reader :product
def initialize(product)
@product = product
end
def json
{
id: Digest::MD5.hexdigest(product.id.to_s),
title: product.name || "",
description: product... | 23.058824 | 108 | 0.649235 |
1a9018af584ee15a6044ff3bb0c1034f4c9cfb3a | 152 | class AddPromeseEndpointToPromeseSettings < ActiveRecord::Migration
def change
add_column :promese_settings, :promese_endpoint, :string
end
end
| 25.333333 | 67 | 0.815789 |
b9041f71f5ee060e91680e301bd8eda919dd2572 | 3,172 | require 'spec_helper'
describe LogDecorator do
it 'has a version number' do
expect(LogDecorator::VERSION).not_to be nil
end
describe "module methods" do
it "should respond to :prefix" do
expect(LogDecorator.respond_to?(:prefix)).to be true
end
it "should respond to :prefix=" do
expe... | 28.321429 | 79 | 0.678436 |
282ea4c4620566a4a5b0f7af1c94b722701d8a4a | 1,384 | lib = File.expand_path("../lib", __FILE__)
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
require "eloquant/version"
Gem::Specification.new do |spec|
spec.name = "eloquant"
spec.version = Eloquant::VERSION
spec.authors = ["Jason Stumbaugh"]
spec.email = ["stumbaughjason@gm... | 41.939394 | 102 | 0.665462 |
269df7bc8ee648a468b297ab8c558146707e7cb7 | 396 | # frozen_string_literal: true
require 'yaml'
unless ENV['MAILCHIMP_API_KEY']
if File.exist?('api_key.yml')
ENV['MAILCHIMP_API_KEY'] = YAML.load_file('api_key.yml')['api_key'] # api_key.yml is ignored in .gitignore
else
ENV['MAILCHIMP_API_KEY'] = 'vcr_playback-us11' # Will successfully replay the VCR casset... | 30.461538 | 110 | 0.724747 |
38a072dda7a7eab7f2ab4216d17db4cf0679be7d | 816 | require 'test_helper'
class SiteLayoutTest < ActionDispatch::IntegrationTest
def setup
@user = users(:agata)
end
test "layout links" do
get root_path
assert_template 'static_pages/home'
assert_select "a[href=?]", root_path, count: 2
assert_select "a[href=?]", help_path
assert_select "a[... | 28.137931 | 54 | 0.683824 |
bb999f02fd4614d0da94bdf4978ce7de0f98e85e | 912 | # frozen_string_literal: true
class ApplicationController < ActionController::Base
protect_from_forgery
# Some applications and libraries modify `current_user`. Their changes need
# to be reflected in `whodunnit`, so the `set_paper_trail_whodunnit` below
# must happen after this.
before_action :modify_curre... | 27.636364 | 78 | 0.770833 |
1c6ea97b872df199caec97b8557762375ed9b130 | 1,356 | require_relative '../../puppet_x/puppetlabs/netdev_stdlib/check'
if PuppetX::NetdevStdlib::Check.use_old_netdev_type
Puppet::Type.newtype(:syslog_facility) do
@doc = 'Configure severity level for syslog facilities'
apply_to_all
ensurable
newparam(:name, namevar: true) do
desc 'Facility'
... | 27.12 | 125 | 0.620944 |
280d35adcb902aa414de2f63671ebf15de977cfa | 319 | module ActionPack
# Returns the version of the currently loaded Action Pack as a <tt>Gem::Version</tt>
def self.gem_version
Gem::Version.new VERSION::STRING
end
module VERSION
MAJOR = 4
MINOR = 2
TINY = 0
PRE = "beta1"
STRING = [MAJOR, MINOR, TINY, PRE].compact.join(".")
end
end
| 19.9375 | 86 | 0.642633 |
61407f6d08806bdddf87955dc7d38b867254c68d | 1,232 | RSpec.describe ParallelReportPortal do
it 'has a version number' do
expect(ParallelReportPortal::VERSION).not_to be nil
end
context 'extends the correct modules' do
let(:extensions) { ParallelReportPortal.singleton_class.included_modules }
it 'extends ParallelReportPortal::HTTP' do
expect(exte... | 30.8 | 112 | 0.736201 |
610d7f8c5d0bd6498d2cb949eab1dcc3bae066cd | 370 | maintainer "Opscode, Inc."
maintainer_email "cookbooks@opscode.com"
license "Apache 2.0"
description "Installs packages for working with XFS"
long_description IO.read(File.join(File.dirname(__FILE__), 'README.rdoc'))
version "0.1.1"
recipe "xfs", "Installs packages for working with XFS"
%... | 28.461538 | 74 | 0.7 |
1c4e217579bdd0e8f3f02df32f6e2d2bfa94514d | 3,517 | # frozen_string_literal: true
require 'spec_helper'
require 'bolt_spec/conn'
require 'bolt_spec/transport'
require 'bolt/transport/docker'
require 'bolt/inventory'
require 'shared_examples/transport'
describe Bolt::Transport::Docker, docker: true do
include BoltSpec::Conn
include BoltSpec::Transport
let(:tran... | 30.850877 | 118 | 0.642877 |
5dc86171eb439dc22c595c98ff28205237ba7aa5 | 36 | module Sway
VERSION = "0.0.1"
end
| 9 | 19 | 0.638889 |
38e21687c49f5f2b7765b6669d9e934e108e494c | 280 | require "shoelace/rails/ui/version"
require "shoelace/rails/ui/engine"
Dir[File.dirname(__FILE__) + '/../lib/*.rb'].each do |file|
require File.basename(file, File.extname(file))
end
module Shoelace
module Rails
module Ui
# Your code goes here...
end
end
end
| 21.538462 | 60 | 0.689286 |
87f7f10563a649c6f558b496651e839898cbd755 | 736 | module ChangeHealth
class Connection
URI_BUILDER = ->(host) { "https://#{host}apis.changehealthcare.com/".freeze }
QA_ENDPOINT = URI_BUILDER.call('sandbox.')
PROD_ENDPOINT = URI_BUILDER.call('')
include HTTParty
base_uri QA_ENDPOINT
headers 'Content-Type' => 'application/json;charset=UTF... | 23 | 81 | 0.657609 |
ab34f8c0843c9c439677bcda54b14fb6aac1dbfb | 452 | require 'spec_helper'
describe 'security_baseline::rules::sec_ntalk' do
on_supported_os.each do |os, os_facts|
context "on #{os}" do
let(:facts) do
os_facts.merge(
'srv_ntalk' => 'enabled',
)
end
let(:params) do
{
'enforce' => true,
'message... | 19.652174 | 49 | 0.519912 |
d5c86ec28e8ebb928c353f0a976c205ccde1ded4 | 1,046 | module Messages
class DeadLink
include Rails.application.routes.url_helpers
attr_reader :flag
def initialize(flag)
@flag = flag
end
def title
"One of your submissions has been flagged on #{flagged_date}"
end
def content
"Hey #{username}, your project #{lesson_name} ha... | 22.73913 | 93 | 0.628107 |
bf47133111a75f59899ea3f2030729e04235f83c | 799 | require "active_support"
require "active_support/core_ext"
require "builder"
require "yaml"
require "json"
module Electretri
class << self
def parse_file(file)
Electretri::Calculate.new(file)
end
end
module API
class << self
def load_yml(path)
File.open('result.yml', 'w') {|f| f... | 21.594595 | 73 | 0.607009 |
1cc4b6b74bdd9bbc48fda8fd4816eee0d7bd9a14 | 1,722 | Rails.application.routes.draw do
devise_for :users
resources :users
root :to => 'users#index'
get 'static_pages/home'
get 'static_pages/help'
# The priority is based upon order of creation: first created -> highest priority.
# See how all your routes lay out with "rake routes".
# You can have the roo... | 26.90625 | 84 | 0.649826 |
089e7aef73d89cf53959120d21cef3f8f33fc058 | 3,094 | require File.expand_path('../../../spec_helper', __FILE__)
require 'bigdecimal'
describe "BigDecimal#<" do
before :each do
@zero = BigDecimal("0")
@zero_pos = BigDecimal("+0")
@zero_neg = BigDecimal("-0")
@mixed = BigDecimal("1.23456789")
@pos_int = BigDecimal("2E5555")
@neg_int = BigDecimal(... | 31.896907 | 84 | 0.603749 |
4af80a5af6766ebcf50622f1899713d41893d453 | 11,954 | # frozen_string_literal: true
class Source::URL::Null < Source::URL
attr_reader :work_id, :page_url, :profile_url
def self.match?(url)
true
end
def site_name
case host
when /ask\.fm\z/i
"Ask.fm"
when /bcy\.net\z/i
"BCY"
when /carrd\.co\z/i
"Carrd"
when /circle\.ms\z/... | 48.396761 | 264 | 0.665468 |
e2611613f704dbaf892713a33e38b1ee009e8882 | 37,263 | module JSONAPI
class ActiveRelationResource < BasicResource
root_resource
class << self
# Finds Resources using the `filters`. Pagination and sort options are used when provided
#
# @param filters [Hash] the filters hash
# @option options [Hash] :context The context of the request, se... | 43.787309 | 167 | 0.627432 |
08b7009b7b3106a522a35aba6f13fdfc1547aab1 | 18,543 | RSpec.describe KikEventsService do
let!(:admin_user) { create :user }
let!(:timestamp) { Time.now.to_i * 1000 }
let!(:bot) { create :bot, provider: 'kik' }
let!(:bc1) { create :bot_collaborator, bot: bot, user: admin_user }
let!(:bot_instance) { create :bot_instance, provider: 'kik', bo... | 33.899452 | 129 | 0.592569 |
ac7742a9afff866727e274f318935374786cc1e8 | 621 | require File.expand_path("../../Abstract/abstract-php-extension", __FILE__)
class Php73Lz4 < AbstractPhp73Extension
init
desc "Handles LZ4 de/compression"
homepage "https://github.com/kjdev/php-ext-lz4"
url "https://github.com/kjdev/php-ext-lz4/archive/0.3.5.tar.gz"
sha256 "fcea0792f22e337950682129e72ba07c1f... | 28.227273 | 75 | 0.7343 |
b900c34372d25b2eafe41cc1242a3332bff9fcf0 | 413 | cask :v1 => 'mediabrowser-server' do
version :latest
sha256 :no_check
# github.com is the official download host per the vendor homepage
url 'https://github.com/MediaBrowser/MediaBrowser.Releases/raw/master/Server/MediaBrowser.Server.Mac.pkg'
homepage 'http://mediabrowser.tv/'
license :gpl
pkg 'MediaBro... | 29.5 | 107 | 0.757869 |
e2438834c92944955d0b8e2ea8a40ce95f7aa13d | 639 | require 'rails_helper'
RSpec.describe LockGridCells do
let(:values) { [1, nil] }
let(:cells) { values.map { |value| Cell.new(value: value) } }
let(:sample_grid) { Grid.new(cells: cells) }
let(:service) { LockGridCells.new(sample_grid) }
let(:new_grid) { service.call }
let(:locked_cell) { ne... | 24.576923 | 69 | 0.674491 |
6a70b743997e136897f9f5e65b266454b9421927 | 145 | # Be sure to restart your server when you modify this file.
Rails.application.config.session_store :cookie_store, key: '_monitoria_app_session'
| 36.25 | 83 | 0.813793 |
26d9c31b4d276620d8501b215cbd51f814f84a44 | 4,055 | class ApplicationController < ActionController::Base
protect_from_forgery with: :exception, unless: :devise_token_controller
before_action :configure_permitted_devise_parameters, if: :devise_controller?
before_action :store_current_location, unless: -> { devise_controller? || !request.format.html? }
before_acti... | 32.701613 | 99 | 0.691245 |
219e880647e52e938a570f42b28730151ed8493a | 1,589 | require 'devise'
require 'rack/oauth2'
require 'koala'
require 'devise_oauth2_providable'
require 'devise/oauth2_facebook_grantable/strategies/facebook_grant_type'
require 'devise/oauth2_facebook_grantable/models/oauth2_facebook_grantable'
module Devise
module Oauth2ProvidableFacebook
def self.logger
@@lo... | 28.375 | 114 | 0.696035 |
01ca4c9ad5de45f9c4f698ff8b8a756ef12dec44 | 1,575 | #-- copyright
# OpenProject is an open source project management software.
# Copyright (C) 2012-2020 the OpenProject GmbH
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License version 3.
#
# OpenProject is a fork of ChiliProject, which is a fork ... | 35.795455 | 91 | 0.753016 |
26195e90762aa470068f4c888f4a7915659d0925 | 1,887 | # encoding: utf-8
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
lib = File.expand_path('../lib', __FILE__)
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
require '../azure_mgmt_event_grid/lib/module_d... | 43.883721 | 115 | 0.691044 |
792354c9e70d0c4f1f85ac155c560d0508a7fdb5 | 7,103 | # frozen_string_literal: true
# title: Export plugin example
# description: Speak the most recent entry (macOS)
# author: Brett Terpstra
# url: https://brettterpstra.com
# Example
#
# doing show -o sayit
#
# ## Configuration
#
# Change what the plugin says by generating a template with
# `doing template --type say`, ... | 33.504717 | 93 | 0.571871 |
03561e7382863803c414c3413fe26aa0487622a8 | 5,147 | # frozen_string_literal: true
class Projects::FeatureFlagsController < Projects::ApplicationController
respond_to :html
before_action :authorize_read_feature_flag!
before_action :authorize_create_feature_flag!, only: [:new, :create]
before_action :authorize_update_feature_flag!, only: [:edit, :update]
befor... | 30.099415 | 110 | 0.668156 |
33f86f36c621bfc2e5abe432782dec16b4c30f48 | 1,614 | class Dosbox < Formula
desc "DOS Emulator"
homepage "https://www.dosbox.com/"
url "https://downloads.sourceforge.net/project/dosbox/dosbox/0.74-3/dosbox-0.74-3.tar.gz"
sha256 "c0d13dd7ed2ed363b68de615475781e891cd582e8162b5c3669137502222260a"
license "GPL-2.0"
bottle do
sha256 cellar: :any, arm64_big_su... | 35.086957 | 123 | 0.739157 |
bf5842d937e7ec2f6601345f9843ffabf10eea3e | 718 | require 'net/smtp'
# Example:
# begin
# some http call
# rescue *HTTP_ERRORS => error
# notify_hoptoad error
# end
HTTP_ERRORS = [Timeout::Error,
Errno::EINVAL,
Errno::ECONNRESET,
EOFError,
Net::HTTPBadResponse,
Net::HTTPHeaderSyn... | 26.592593 | 53 | 0.551532 |
081f9deae5cfcd91a1a3566ee0a24fdd9f668fe4 | 3,460 | #
# Copyright:: Copyright 2015-2016, Chef Software, Inc
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-... | 31.454545 | 111 | 0.654046 |
e2b5c3ec8672311ad1ebf869f2da7512cadb1dbe | 2,198 | # frozen_string_literal: true
# Copyright, 2021, by Samuel G. D. Williams. <http://www.codeotaku.com>
#
# 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 withou... | 28.179487 | 79 | 0.754322 |
1a1588641d667896fc380a76bd6a272de51dea18 | 2,221 | require_relative '../lib/validator.rb'
describe Validator do
let(:validator) { Validator.new }
context '#search_type_validator' do
it "returns true if '1' is given" do
expect(validator.search_type_validator('1')).to eql(true)
end
it "returns true if '2' is given" do
expect(validator.search... | 28.113924 | 64 | 0.668167 |
214aace5cb50f2a4b242add01092c3be0121f92e | 750 | module Intrigue
module Issue
class WordpressConfigLeak < BaseIssue
def self.generate(instance_details={})
{
name: "wordpress_config_leak",
pretty_name: "Wordpress Configuration Information Leak",
severity: 1,
category: "application",
status: "confirmed",
... | 35.714286 | 115 | 0.669333 |
626e91b658633db9e157a8e8e95ff03b50ceed75 | 116 | class ServersRenameUrl < ActiveRecord::Migration
def change
rename_column :servers, :url, :site_url
end
end
| 19.333333 | 48 | 0.758621 |
f8d59ffc1a7da6cc09cffdeb0a3a01b0c2ab2cc4 | 3,794 | #
# Copyright (C) 2010-2016 dtk contributors
#
# This file is part of the dtk project.
#
# 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
#
# Unles... | 29.640625 | 110 | 0.622035 |
8707c6476ea8886aa90b9d04ccd9d873df733672 | 1,875 | #
# Author:: Daniel DeLeo (<dan@chef.io>)
# Copyright:: Copyright 2010-2016, Chef Software Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# ... | 32.327586 | 99 | 0.730667 |
e2d03dde296ec6690d69edc303bbd3b18adbaf6c | 162 | require 'test/unit'
require 'wikk_configuration'
class TestBlah < Test::Unit::TestCase
def test_sanity
flunk 'write tests or I will kneecap you'
end
end
| 18 | 45 | 0.746914 |
03cece5885c6af639d8c0183c0c4ef2b24cebf81 | 137,542 | # Copyright 2015 Google 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 required by applicable law or agreed to in writing,... | 48.074799 | 121 | 0.639477 |
33841b5d905ecf4c31578bdef2bd26dba60356c0 | 30,006 | #
# Fluentd
#
# 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 agreed to in writing, so... | 32.195279 | 158 | 0.629841 |
916c827e7b76dfcd02eb7963ef479dd2d965bba4 | 1,133 | class Asciinema < Formula
desc "Record and share terminal sessions"
homepage "https://asciinema.org"
url "https://github.com/asciinema/asciinema/archive/v2.0.1.tar.gz"
sha256 "7087b247dae36d04821197bc14ebd4248049592b299c9878d8953c025ac802e4"
head "https://github.com/asciinema/asciinema.git"
bottle do
c... | 35.40625 | 93 | 0.753751 |
1d49fb416e3e416f7e0eaa40b0dd8f6a704c413a | 76 | module Elasticsearch
module Transport
VERSION = "7.0.0.pre"
end
end
| 12.666667 | 25 | 0.697368 |
ac4e5118ac6bcaca2e30366929e6e3badfaf2bdf | 878 | RSpec.describe Genius::Search::Tracks do
subject { described_class }
describe 'successful processing' do
context 'when query present' do
let(:output) do
VCR.use_cassette 'services/genius/search/tracks/success' do
subject.call(query: 'molly nilsson', limit: 5, page: 2, profile_id: 1)
... | 25.823529 | 80 | 0.644647 |
e2a87758b7cfefc5d169cabd5713752533320675 | 279 | module Cyr
module Views
# Since editing and selecting are the same interaction, just different
# flow states, we just have to give the select state a name that matches
# and inherit the edit state.
class SelectCompany < Cyr::Views::EditCompany; end
end
end
| 25.363636 | 76 | 0.724014 |
214d7eec1ccdbd9f1ea9aad72abcb9875dc02a71 | 2,302 | require File.expand_path('../boot', __FILE__)
require 'rails/all'
# If you have a Gemfile, require the gems listed there, including any gems
# you've limited to :test, :development, or :production.
Bundler.require(:default, Rails.env) if defined?(Bundler)
module Portfolio
class Application < Rails::Application
... | 45.137255 | 163 | 0.725891 |
916dbffe7e528c2e134d0750f3a0a32d4099510f | 18,086 | #
# Copyright:: Copyright (c) Chef Software 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 required by applicable law or ag... | 52.883041 | 645 | 0.685005 |
01bb4be74d7b63c8604e7de0b888e3146842922c | 2,283 | #!/usr/bin/env ruby
class String
def brightRed
return "\033[1;31m" + self + "\033[0m"
end
def brightGreen
return "\033[1;32m" + self + "\033[0m"
end
end
def doCommand( command )
puts command.brightGreen
if $step
do_it = false
print "Execute? [y]es, [n]o, yes to [a]ll "; $stdout... | 24.815217 | 173 | 0.579501 |
e206bf8749f205fba7d272b8851a8cca3aaafd19 | 792 | require 'field_def'
require 'type_name_utils'
# Represents the definition of a field that is based on an NHibernate User-defined type mapper
class UserTypeFieldDef < FieldDef
def initialize(model, fieldNode)
super(model, fieldNode)
@dataType = TypeNameUtils.getTypeNameFromHbm(fieldNode.attributes['typ... | 22 | 99 | 0.690657 |
b90c2fc0e28ef8f18af777996a773b8d753b0021 | 432 | class ApplicationController < ActionController::Base
helper_method :p_logged_in?,:s_logged_in?, :current_user
def p_logged_in?
!!session[:professor_id]
end
def s_logged_in?
!!session[:student_id]
end
def current_user
if p_logged_in?
return Professor.find(session[:professor_id])
el... | 16.615385 | 58 | 0.696759 |
032eafbc73aed6a207582135f02f91c1c281c9da | 275 | module Gitlab
module SlashCommands
module Presenters
class Error < Presenters::Base
def initialize(message)
@message = message
end
def message
ephemeral_response(text: @message)
end
end
end
end
end
| 17.1875 | 44 | 0.589091 |
010528e6aea052f66b1e6333d3cc31ef8ceeabba | 1,588 | # frozen_string_literal: true
class User < ApplicationRecord
# Include default devise modules. Others available are:
# :confirmable, :lockable, :timeoutable and :omniauthable
devise :database_authenticatable, :registerable,
:recoverable, :rememberable, :trackable, :validatable
belongs_to :role, optio... | 23.352941 | 75 | 0.725441 |
ff97c5ebd9e57a1609076eaa0c9b01ea48304be6 | 1,482 | # -*- encoding: utf-8 -*-
Gem::Specification.new do |s|
s.name = "yajl-ruby"
s.version = "1.1.0"
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
s.authors = ["Brian Lopez", "Lloyd Hilaiel"]
s.date = "2011-11-09"
s.email = "seniorlopez@gmail.com"
s.... | 37.05 | 105 | 0.629555 |
9151bf49d3566b5b77c8fca53396f2ee035d4c2c | 1,934 | require 'spec_helper'
module Gmailish
describe Account do
let(:instance) { Gmailish::Account.new(username, password) }
let(:username) { 'venkmanapp' }
let(:password) { 'ABC123456' }
let(:account) {
instance_double(
'Net::IMAP'
)
}
describe '#initialize' do
it 'take... | 21.488889 | 64 | 0.569286 |
b94a775958cbb05214f1fb42a1c5baba0afa538f | 1,531 | cask "tunnelblick-beta" do
version "3.8.6beta03,5700"
sha256 "de0f6d24cbc45650c1789f6963f7b454099e6cd9a00ec067178977614415d256"
url "https://github.com/Tunnelblick/Tunnelblick/releases/download/v#{version.before_comma}/Tunnelblick_#{version.before_comma}_build_#{version.after_comma}.dmg",
verified: "github... | 33.282609 | 163 | 0.719138 |
f8c037a48ea58edcbdde45ff1603e23c6547f0b0 | 1,330 | class Yj < Formula
desc "CLI to convert between YAML, TOML, JSON and HCL"
homepage "https://github.com/sclevine/yj"
url "https://github.com/sclevine/yj/archive/v5.0.0.tar.gz"
sha256 "df9a4f5b6d067842ea3da68ff92c374b98560dce1086337d39963a1346120574"
license "Apache-2.0"
head "https://github.com/sclevine/yj.g... | 45.862069 | 139 | 0.778195 |
628ce3643b2bad8c7072e6e10eeea451edb03fa1 | 569 | $:.push File.expand_path("lib", __dir__)
require "omniauth/irma/version"
Gem::Specification.new do |spec|
spec.name = "omniauth-irma"
spec.version = Omniauth::Irma::VERSION
spec.authors = ["Sietse Ringers"]
spec.email = ["mail@sietseringers.net"]
spec.summary = %q{IRMA st... | 31.611111 | 82 | 0.627417 |
bf4bc99f048e9f78be0ea556c848fa483feb9b30 | 1,563 | module Builder
include Test::Unit::Assertions
def I(size)
self.eye(size)
end
def eye(size)
#pre
assert size.is_a? Integer
assert size >= 0
result = SMatrix.new(Dok.new(size, size))
result.each_diagonal_index do |i, j|
result[i, j] = 1
end
#post
assert result.identity?
... | 19.5375 | 80 | 0.632118 |
e8b0300f4f7fa451710d4a9ec6dca49b324132d0 | 121 | class AddExistToAmbulance < ActiveRecord::Migration
def change
add_column :ambulances, :exist, :integer
end
end
| 20.166667 | 51 | 0.760331 |
e9fff6f90c0143c3474b7c0572c26d4fbc052db8 | 2,294 | # server-based syntax
# ======================
# Defines a single server with a list of roles and multiple properties.
# You can define all roles on a single server, or split them:
# server 'example.com', user: 'deploy', roles: %w{app db web}, my_property: :my_value
# server 'example.com', user: 'deploy', roles: %w{ap... | 33.735294 | 88 | 0.670445 |
abdb5337fe22ed4411e980296330024475820348 | 2,493 | require 'rails_helper'
describe 'gend_images/new.html.erb', type: :view do
let(:caption1) { FactoryGirl.create(:caption) }
let(:gend_image) { FactoryGirl.create(:gend_image, captions: [caption1]) }
before do
assign(:gend_image, gend_image)
assign(:caption_defaults, [{}, {}])
assign(:src_image_url_wi... | 26.806452 | 77 | 0.678299 |
7aaad57f5cd9a0897c1a42488a399ad9be68064a | 2,457 | # frozen_string_literal: true
require 'spec_helper'
RSpec.describe Gitlab::Ci::Config::Entry::AllowFailure do
let(:entry) { described_class.new(config.deep_dup) }
let(:expected_config) { config }
describe 'validations' do
context 'when entry config value is valid' do
shared_examples 'valid entry' do
... | 26.419355 | 81 | 0.579976 |
aca34f43d56f3a2f5762ce014fec0417943205db | 22,701 | # -------------------------------------------------------------------------- #
# Copyright 2002-2020, OpenNebula Project, OpenNebula Systems #
# #
# Licensed under the Apache License, Version 2.0 (the "License"); you may #
# no... | 36.033333 | 108 | 0.499978 |
ffd2efe6938b692f2c86415b52b204b7eba2e6e9 | 132 | module RankmiExcelReview
class ApplicationController < ActionController::Base
protect_from_forgery with: :exception
end
end
| 22 | 54 | 0.818182 |
7956c84e987b924efe3bc871787a68aebb568f35 | 2,458 | class CLI
def welcome
puts "Welcome to 4x calculation tool"
API.currency_types
self.menu
end
def menu
puts "Would you like to use the tool, look through different types of currency or stop the program?"
puts "Type 1 to use the tool, 2 to stop program."
... | 32.773333 | 121 | 0.552075 |
01c07c107f1ed67a1e19e369c2bb5fd56001c5fc | 177 | class Cmsino::Post < Cmsino::Content
validates_presence_of :umbrella
validates_presence_of :name
before_save :set_date
def set_date
self.date = Time.now
end
end
| 16.090909 | 36 | 0.751412 |
edd0fee4280de10bb4e469c991da034677777834 | 786 | # frozen_string_literal: true
# See LICENSE.txt at root of repository
# GENERATED FILE - DO NOT EDIT!!
require 'ansible/ruby/modules/base'
module Ansible
module Ruby
module Modules
# This module can be used to manage (create, delete) VMware vSphere Datacenters.
class Vmware_datacenter < Base
... | 35.727273 | 143 | 0.69084 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.