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 |
|---|---|---|---|---|---|
d573d9ea9c7a12e60a82e364ac5f0435072d7062 | 102 | json.array!(@collection) do |cc_question|
json.id cc_question.id
json.label cc_question.label
end
| 20.4 | 41 | 0.77451 |
79cdcf074708cc405a46a9b9f3483658100eab37 | 6,335 | #-- encoding: UTF-8
#-- copyright
# OpenProject is a project management system.
# Copyright (C) 2012-2017 the OpenProject Foundation (OPF)
#
# 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... | 38.393939 | 120 | 0.474665 |
1df1cc9f3217d34574bc00d53a902db9a168819d | 389 | #!/usr/bin/env ruby
require 'mongo_percolator'
MongoPercolator.connect
class TimeTest2
include MongoMapper::Document
key :timeid, BSON::ObjectId
key :counter, Integer
before_save :update_timeid
def update_timeid
self.timeid = BSON::ObjectId.new
end
end
1.upto(10000) do |i|
TimeTest2.create! :coun... | 16.913043 | 54 | 0.745501 |
f8b1c1e979943a37ee53df079a0e46cf15d7bcfa | 1,179 | default["apt-cacher-ng"][:secret_file] = "/etc/chef/secrets/apt-cacher-ng"
default["apt-cacher-ng"][:confdir] = "/etc/apt-cacher-ng"
default["apt-cacher-ng"][:cachedir] = "/var/cache/apt-cacher-ng"
default["apt-cacher-ng"][:logdir] = "/var/log/apt-cacher-ng"
default["apt-cacher-ng"][:port] = "3142"
default["apt-cacher... | 24.5625 | 79 | 0.581001 |
1ab6b72e1834a5f34d9cc68900cd32d19054f13b | 2,027 | # The test environment is used exclusively to run your application's
# test suite. You never need to work with it otherwise. Remember that
# your test database is "scratch space" for the test suite and is wiped
# and recreated between test runs. Don't rely on the data there!
Rails.application.configure do
# Settings... | 39.745098 | 85 | 0.77553 |
f79952afcc57a6993b649d987d9a07974cdbb274 | 37,379 | #!/usr/bin/env ruby
require 'spec_helper'
describe Oregano::Util do
include OreganoSpec::Files
# Discriminator for tests that attempts to unset HOME since that, for reasons currently unknown,
# doesn't work in Ruby >= 2.4.0
def self.gte_ruby_2_4
@gte_ruby_2_4 ||= SemanticOregano::Version.parse(RUBY_VERSI... | 37.948223 | 198 | 0.642179 |
4a81793241373547aa2c6d91dadd7cf107f7211e | 1,292 | # encoding: UTF-8
# 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.
#
# Note that this schema.rb definition is the authoritative sou... | 35.888889 | 86 | 0.743808 |
7938bc11b52667ce3a3465dd9bf79304758625f8 | 1,164 | require 'rails_helper'
RSpec.describe MicropostsController, type: :controller do
context "ポストチェック" do
before do
# @user = create(:testuser) # FactoryBot.create(:testuser)を短縮 buildだとDB登録されない
@user = create(:testuser, name: "SoichiKamiya")
@micropost = create(:orange)
end
it "ログインしていない... | 31.459459 | 99 | 0.665808 |
5d449e8ebb123a0ea6c90d103faf3df70b676526 | 962 | require 'rspec'
require 'tap_impl/day02'
describe 'tap impl method' do
before(:each) do
@local = 'self'
end
it 'has to return self' do
expect(@local.tap_impl).to be @local
end
it 'has to pass self to a block' do
expect { |block| @local.tap_impl(&block) }.to yield_with_args(@local)
end
cont... | 22.372093 | 98 | 0.636175 |
21c218d8949b42d877fe2f68efdf09a173f985c4 | 83 | ActiveSupport::Inflector.inflections(:en) do |inflect|
inflect.acronym 'JWT'
end
| 20.75 | 54 | 0.771084 |
f87eb7e45dbeeec5819e1e9aed24f84810fc31de | 357 |
require 'commander/import'
require 'Confetti'
module Confetti
module Commands
class LsProj
def LsProj.command(c)
c.syntax = 'tt lsproj [options]'
c.summary = 'List activities'
c.description = c.summary
c.example 'List all projects', 'tt lsproj'
c.action LsProj
end
def initialize(args, options)
en... | 13.730769 | 44 | 0.717087 |
1dd201ea0fa6eb898cab63a1e6492cb2930791b6 | 5,375 | =begin
PureCloud Platform API
With the PureCloud Platform API, you can control all aspects of your PureCloud environment. With the APIs you can access the system configuration, manage conversations and more.
OpenAPI spec version: v2
Contact: DeveloperEvangelists@genesys.com
Generated by: https://github.com/swagger-ap... | 23.168103 | 177 | 0.572837 |
ffcef3411ce216e5ba2ee11b1b8e658c58ab692f | 581 | require File.dirname(__FILE__) + '/../../../spec_helper'
require 'stringio'
require 'zlib'
describe "GzipReader#read" do
before :each do
@data = '12345abcde'
@zip = "\037\213\b\000,\334\321G\000\00334261MLJNI\005\000\235\005\000$\n\000\000\000"
@io = StringIO.new @zip
end
it "reads the contents of ... | 20.034483 | 90 | 0.629948 |
26ca81398bcf6b74db63c9363cd879738cb42603 | 138 | class CreateItems < ActiveRecord::Migration
def change
create_table :items do |t|
t.timestamps null: false
end
end
end
| 15.333333 | 43 | 0.688406 |
acf32f8fce973c07db60f18aabc26c5e502d1505 | 1,163 | # frozen_string_literal: true
# ExploreController exposes a search interface for non-logged in (anonymous)
# users. It allows these users to search for public repositories.
class ExploreController < ActionController::Base
protect_from_forgery with: :exception
before_action :feature_enabled, only: [:index]
incl... | 27.690476 | 98 | 0.728289 |
288bae77735a37be3401b4a9bee612e47c2a84e4 | 2,362 | class User < ApplicationRecord
attr_accessor :remember_token, :activation_token, :reset_token
before_save :downcase_email
before_create :create_activation_digest
validates :name, presence: true, length: { maximum: 50 }
VALID_EMAIL_REGEX = /\A[\w+\-.]+@[a-z\d\-]+(\.[a-z\d\-]+)*\.[a-z]+\z/i
val... | 28.119048 | 138 | 0.6884 |
ac4ccdfb723c09c034b42f81c1ccef6952784699 | 280 | class RenameBuildboxService < ActiveRecord::Migration[4.2]
def up
execute "UPDATE services SET type = 'BuildkiteService' WHERE type = 'BuildboxService';"
end
def down
execute "UPDATE services SET type = 'BuildboxService' WHERE type = 'BuildkiteService';"
end
end
| 28 | 91 | 0.735714 |
26a80da89ebc6ed90042391bc9f8077a512cfedf | 154 | module Resque
module Failure
class Rollbar < Base
def save
::Rollbar.report_exception(exception, payload)
end
end
end
end
| 15.4 | 54 | 0.642857 |
01712089ee26fe4bcff373c689e8aa0982ab3d5e | 135 | Schubert.template "add_user" do |r,opt|
up = "useradd -m -U #{opt[:name]}"
down "userdel -r #{opt[:name]}"
r.shell up, down
end
| 19.285714 | 39 | 0.607407 |
5d0144ed4f9224b222b7163dd45239bc6c15287f | 877 | module Feeble::Language::Ruby
include Feeble::Runtime
RSpec.describe Lambda do
subject(:creator) { described_class.new }
it "returns an invokable" do
new_lambda = creator.invoke([], [])
expect(new_lambda.is_a?(Invokable)).to eq(true)
end
it "returns an invokable with arity related to ... | 27.40625 | 72 | 0.625998 |
6a9b509c5ed0bbdbd0358ab0d1cfc08e158ca116 | 3,377 | Rails.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 threaded web serve... | 41.182927 | 102 | 0.764288 |
6100a331a882c9531612dfe9ac97b3130536df97 | 380 | require_relative 'utils/intcode'
require 'set'
input = ARGF.read.split(?,).map(&:to_i)
def run(mem, origin_white: false)
pos = [0, 0]
dir = [-1, 0]
on_white = origin_white
visited = Set.new
b = Intcode.new(mem)
until b.halted?
b.continue(input: on_white ? 1 : 0)
color, turn = b.output.shift(2)
... | 15.2 | 39 | 0.631579 |
62f79afcb1a8a9870350db9f005a5567f56b8714 | 3,342 | # Copyright 2012, Dell
#
# 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, software
... | 35.935484 | 127 | 0.666667 |
4a915a89b541496d0876bb9aa9563d1b69b681ee | 239 | class RenameGoverningBodiesPositionsToHubsPositions < ActiveRecord::Migration
def up
rename_table :governing_bodies_positions, :hubs_positions
end
def down
rename_table :hubs_positions, :governing_bodies_positions
end
end
| 23.9 | 77 | 0.820084 |
39ca47468c623730c0661193551513ff2e8aeef8 | 51 | module ProgrammingJokesGem
VERSION = "0.1.0"
end
| 12.75 | 26 | 0.745098 |
ff4e89638b69c1fefcea9189a17656b4cf9ca84e | 2,066 | require 'json'
package = JSON.parse(File.read(File.join(__dir__, 'package.json')))
appPackage = JSON.parse(File.read(File.join('..', 'app', 'package.json')))
coreVersionDetected = appPackage['version']
coreVersionRequired = package['peerDependencies'][appPackage['name']]
firebase_sdk_version = appPackage['sdkVersions'... | 41.32 | 193 | 0.657793 |
1c099ca7b31710f02c93f8bb6a6521d02592f862 | 96 | module Beehive
module Taxonomies
class ApplicationJob < ActiveJob::Base
end
end
end
| 13.714286 | 42 | 0.729167 |
380e61ab49d1c0207b663fd1ee925c82d8601c0c | 1,174 | module Embulk
class JubatusClassifierOutputPlugin < OutputPlugin
require 'jubatus/classifier/client'
Plugin.register_output('jubatus_classifier', self)
def self.transaction(config, schema, processor_count, &control)
task = {
'host' => config.param('host', :string, :default => 'localhost')... | 23.019608 | 101 | 0.5954 |
e96d3cfd78c5a0308e76cf330b73d09f49105f15 | 880 | class UserDevice < ActiveRecord::Base
class RegisterService
delegate :errors, to: :user_device
def initialize(params, scoped)
@scoped = scoped
@params = params
end
def save
return true if user_device_exists?
if user_device.valid?
user_device.transaction do
w... | 19.555556 | 40 | 0.6 |
26ff731c5e39792b1ac0b8cd9e57b4b3b3291bbd | 1,290 | module Toker
class SessionsController < ApplicationController
before_action :toke!, only: :destroy
def create
@user = authenticate_with_http_basic do |email, password|
user = User.find_by email: email
if user && user.authenticate(password)
user.token.destroy if user.token
... | 24.807692 | 89 | 0.602326 |
33d5841bbe0dd5009bb29b2cf81eb69891e8eb3d | 2,546 | #!/usr/bin/ruby -w
# -*- coding: utf-8 -*-
###############################################################################
#
# Example of how to use the WriteExcel merge_cells() workbook
# method with complex formatting and rotation.
#
#
# reverse('©'), September 2002, John McNamara, jmcnamara@cpan.org
#
# original wr... | 31.825 | 79 | 0.364101 |
030c54dec5250c211c50272321c275c5d4f5329b | 595 | cask "only-switch" do
version "2.0"
sha256 "a27d7f338769f092164feb5adaaeefda3b4ef364c108d039af6acff07ee9af1a"
url "https://github.com/jacklandrin/OnlySwitch/releases/download/release_#{version}/OnlySwitch.dmg"
name "OnlySwitch"
desc "System and utility switches"
homepage "https://github.com/jacklandrin/Onl... | 28.333333 | 101 | 0.742857 |
ab9aeb9d31d47b3388a107e35eccb015cf8b92f8 | 678 | cask 'mobile-mouse-server' do
version '3.3.4'
sha256 'd113c105a5ae3d20b06cd6e47354f890b06947373c726fb0f4970f3f48a4b047'
url "http://mobilemouse.com/downloads/OS_X_Server_#{version.dots_to_underscores}.dmg"
name 'Mobile Mouse Server'
homepage 'http://mobilemouse.com/'
app 'Mobile Mouse Server.app'
unins... | 35.684211 | 102 | 0.721239 |
211fa2ff091bc9a8b22eb323d1a1cb64a272e77c | 2,012 | # The MIT License (MIT)
# Copyright (c) 2018 Mike DeAngelo Looker Data Sciences, Inc.
# 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 r... | 37.962264 | 125 | 0.697813 |
e204a205f6665b6c24d3e7c16a6f75862f7ab3bc | 1,291 | module EphJpl
module Const
USAGE = <<-EOS
[USAGE] EphJpl.new(BIN_PATH, TARGET, CENTER, JD)
[ASTRO NO] (TARGET: 1 - 15, CENTER: 0 - 13)
1: Mercury, 2: Venus, 3: Earth, 4: Mars, 5: Jupiter,
6: Saturn, 7: Uranus, 8: Neptune, 9: Pluto, 10: Moon,
11: Sun, 12: Solar system Barycenter, 13: Earth-Moon bary... | 34.891892 | 75 | 0.584818 |
6a0726f1f0ca010ed8fe9f8111b2740e56f76cc9 | 6,443 | # frozen_string_literal: true
module EE
module API
module Members
extend ActiveSupport::Concern
prepended do
params do
requires :id, type: String, desc: 'The ID of a group'
end
resource :groups, requirements: ::API::API::NAMESPACE_OR_PROJECT_REQUIREMENTS do
... | 35.016304 | 128 | 0.569455 |
ab6a8a0b8087e3199f33b2611c9429c2e32a54e1 | 3,220 | class Mypy < Formula
desc "Experimental optional static type checker for Python"
homepage "http://www.mypy-lang.org/"
url "https://github.com/python/mypy.git",
:tag => "v0.580",
:revision => "f38596dc3f078ac6705c08632a3043d8e3c9c1d5"
head "https://github.com/python/mypy.git"
bottle do
cellar ... | 38.795181 | 146 | 0.721739 |
b9c7dc3d71c9760908ed357841d7e5a561c97475 | 1,620 | require 'test_helper'
class FollowingTest < ActionDispatch::IntegrationTest
def setup
@user = users(:michael)
@other = users(:archer)
log_in_as(@user)
end
test "following page" do
get following_user_path(@user)
assert_not @user.following.empty?
assert_match @user.following.count.to_... | 27.931034 | 77 | 0.695062 |
26c692cdba612ad3c0e38c6c8cbd46333972ff5d | 1,629 | # frozen_string_literal: true
module Authlogic
# Represents the credentials *in* the cookie. The value of the cookie.
# This is primarily a data object. It doesn't interact with controllers.
# It doesn't know about eg. cookie expiration.
#
# @api private
class CookieCredentials
# @api private
class... | 25.453125 | 86 | 0.644567 |
d53ee2d069b8b7f96efd1b4f952712c863b16e20 | 6,253 | require 'spec_helper'
require 'fakefs/spec_helpers'
require 'zip'
module LicenseFinder
def self.broken_fakefs?
RUBY_PLATFORM =~ /java/ || RUBY_VERSION =~ /^(1\.9|2\.0)/
end
describe Nuget do
it_behaves_like 'a PackageManager'
describe '#assemblies' do
include FakeFS::SpecHelpers
before... | 35.936782 | 115 | 0.626739 |
e2729ab0bc8f588dd8c8c42cc513c34635813aa8 | 1,533 | # http://www.codewars.com/kata/common-substrings
# --- iteration 1 ---
def substring_test(str1, str2)
return false unless str1.size > 1 && str2.size > 1
puts "str1: #{str1.inspect}"
puts "str2: #{str2.inspect}"
str1_down, str2_down = [str1, str2].map(&:downcase)
smaller, larger = [str1_down, str2_down].sort_b... | 24.725806 | 64 | 0.630789 |
089899ea857d7cab7630f19ff63cd069738532ca | 1,714 | class DrugsController < ApplicationController
actions_without_auth :index, :existence, :name_suggestion, :local_name_suggestion
def index
drugs = Drug.page(params[:page])
.per(params[:count])
drugs = name_search(pubchem_id_search(drugs))
render json: drugs.map { |d| { name: d.name, pubchem_id:... | 28.098361 | 94 | 0.676196 |
7905aee51b82c72da77a31ccb510675fc9cb93ff | 1,599 | #!/usr/bin/env ruby
# Copyright (c) 2008-2012, Edd Barrett <vext01@gmail.com>
#
# Permission to use, copy, modify, and/or distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# copyright notice and this permission notice appear in all copies.
#
# THE SOFTWARE IS PR... | 28.052632 | 74 | 0.707942 |
e8efe70e2c24d89295aae305089e8967d6012bca | 2,910 |
require "capybara/rspec"
require "./app"
require "pry"
require('spec_helper')
Capybara.app = Sinatra::Application
set(:show_exceptions, false)
# Your project should be set up so that a volunteer can only be created if a project already exists. (This makes it easier to assign the one to many relationship in Sinatra.)... | 42.794118 | 271 | 0.710997 |
e21e3b34063da412b86d307c78cff8e60a5ac87e | 340 | cask 'font-poller-one' do
version :latest
sha256 :no_check
# github.com/google/fonts was verified as official when first introduced to the cask
url 'https://github.com/google/fonts/raw/master/ofl/pollerone/PollerOne.ttf'
name 'Poller One'
homepage 'https://www.google.com/fonts/specimen/Poller+One'
font ... | 28.333333 | 86 | 0.75 |
f71417276018236f5dc7fbbc9ecf50bbd0409e37 | 1,121 | $:.push File.expand_path('../lib', __FILE__)
# Maintain your gem's version:
require 'symmetric_encryption/version'
# Describe your gem and declare its dependencies:
Gem::Specification.new do |s|
s.name = 'symmetric-encryption'
s.version = SymmetricEncryption::VERSION
s.platform ... | 46.708333 | 174 | 0.595897 |
ac7abcaf91da28edec423918d7ec7432a50aa2df | 3,366 | require "spec_helper"
describe Mongoid::Relations::Bindings::Embedded::In do
let(:person) do
Person.new
end
let(:name) do
Name.new
end
let(:address) do
Address.new
end
let(:name_metadata) do
Name.relations["namable"]
end
let(:address_metadata) do
Address.relations["addressabl... | 19.569767 | 62 | 0.574272 |
3303b148a670900f8f73eaa78dfc84ffae5848be | 91 | # frozen_string_literal: true
require 'rails_helper'
RSpec.describe NoteDecorator do
end
| 13 | 31 | 0.824176 |
62e1d67c5e26caf95cf501dd7870fc81ae07b0fb | 808 | # encoding: utf-8
$:.unshift File.expand_path('../lib', __FILE__)
require 'glynn/version'
Gem::Specification.new do |s|
s.name = "glynn"
s.version = Glynn::VERSION
s.authors = ["Damien MATHIEU"]
s.email = "42@dmathieu.com"
s.description = "Deploy a jekyll weblog through ftp"
s.su... | 27.862069 | 55 | 0.626238 |
18bbba8e5ee70b0b4bca7729743c7578b3aeec44 | 7,973 | #
# Cookbook Name:: redisio
# Provider::install
#
# Copyright 2012, Brian Bianco <brian.bianco@gmail.com>
#
# 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/license... | 35.753363 | 116 | 0.6147 |
790c2a1969db73381690c9b7c9662724e12789b0 | 931 | require "spec_helper"
require "hamster/list"
describe Hamster::List do
[:union, :|].each do |method|
describe "##{method}" do
it "is lazy" do
-> { Hamster.stream { fail }.union(Hamster.stream { fail }) }.should_not raise_error
end
[
[[], [], []],
[["A"], [], ["A"]],... | 18.62 | 92 | 0.443609 |
3854dd27e5fe019e43fe5da97e558eea8495d5e2 | 1,415 | require 'spec_helper'
describe Myaccount::OverviewsController do
render_views
before(:each) do
activate_authlogic
@user = create(:user)
login_as(@user)
end
it "show action should render show template" do
get :show
response.should render_template(:show)
end
it "show action should re... | 27.745098 | 124 | 0.713074 |
6a07aa18693b023692982b311f7cb8aae6c0f4d9 | 7,228 | require 'spec_helper'
require 'pdk/module/update_manager'
describe PDK::Module::UpdateManager do
subject(:update_manager) { described_class.new }
let(:dummy_file) { File.join(Dir.pwd, 'test_file') }
describe '#initialize' do
it 'has no pending changes by default' do
expect(update_manager.changes?).to... | 29.622951 | 128 | 0.61995 |
21d523372206149c0fc392458d7eeb1da5e71711 | 1,304 | require_relative 'boot'
require "rails"
# Pick the frameworks you want:
require "active_model/railtie"
require "active_job/railtie"
# require "active_record/railtie"
# require "active_storage/engine"
require "action_controller/railtie"
# require "action_mailer/railtie"
require "action_view/railtie"
# require "action_c... | 31.047619 | 82 | 0.742331 |
031027ea79d261c56c90a79798aca49828bf48e7 | 472 | class StiForTransactions < ActiveRecord::Migration
def self.up
rename_table "creditcard_txns", "transactions"
add_column "transactions", "type", :string
remove_column "transactions", "creditcard_id"
Transaction.update_all(:type => 'CreditcardTxn') if defined? Transaction
end
def self.down
ren... | 31.466667 | 76 | 0.741525 |
2611e0d2af821bb2d047db241c596b74ae604dff | 1,440 | module Chatmeter
class API
# GET /reviewBuilder/campaign/get
def list_all_campaigns
request(
expects: 200,
method: :get,
path: "/reviewBuilder/campaign/get"
)
end
# POST /reviewBuilder/campaign/create
def create_new_campaign(params)
request(
... | 23.606557 | 84 | 0.581944 |
4a5b5a7813027eaa35b99ad1e08a74313f1fcded | 1,564 | require 'scrape_driver'
class ReadingScraper
attr_reader :twine
TEMP_SELECTOR = ".temperature-value"
def initialize(twine)
@twine = twine
end
def get_reading
temp = get_temp_from_supermechanical
make_and_return_reading_from_temp(temp)
end
private
def get_temp_from_supermechanical
... | 24.061538 | 85 | 0.715473 |
036f629530079cb6ff5f61ca2f00aa389c873d0d | 1,402 | # Copyright 2011-2013 Amazon.com, Inc. or its affiliates. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"). You
# may not use this file except in compliance with the License. A copy of
# the License is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the "license" fil... | 28.04 | 83 | 0.723966 |
6a1c08af59f367373216fc90f0f7512523460f32 | 1,035 | module Arango
class Server
module Batch
# === BATCH ===
def batch(requests: [])
Arango::RequestBatch.new(server: self, requests: requests)
end
def create_dump_batch(ttl:, dbserver: nil)
query = { DBserver: dbserver }
body = { ttl: ttl }
result = request("P... | 28.75 | 80 | 0.566184 |
e28e5ddec323b119c39af6b138a090d1514c8b80 | 470 | class MiqWorker
module ReplicaPerWorker
extend ActiveSupport::Concern
def create_container_objects
ContainerOrchestrator.new.create_deployment(worker_deployment_name) do |definition|
configure_worker_deployment(definition)
end
scale_deployment
end
def delete_container_objec... | 22.380952 | 89 | 0.761702 |
870ceee61d1be3c6724ef3a642eed99e7a162a1b | 7,151 | =begin
#Fatture in Cloud API v2 - API Reference
#Connect your software with Fatture in Cloud, the invoicing platform chosen by more than 400.000 businesses in Italy. The Fatture in Cloud API is based on REST, and makes possible to interact with the user related data prior authorization via OAuth2 protocol.
The vers... | 30.95671 | 261 | 0.632779 |
03ee5b9e2a40f236437ea271c7d812dfe8a4ed2e | 4,440 | # Manage SELinux context of files.
#
# This code actually manages three pieces of data in the context.
#
# [root@delenn files]# ls -dZ /
# drwxr-xr-x root root system_u:object_r:root_t /
#
# The context of '/' here is 'system_u:object_r:root_t'. This is
# three seperate fields:
#
# system_u is the user contex... | 35.806452 | 119 | 0.707658 |
ab4c80224b2966966dff838aabf704a892ba4ff0 | 724 | # -*- encoding: utf-8 -*-
require File.expand_path('../lib/legacy_model_generator/version', __FILE__)
Gem::Specification.new do |gem|
gem.authors = ["Allan Davis"]
gem.email = ["cajun.code@gmail.com"]
gem.description = %q{Model from legancy database}
gem.summary = %q{Tools for creating mo... | 38.105263 | 75 | 0.643646 |
39145a0ddc14402b5ae313cc7e8bde8bb5d1cba5 | 10,987 | require 'tempfile'
module Acceptance; end
module Acceptance::Helpers; end
# Methods to support 'simp kv' testing. Data is generated by the kv_test
# Puppet module.
module Acceptance::Helpers::KvTestData
# @return Hash of initial keys to be pre-seeded in the 'default' and 'custom'
# backends via the kv_test m... | 31.846377 | 86 | 0.48612 |
185999c4fb3a9d99bd8cd204a926c260909567e1 | 3,187 | # frozen_string_literal: true
require 'json'
require 'active_support/core_ext/hash/indifferent_access'
require 'active_support/core_ext/hash/except'
require_relative 'active_records/base'
require_relative 'active_records/matches'
require_relative 'active_records/rankings'
require_relative 'active_records/rounds'
requ... | 30.066038 | 78 | 0.706934 |
5d22bbfb32e5c45a94da29922188eeeee72a061f | 559 | # 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::MachineLearningServices::Mgmt::V2019_05_01
module Models
#
# Defines values for ComputeType
#
module ComputeType
AKS =... | 25.409091 | 70 | 0.692308 |
ede33fbd6bac994a7422179e371ca7b5e49e5c67 | 1,043 | Pod::Spec.new do |s|
s.name = "ObjectivePGP"
s.version = "0.13.0"
s.summary = "OpenPGP for iOS and macOS"
s.description = "Native OpenPGP (RFC 4880) implementation for iOS and macOS."
s.homepage = "http://objectivepgp.com"
s.license = { :type => 'BSD for non-commercial use', :fil... | 34.766667 | 84 | 0.639501 |
218f2e99f8d5c7771d532296804cac466772379c | 342 | require './spec/spec_helper'
describe Player do
subject { Player.new 1, 'TestUser' }
let(:company) { Company.new subject, *(['BSE'].concat Company::COMPANIES['BSE']) }
describe '#value' do
it 'should add up everything' do
subject.companies << company
expect(subject.value).to eq(30 + company.valu... | 22.8 | 84 | 0.660819 |
1d39b123f06b5fc59b4572e367d680853989db45 | 194 | class UsersController < ApplicationController
def show
@user = User.find(params[:id])
@images = @user.images
end
def index
@users = User.all.order(username: :desc)
end
end
| 16.166667 | 45 | 0.670103 |
116b13617205a8626a756b02d60a56437514a967 | 4,327 | # -*- coding: utf-8 -*- #
# frozen_string_literal: true
# TODO how are we going to handle soft/hard contrast?
module Rouge
module Themes
# Based on https://github.com/morhetz/gruvbox, with help from
# https://github.com/daveyarwood/gruvbox-pygments
class Gruvbox < CSSTheme
name 'gruvbox'
# ... | 25.304094 | 66 | 0.587243 |
33865bd454ba6cb0a088016ea2d824addb064805 | 3,613 | Rails.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 threaded web serve... | 41.056818 | 102 | 0.760864 |
1a97f32e8b10929348ee5a5ab424d1cebd30fcaf | 9,173 | #--
# Copyright (c) 2012+ Damjan Rems
#
# 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,
# ... | 40.588496 | 145 | 0.584651 |
e270274193ef3a5434b57414a51d1d201d00aa80 | 2,059 | shared_examples "date_time_for" do |field|
it "returns date" do
subject.public_send("#{field}=", Time.zone.local(2012, 9, 6, 1, 30))
expect(subject.public_send("#{field}_date")).to eq(Date.civil(2012, 9, 6))
end
it "returns seconds of beginning of day" do
subject.public_send("#{field}=", Time.zone.lo... | 41.18 | 80 | 0.654687 |
5d2c9861e269b20a99ee34e216127f57a9d9533f | 197 | # typed: false
class F
sig {void}
def method1
end
def method2
# ^^^ error: Hint: this "def" token might not be properly closed
puts 'hello'
end # error: unexpected token "end of file"
| 17.909091 | 64 | 0.670051 |
38e290f2186bdcf012c35661066b56b414fff47b | 977 | require "test_helper"
class ConversationPresenterTest < ActiveSupport::TestCase
context "#optimized_present_all" do
should "present the same content as #unoptimized_present_all" do
ability = Class.new do
def can?(*args)
true
end
end.new
user = User.first
conve... | 28.735294 | 94 | 0.714432 |
0179f41ec6a1d78e06c8dd1cc4435016804c2b0e | 4,083 | Rails.application.configure do
# Verifies that versions and hashed value of the package contents in the project's package.json
config.webpacker.check_yarn_integrity = false
# Settings specified here will take precedence over those in config/application.rb.
# Code is not reloaded between requests.
config.cach... | 42.092784 | 102 | 0.759491 |
e862076aa5475d64232accd580876c8c69667ab0 | 3,217 | module Natalie
class Compiler
class MultipleAssignment
def initialize(exp, value_name)
@exp = exp
@value_name = value_name
end
attr_reader :exp, :value_name
def generate
(_, names, val) = exp
names = names[1..-1]
val = val.last if val.sexp_type == ... | 35.351648 | 131 | 0.54212 |
79aa5121bc466302ec10ef88c483811b10d95eef | 98 | Spree::Core::Engine.routes.draw do
namespace :admin do
resources :odmailers
end
end
| 16.333333 | 34 | 0.683673 |
1ca61375ed14751e4b1f6127d217542dc0de9569 | 8,083 | require 'rails_helper'
feature 'Course Coaches Index', js: true do
include UserSpecHelper
include SubmissionsHelper
# Setup a course with a single founder target, ...
let!(:school) { create :school, :current }
let!(:school_2) { create :school }
let!(:course_1) { create :course, school: school }
let!(:co... | 40.61809 | 113 | 0.731535 |
380b1d38036171cf94af8c844a90aebda228530c | 8,941 | # typed: false
# frozen_string_literal: true
describe "globally-scoped helper methods" do
let(:dir) { mktmpdir }
def esc(code)
/(\e\[\d+m)*\e\[#{code}m/
end
describe "#ofail" do
it "sets Homebrew.failed to true" do
expect {
ofail "foo"
}.to output("Error: foo\n").to_stderr
... | 28.205047 | 86 | 0.614473 |
5d8eaa8f8d9f091e0279cbb129f32d055932d315 | 636 | # encoding: utf-8
$:.unshift File.expand_path('../lib', __FILE__)
require 'travis/config/version'
Gem::Specification.new do |s|
s.name = "travis-config"
s.version = TravisConfig::VERSION
s.authors = ["Travis CI"]
s.email = "contact@travis-ci.org"
s.homepage = "https://github.com... | 27.652174 | 61 | 0.591195 |
1a64847065b3d3adc5d8c8e387240c899089fd2d | 3,174 | #-- copyright
# OpenProject is a project management system.
# Copyright (C) 2012-2018 the OpenProject Foundation (OPF)
#
# 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 of ... | 26.898305 | 91 | 0.655955 |
6a3248b73b9773c9386ef55ee5c252796f0568aa | 726 | cask 'konica-minolta-bizhub-c220-c280-c360-driver' do
version '3.11.0,201606.27043313'
sha256 '236d1fd8acf2888ac48668eebf02aa8de567d0f481142e2ac9d4d7b2a9100587'
# konicaminolta.com was verified as official when first introduced to the cask
url "https://o.cses.konicaminolta.com/file/Default.aspx?FilePath=DL/#{v... | 45.375 | 183 | 0.797521 |
33f72b2e16c285ec32aa092476be3be235ecf2fd | 291 | class ApplicationController < ActionController::API
before_action :configure_permitted_parameters, if: :devise_controller?
protected
def configure_permitted_parameters
devise_parameter_sanitizer.permit(:sign_up, keys: [:name, :email, :password, :password_confirmation])
end
end | 32.333333 | 105 | 0.810997 |
281c076c386511f07b9476c5301f9405707f750e | 8,786 | # 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... | 43.280788 | 245 | 0.688595 |
03980aab0c46aa654aa8534103eaa31c97a02af3 | 1,837 | module Utils
class Bottles
class << self
def tag
if MacOS.version >= :lion
MacOS.cat
elsif MacOS.version == :snow_leopard
Hardware::CPU.is_64_bit? ? :snow_leopard : :snow_leopard_32
else
# Return, e.g., :tiger_g3, :leopard_g5_64, :leopard_64 (which is In... | 30.616667 | 90 | 0.597714 |
1a9563780cd8b3c3d40729b152d4f117b753127f | 837 | # coding: utf-8
lib = File.expand_path('../lib', __FILE__)
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
require 'codebreaker/version'
Gem::Specification.new do |spec|
spec.name = "codebreaker"
spec.version = Codebreaker::VERSION
spec.authors = ["Sergey Prokopchuk"]
spec.email ... | 34.875 | 74 | 0.639188 |
bb86cc1b7fa29fad69023c7dfe7a91552b7938bf | 1,910 | require File.expand_path('../spec_helper', __FILE__)
describe Cequel::Record::Timestamps do
model :Blog do
key :subdomain, :text
column :name, :text
timestamps
end
model :Post do
key :blog_subdomain, :text
key :id, :timeuuid, auto: true
column :name, :text
timestamps
end
let!(:n... | 28.939394 | 79 | 0.691623 |
91d17b3ddb001e49969bde341486c644e0dea8b3 | 4,639 | include_recipe 'dpkg_autostart'
require "base64"
include_recipe 'bcpc-hadoop::hadoop_config'
%w{hadoop-hdfs-namenode hadoop-hdfs-zkfc}.each do |pkg|
dpkg_autostart pkg do
allow false
end
package pkg do
action :upgrade
end
end
node[:bcpc][:hadoop][:mounts].each do |d|
directory "/disk/#{d}/dfs/nn" do... | 33.615942 | 135 | 0.705756 |
ed0fda078d1389f3bcf27c42cd5c98f0c28a8301 | 277 | module RRImm
class Publisher
# will receive in order:
# - formatted item
# - raw feed
# - raw item
def publish(*args)
raise "You have to implement this method"
end
end
end
require_relative 'publisher/pipe'
require_relative 'publisher/reddit'
| 18.466667 | 47 | 0.67148 |
1abe4254421a5397a8b7fccef7fbbb4fce092d7f | 1,118 | $:.push File.expand_path("../lib", __FILE__)
# Maintain your gem's version:
require "blog/gem/version"
# Describe your gem and declare its dependencies:
Gem::Specification.new do |s|
s.name = "blog-gem"
s.version = Blog::Gem::VERSION
s.authors = ["Vincent Thelang", "Michael Hoffmann"]
s.email ... | 32.882353 | 83 | 0.683363 |
5de64678d33d72a8cd105f7af8539f6b81eb73ad | 1,012 | require 'spec_helper_integration'
feature 'Implicit Grant Flow Errors' do
background do
config_is_set(:authenticate_resource_owner) { User.first || redirect_to('/sign_in') }
client_exists
create_resource_owner
sign_in
end
after do
access_token_should_not_exist
end
[
[:client_id, ... | 31.625 | 111 | 0.719368 |
1af8d1ec800c889680437b57512392716e137409 | 9,237 | =begin
#Influx API Service
#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
The version of the OpenAPI document: 0.1.0
Generated by: https://openapi-generator.tech
OpenAPI Generator version: 5.0.0-beta3
=end
require 'date'
require 'time'
module InfluxDB2:... | 28.865625 | 203 | 0.605608 |
1825bc86b522eaad8698c21b9c45ec7329a9bb8a | 5,008 | #
# Be sure to run `pod spec lint QRCodeScan.podspec' to ensure this is a
# valid spec and to remove all comments including this before submitting the spec.
#
# To learn more about Podspec attributes see http://docs.cocoapods.org/specification.html
# To see working Podspecs in the CocoaPods repo see https://github.... | 36.289855 | 97 | 0.588059 |
28dec342378e2302a7eec847e05d61d180576979 | 24,612 | #!/usr/bin/env rspec
require 'spec_helper'
provider_class = Puppet::Type.type(:augeasprovider).provider(:default)
describe provider_class do
context "empty provider" do
class Empty < provider_class
end
subject { Empty }
describe "#lens" do
it "should fail as default lens isn't set" do
... | 37.290909 | 168 | 0.602105 |
f77a075990fd945cfddf75af71e209c8176bed0d | 8,673 | module CanvasCsv
# Updates users currently present within Canvas.
# Used by CanvasCsv::RefreshAllCampusData to maintain officially enrolled students/faculty
# See CanvasCsv::AddNewUsers for maintenance of new active CalNet users within Canvas
class MaintainUsers < Base
include ClassLogger
attr_accessor ... | 45.888889 | 166 | 0.677044 |
e2cdf3108f7ce00ba7b1ae13a1a9b46caa013b96 | 253 | Deface::Override.new(:virtual_path => 'spree/orders/_line_item',
:name => "add_id_to_tr_line_item",
:set_attributes => 'tr',
:attributes => {:id => 'line-item-<%= line_item.variant_id %>'})
| 50.6 | 85 | 0.517787 |
edd2b78df1bc9ecc4d57425374a5f64f8e353cd3 | 90 | $LOAD_PATH.unshift File.expand_path('../../lib', __FILE__)
require 'jquery_image_gallery'
| 30 | 58 | 0.766667 |
4ada9df652aeb27d945ec8485e000e4bb3507b18 | 501 | class SuppliesController < ApplicationController
def new
render :new, :layout => false
end
def show
@supply = Supply.find(params[:id])
end
def edit
@supply = Supply.find(params[:id])
end
def destroy
@supply = Supply.find(params[:id])
@supply.destroy
redirect_to home_path
end
def update
@sup... | 15.65625 | 48 | 0.712575 |
d5d86a14181056797626e975325329888086340d | 1,296 | cask "brave-browser-beta" do
version "91.1.26.60,126.60"
if Hardware::CPU.intel?
sha256 "1939eb8438b1ae1d1ea90458c570b047220ae166c50048d75a5c3cfff049bfac"
url "https://updates-cdn.bravesoftware.com/sparkle/Brave-Browser/beta/#{version.after_comma}/Brave-Browser-Beta-x64.dmg",
verified: "updates-cd... | 32.4 | 137 | 0.738426 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.