blob_id
stringlengths
40
40
language
stringclasses
1 value
repo_name
stringlengths
4
137
path
stringlengths
2
355
src_encoding
stringclasses
31 values
length_bytes
int64
11
3.9M
score
float64
2.52
5.47
int_score
int64
3
5
detected_licenses
listlengths
0
49
license_type
stringclasses
2 values
text
stringlengths
11
3.93M
download_success
bool
1 class
f6986c8abf5fc40899c0e1b6a5b47140b21d5f9c
Ruby
cloudfoundry-attic/git_pipeline
/app/models/stage.rb
UTF-8
371
2.609375
3
[]
no_license
class Stage attr_reader :name, :ci_url, :git_log, :git_submodule_change_log def initialize(name, ci_url, git_log, git_submodule_change_log) @name = name @ci_url = ci_url @git_log = git_log @git_submodule_change_log = git_submodule_change_log end def has_ci_url? !!@ci_url end def pendi...
true
20c528d7812b2daed5c8a56774b33940f806c4d5
Ruby
Coderdotnew/intro_web_apps_bs
/10_class/03_hash_enumerables/code/01_recipes/spec/recipes_spec.rb
UTF-8
1,974
3.03125
3
[]
no_license
require_relative './spec_helper' require_relative '../recipes.rb' $taco_ingredients = { :tortilla => "3", :shredded_chicken => "2 cups", :salsa => "1 cup", :shredded_cheddar_cheese => "3 cups" } describe '#ingredients' do it "returns a hash of all 4 ingredients and amounts" do expect(ingredients($taco_i...
true
f8ba568b511c2f7b593327ee87168529325965fe
Ruby
malachispencer/codewars
/ruby/6kyu/christmas-day.rb
UTF-8
4,411
4.5
4
[]
no_license
=begin Codewars. 14/05/20. 'Christmas Day'. 6kyu. Here we create a method that tells us what day christmas on a particular year falls on. Here is the solution I developed to solve the challenge. 1) We require the date library. 2) We generate an array of the day names using the date library's built-in constant DAYN...
true
3f34f5ff2d791dd0e998713ce9be295d8af1dde2
Ruby
hinrik/ircsupport
/test/case_test.rb
UTF-8
1,469
2.703125
3
[ "MIT" ]
permissive
# coding: utf-8 require 'test_helper' include IRCSupport::Case describe "IRCUpcase" do it "should put string into IRC uppercase" do irc_upcase("simple").must_equal "SIMPLE" irc_upcase("c0mpl^{x}").must_equal "C0MPL~[X]" irc_upcase("c0mpl~[x]").must_equal "C0MPL~[X]" irc_upcase("c0mpl~{x}").must_equ...
true
93b66bd398d7c0100c67ac7dbbdc9c56c00ccc69
Ruby
tnordloh/ltl_packer
/best_fit_decreasing_combinations.rb
UTF-8
1,252
2.578125
3
[ "MIT" ]
permissive
#! /usr/bin/env ruby # frozen_string_literal: true require 'ltl_packer' require_relative 'data' trucks = @trucks.map { |truck| truck = LtlPacker::Truck.new(*truck.to_a) } shipments = @shipments.map { |shipment| shipment = LtlPacker::Shipment.new(*shipment.to_a) } loader = LtlPacker::Loader.new(trucks: trucks, shipmen...
true
d48a1e09b79d93343d97c1f0a7c71df1b289826c
Ruby
javogel/IH_Coursework
/Week_2/Day_4/sinatra_blog/spec/post_spec.rb
UTF-8
714
2.78125
3
[]
no_license
# spec/post_spec.rb require_relative("../lib/Post.rb") RSpec.describe Post do before(:each) do @post1 = Post.new("title1", "1", "Hello My name is post 1", "Category0", "author0") @post2 = Post.new("title2", "2", "Hello My name is post 2", "Category1", "author1") end it("#title returns title") do expect(@post1...
true
8907310caa6a536c70dfbd7804834832495c38fb
Ruby
jjnewman/DDDT
/lib/product.rb
UTF-8
374
3.1875
3
[]
no_license
class Product require 'rubygems' require 'json' def initialize json = File.read('products.json') @items = JSON.parse(json) end def all_items @items[0] end def all_item_names all_items.keys end def item_price(item) all_items[item]["Price"] end def item_category(item) all_items[item]["Category"] end de...
true
65270c12cf6af95c6cbd7009ddd3c1334f3ee988
Ruby
tackyunicorn/hello-ruby
/methods.rb
UTF-8
206
4.1875
4
[]
no_license
# Define a method block using def and end # Pass parameters and give default values def sayhi(name="no name" , age=-1) puts ("Hello " + name + ", you are " + age.to_s) end puts "Top" sayhi("Mike" , 73)
true
488321879407a196f8e24a6e20d1ed35fcc39c9c
Ruby
JPuchalla/backend_module_0_capstone
/day_1/ex3.rb
UTF-8
1,068
4.4375
4
[]
no_license
puts "I will now count my chickens:" # In hens the line is asking ruby what 25 plus 30 divided by 6 is. # In roosters line its asking ruby what 100 minus 25 times 3 modulus 4. Modulus meaning Divides left hand operand by right hand operand and returns remainder puts "Hens #{25.0 + 30.0 / 6.0}" puts "Roosters #{100.0 - ...
true
9c187e20cc273e24ca8e9d88d4deb4a255da3b6e
Ruby
alexHampton/Ruby
/Ruby/rspec_and_tdd/TDD_projects/spec/projects_spec.rb
UTF-8
5,235
3.859375
4
[]
no_license
require 'rspec' require 'projects.rb' describe Array do subject(:array) { Array.new } describe '#my_uniq' do let(:array) { [1,2,3,2,4,5,5] } it 'takes in an Array and returns a new array' do expect(array.my_uniq.class).to be(Array) end it 'contains every unique it...
true
54ce85fdb9530238dd131d84313c7a5a8fc368cd
Ruby
itsolutionscorp/AutoStyle-Clustering
/all_data/exercism_data/src/1364.rb
UTF-8
139
2.90625
3
[]
no_license
def compute(first, second) first.chars .zip(second.chars) .reject(&LEFTOVER_CHARS) .count(&DIFFERENT_PAIRS) end end
true
ff00b42dc45db4b20937d05ed98349d211cdcd9c
Ruby
pofystyy/codewars
/6 kyu/create_a_frame.rb
UTF-8
1,015
3.921875
4
[]
no_license
# https://www.codewars.com/kata/5672f4e3404d0609ec00000a # Details: # ************************* # * Create a frame! * # * __ __ * # * / \~~~/ \ * # * ,----( .. ) * # * / \__ __/ * # * /| (\ |( * # * ^ \ /___\ /\ | * # * |__| |__|-.. ...
true
1c8341eb96f54b4ac76b2841f16dbd8789241150
Ruby
sclinede/ruby-patterns
/singleton.rb
UTF-8
419
3.265625
3
[]
no_license
# Define an unique instance of an object class HeroFactory @@instance = nil def self.instance @@instance ||= HeroFactory.send(:new) end def create_warrior Warrior.new end def create_mage Mage.new end private_class_method :new end # Usage factory = HeroFactory.instance another_factory = ...
true
1cc6e73d04c5edce2d62d227dbe17a33187e384b
Ruby
brentvatne/jester
/spec/requests/remember_story_spec.rb
UTF-8
978
2.65625
3
[]
no_license
describe Jester::Request::RememberStory do include MailTestHelpers describe "handling" do let(:invalid_message) { email(:subject => 'some invalid string') } let(:fishing) { email(:subject => "a funny story 'the time i went fishing from a helicopter'" ) } subject { Jester::Request::RememberStory } ...
true
f93730815becff334401ad02b430ee7c7337870b
Ruby
nkokkos/ruby-locklizard
/lib/locklizard/helper_methods.rb
UTF-8
1,332
2.546875
3
[ "MIT" ]
permissive
module HelperMethods # include LockLizardEndPoints constants as constants to the following methods include LockLizardEndPoints #helper methods: def success?(response = nil) raise ArgumentError if response.nil? response.to_str.split("\n").first.gsub(/\n/,'') == SUCCESS end def faile...
true
278c49e7576282604eeda230c97d26db1155b7e6
Ruby
zeuslopesqa/RubyCucumberCapybara-trivago_project
/features/support/pages/home_page.rb
UTF-8
1,360
2.609375
3
[]
no_license
require 'securerandom' class HomePage include Capybara::DSL def go visit "" end def click_contact find('a', text: 'Contact').click end def fill_email_newsletter() #"SecureRandom.alphanumeric(8) + '@mailinator.com'" is afunction to # generatic an ran...
true
1db37a5d618d12565fc63a9dd2f7f20c68187947
Ruby
cielavenir/procon
/hackerrank/grid-challenge.rb
UTF-8
130
2.921875
3
[ "0BSD" ]
permissive
#!/usr/bin/ruby gets.to_i.times{ a=gets.to_i.times.map{gets.chomp.chars.sort}.transpose puts a.all?{|e|e.sort==e} ? :YES : :NO }
true
5b06b28420988985e25a7735806889abd7739ddf
Ruby
Haysonho/programming-exercise
/22-missing.rb
UTF-8
280
3.953125
4
[]
no_license
# 给定一阵列内含数字,请输出 0~9 中不见的数字 def find_missing(arr) missing_num = [] (0..9).each do |i| missing_num << i unless arr.include?(i) end missing_num end answer = find_missing( [2,2,1,5,8,4] ) puts answer.to_s # 应该是 [0,3,6,7,9]
true
fa10fa566adae17e9989c1bff17e5d2e0ea3b87d
Ruby
Fish-bowl/ruby-golf
/hole_2.rb
UTF-8
716
3.578125
4
[]
no_license
require 'pry' # def rps #gets player choice # choice = gets.chop #sets comp selection choices # @cs = random.new # @cs = %w[r p s].sample # binding.pry # to_assoc(1) # @index = @cs.index(@cs) # @winning_choice = @index[@index - 1] # binding.pry # (choice == @cs) ? (exit) : (choice == @winning_ch...
true
3416506e481b5994a1a22afe72df6f765aaa2951
Ruby
brandonbrown4792/furry-finder
/app/ui_methods/shelter_menu.rb
UTF-8
2,031
3.609375
4
[ "LicenseRef-scancode-unknown-license-reference", "LicenseRef-scancode-public-domain" ]
permissive
def shelter_menu(shelter) choices = ["View Profile", "Update Shelter Name", "Update Shelter Address", "Add Dog", "Update Dog", "Logout"] choice = PROMPT.select("Select an option below:", choices) case choice when "View Profile" shelter_view_profile(shelter) when "Update Shelter Name" shelter_update_n...
true
1d5d9525e7c2f6fb778c5cfa0e5626313a62998f
Ruby
aniltimt/finna-be-octo-hipster
/app/models/app_config.rb
UTF-8
479
2.609375
3
[]
no_license
class AppConfig < ActiveRecord::Base class << self def [](key) pair = find_by_key(key) pair.value unless pair.nil? end def []=(key, value) pair = find_by_key(key) unless pair pair = new pair.key, pair.value = key, value pair.save else pair.val...
true
bd7a673c635d1425d0a98ebb212eed962282a322
Ruby
Encolpius/ruby-building-blocks
/stock-picker/stock-picker.rb
UTF-8
486
3.4375
3
[]
no_license
def stock_picker(days) buy_sell = [] $sum = 0 def stock(days, sub_days, sum, buy_sell) temp = sub_days.map { |day| day - sub_days[0]}.max if temp > $sum buy_sell[0] = days.index(sub_days.min) buy_sell[1] = days.index(sub_days.max) $sum = temp end return $sum end while days...
true
96d8fdef352c74d9968f2a2c4db06988e477a775
Ruby
ddrscott/heart_of_five
/lib/heart_of_five/meld.rb
UTF-8
2,531
3.34375
3
[ "MIT" ]
permissive
module HeartOfFive class Meld attr_reader :cards, :strength def initialize(cards) @cards = cards end def two_of_a_kind? @two_of_a_kind ||= x_of_a_kind?(2) end def three_of_a_kind? @three_of_a_kind ||= x_of_a_kind?(3) end def four_of_a_kind? @four_of_a_kind |...
true
854fdd24a13d36ad68ebbc208d154bcaf6ffd1e9
Ruby
Payal13/training_assignments
/Ashish/day3/new_symbol_test.rb
UTF-8
396
2.75
3
[]
no_license
class No attr_reader :No attr_reader :Not def initialize @@Not = 120 @No = 10 end def self.Not " This is not method #{:Not.object_id}" end def No print :No.object_id puts "\n This not variable "+ @@Not.to_s print " It is from Symbol_Test " @No end end s = No.new p No.N...
true
b4183c37d8dd453820f5b531f7450fc03521cede
Ruby
frop/Parsoca
/app/models/time_bank.rb
UTF-8
1,853
2.625
3
[]
no_license
class TimeBank < ActiveRecord::Base belongs_to :user def self.from_hours(hours) h,m = hours.split(":") if h.to_i > 0 h.to_i * 60 + m.to_i else h.to_i * 60 - m.to_i end end def self.calculate(user, current_interval) last_time_bank = user.time_banks.where('date < ?', current_...
true
00480bad9cd64078d26a53e367e8c6feae1b94a4
Ruby
rmwerner18/ruby-enumerables-hash-practice-emoticon-translator-lab-nyc01-seng-ft-071320
/lib/translator.rb
UTF-8
914
3.21875
3
[ "LicenseRef-scancode-unknown-license-reference", "LicenseRef-scancode-public-domain" ]
permissive
require 'yaml' require 'pry' def load_library(file) emoticons = YAML.load_file(file) keys = emoticons.keys count = 0 while count < keys.length do emoticons[keys[count]] = {english: emoticons[keys[count]][0], japanese: emoticons[keys[count]][1]} count += 1 end emoticons end def get_japanese_emotico...
true
2906926a9f9cf1014b2b7ea2d286981bce96c7a3
Ruby
jsuabur/libro-de-actividades
/actividades/prog/files/ruby/empezando/lib/02.clases/clases02.rb
UTF-8
364
3.984375
4
[ "CC0-1.0", "CC-BY-SA-3.0" ]
permissive
#!/usr/bin/ruby puts "[#{$0}] Antes de definir la clase animal" class Animal puts " [Clase Animal] Estamos dentro" attr_accessor :nombre def info puts "Hola soy Animal: "+@nombre end puts " [Clase Animal] Saliendo de dentro de la clase animal" end puts "[#{$0}] Después de definir la clase animal\n\...
true
4df9d50a34482284b50e701954461689b86e60bf
Ruby
codeforamerica/data-portal-info-collector
/data_portal_info_collector/csv_to_json.rb
UTF-8
792
2.59375
3
[]
no_license
#!/usr/bin/env ruby require 'csv' require 'json' places_array = [] state_hash = {} CSV.foreach("lib/states.csv", { :col_sep => "\t" }) do |row| state_hash[row[2]] = row[8] if row[8] != "Name" end CSV.foreach("lib/counties.csv", { :col_sep => "\t" }) do |row| county_fips = "#{row[2]}#{row[4]}" places_array <<...
true
7d89ad2d5c532d1923f4ce411071c767b0538905
Ruby
dkelly205/ruby_animal_shelter_project2
/db/seeds.rb
UTF-8
1,166
2.625
3
[]
no_license
require_relative('../models/animal.rb') require_relative('../models/customer.rb') require_relative('../models/adoption.rb') Customer.delete_all Animal.delete_all customer1 = Customer.new({ 'name' => 'John Smith', 'address' => '10 Crow Road, Glasgow, G10 6PP', 'phone_number' => '01411111111' }) custome...
true
71f60e2014cd24f1beb9abde8d8add37c488b8e1
Ruby
SRBusiness/grocery-store
/specs/online_order_spec.rb
UTF-8
4,935
2.59375
3
[]
no_license
require 'minitest/autorun' require 'minitest/reporters' require 'minitest/skip_dsl' require 'minitest/pride' require 'pry' require_relative '../lib/online_order' require_relative '../lib/customer' describe "OnlineOrder" do before do @online_order_one = Grocery::OnlineOrder.new(1,{"Lobster" =>17.18, "Annatto seed...
true
d2822f22b388d5e05f5a039c9a0692768e3301e7
Ruby
IsaacHardy/blackjack_with_ruby
/lib/card.rb
UTF-8
601
3.921875
4
[]
no_license
require_relative "game" class Card RANKS = [:A, 2, 3, 4, 5, 6, 7, 8, 9, 10, :J, :Q, :K] SUITS = [:clubs, :diamonds, :hearts, :spades] attr_reader :rank, :suit, :value def initialize(rank, suit) @rank = rank @suit = suit @value = card_value end def greater_than?(other) RANKS.index(self.ra...
true
88525cbdbaf83adb54033370c296956a1b9422bc
Ruby
Jwan622/ruby_turing_lesssons
/module_1_lessons/REPL/repl_lesson.rb
UTF-8
1,040
3.421875
3
[]
no_license
# def repl(instream, outstream) # loop do # #read # # #print prompt # outstream.print "> " #print to whatever local variable outstream is pointing at # # # read # input = instream.gets # # #eval # result = eval(input) # # #print # outstream.puts(result.inspect) # # #loop # en...
true
fb2b16ae8ffcc306761f94de47cea20938d64e00
Ruby
nahi/examples
/jjug-indy-2012/2_benchmark/6_math.rb
UTF-8
117
2.734375
3
[]
no_license
require 'benchmark' a = 44 6.times do puts Benchmark.measure { 10000000.times do a - 2 end } end
true
ec6c80e22b3c9302eb6eb8c012f09dc309f53eaa
Ruby
keisuke0831/furima-31145
/spec/models/purchase_customer_spec.rb
UTF-8
2,968
2.53125
3
[]
no_license
require 'rails_helper' RSpec.describe PurchaseCustomer, type: :model do before do @purchase_customer = FactoryBot.build(:purchase_customer) end describe '購入情報の保存' do context '購入情報の保存ができる場合' do it 'すべての値が正しく入力されていれば保存できること' do expect(@purchase_customer).to be_valid end it '建物の名前は...
true
88212d486c585cba6721c480d9c6de55455b4407
Ruby
itsolutionscorp/AutoStyle-Clustering
/all_data/exercism_data/ruby/bob/f366fcea584544ef8ec021ad0e46775d.rb
UTF-8
1,429
3.984375
4
[]
no_license
# Thanks for your nitpicks tennety. I've addressed each in comments below. class Bob def hey(comment) # I had actually considered using Enumerable#detect at first, but I was put off by having to make Response#responds? # a class method. However, I hadn't considered the ifnone parameter you can pass to #det...
true
f4ff05d3efa69e12d6417917d3add29c5acc2305
Ruby
melriffe/AdventOfCode2020
/spec/day-12/rain_risk_spec.rb
UTF-8
895
2.78125
3
[ "MIT" ]
permissive
# frozen_string_literal: true require './lib/day_12' RSpec.describe 'Day 12: Rain Risk' do let(:test_data) do [ 'F10', 'N3', 'F7', 'R90', 'F11' ] end let(:fixture) { File.join fixtures_path, 'day_12.data' } let(:fixture_data) { [] } before do File.readlines(fixture)...
true
413edeee94bbfbde04d02a3362d2d63a46d91528
Ruby
KevinDTran/my-first-hash-001-prework-web
/my_first_hash.rb
UTF-8
803
2.96875
3
[ "LicenseRef-scancode-unknown-license-reference", "LicenseRef-scancode-public-domain" ]
permissive
def my_hash my_hash = {"key" => "value"} # use the literal constructor to set the variable, my_hash, equal to a hash with key/value pairs of your choice. end def shipping_manifest shipping_manifest = Hash.new(0) shipping_manifest["whale bone corsets"] = 5 shipping_manifest["porcelain vases"] = 2 shipping...
true
a202f41e10cddfb543ca558b40e3a7bb5fac1cda
Ruby
arthur-littm/cookbook
/lib/controller.rb
UTF-8
703
3.0625
3
[]
no_license
require_relative 'view' require_relative 'recipe' class Controller def initialize(cookbook) @cookbook = cookbook @view = View.new end # user actions that your app has def create # ask for a recipe name name = @view.ask_for('name') # ask for a recipe description description = @view.ask_...
true
66e640b0c998df58d7abce5c72a8da163957df98
Ruby
cpb/scad4r
/lib/scad4r/notification.rb
UTF-8
1,103
2.578125
3
[ "MIT", "LicenseRef-scancode-unknown-license-reference" ]
permissive
module Scad4r class Notification class << self def parse(result) if error = result.fetch(:error, false) Array(new(error: error)) else timings = if real = result.fetch(:real,nil) new(success: real) else nil ...
true
fcf37b203921c486dafc00f3cf711fff19928feb
Ruby
hamadanoor9/sample-doordash
/customer.rb
UTF-8
165
2.828125
3
[]
no_license
require_relative "address" class Customer attr_reader :name, :address def initialize(name, address) @name= name @address= address end end
true
badf2fdc3a8dc0c0c74c9f300928d7012ba710df
Ruby
amcolling/reunion
/test/activity_test.rb
UTF-8
1,463
3.484375
3
[]
no_license
require 'minitest' require 'minitest/autorun' require 'minitest/pride' require './lib/activity' class ActivityTest < Minitest::Test def test_it_exists activity = Activity.new("hiking") assert_instance_of Activity, activity end def test_activity_type activity = Activity.new("hiking") assert_equal ["h...
true
cac041faded18e76e9037da063fdc5a805d28e51
Ruby
hackjackychan/les3_exos
/escalier2.rb
UTF-8
283
3.0625
3
[]
no_license
if (ARGV.length != 1) puts "#{File.basename(__FILE__)} requires one argument: #{File.basename(__FILE__)} number_of_steps" exit end marche_nb = ARGV[0].to_i i = 0 while (i < marche_nb) print ' ' * (marche_nb - i - 1) print "#" * (i + 1) print "\n" i += 1 end
true
4a513df9c207f9198666d47877d9690456dcd7ea
Ruby
geronimo/spoj
/MIXTURES/matrix_chain.rb
UTF-8
1,162
3.390625
3
[]
no_license
class Matrix attr_accessor :columns, :rows def initialize(rows, columns) self.columns = columns self.rows = rows end end class Multiplicator attr_accessor :chain, :costs, :p def initialize(chain) self.chain = chain self.costs = [] (0...chain.size).each do |i| self.costs[i] = [] ...
true
f5524365739b5fbe8a6a41ea9cb9fd3c5e951129
Ruby
johnle192/exercises
/server.rb
UTF-8
1,503
3.34375
3
[]
no_license
# This is my attempt at building a naive # HTTP server to understand what HTTP is require 'socket' # Get sockets from stdlib class ParseHTTPRequest def parse_request(request_line, headers) parse_request_line(request_line) parsed_request = { 'method' => @verb, 'path' => @path, ...
true
d33b6ed32534d61d797509970bcb89ec3472e26d
Ruby
davidvgus/backup_alert
/backup_checker.rb
UTF-8
9,240
2.921875
3
[]
no_license
#backup_checker.rb require 'inifile' require 'logger' LOG = Logger.new( 'backupalert.log', 'monthly' ) class BackupFile attr_accessor :name, :size, :ftype def initialize(filename, size, ftype) @name = filename @size = size @ftype = ftype end def to_s @name end end class BackupSet at...
true
2ea9d93c49f06f44bbe93554f287240e0aacb086
Ruby
yusukeyasuo/github-issues-rails
/lib/github.rb
UTF-8
406
2.71875
3
[]
no_license
require 'net/http' require 'json' class Github def self.get_issues(repo_url, page = 1, per_page = 5) res_csv = '' res = Net::HTTP.get(URI.parse("#{repo_url}?page=#{page}&per_page=#{per_page}")) issues = JSON.parse(res) issues.each do |i| res_csv += "#{i['title'].slice(0, 30)},#{i['body'].slice(...
true
63e72339ee50348fdb83acef92f8052898b52dda
Ruby
MateoKommit/RubyOnRailsCourse
/Section12/160.lengthempty.rb
UTF-8
244
2.71875
3
[ "MIT" ]
permissive
# frozen_string_literal: true shopping_list = { banana: 5, oranges: 10, carrots: 3, crackers: 15 } vegan_shopping_list = {} p(shopping_list.length) p(vegan_shopping_list.length) p(shopping_list.empty?) p(vegan_shopping_list.empty?)
true
bf913fa21bae5b3b7b0abfc86e18060a1763081f
Ruby
emmiehayes/dtc-admin
/app/respositories/donation_repository.rb
UTF-8
198
2.6875
3
[]
no_license
class DonationRepository def initialize(raw_payments) @raw_payments = raw_payments end def run @raw_payments.each do |payment| DonationCreator.new(payment) end end end
true
1dd0f503cacc4e5abbcf4a9b7679831170f35097
Ruby
bysxiang/ruby-learn
/class/test7.rb
UTF-8
603
3.609375
4
[]
no_license
# 单例模式-残缺版 class Abc class << self private def new super puts "进入new" end end def self.instance new end def initialize() puts "进入init" end end # 对于一个类来说,new是类方法,initialize是实例方法 # 默认情况下Abc.new调用Abc.new方法,它默认会调用initialize # # 实现单例方法,private :...
true
4da391068ce23ff57fc384c02d7544e226e21c5f
Ruby
sigovpaul/1000_issues
/begin/begin_06.rb
UTF-8
580
3.140625
3
[]
no_license
puts "Введите длину ребер параллелепипеда" puts "Введите первую сторону" first_side = gets.chomp.to_f puts "Введите вторую сторону" second_side = gets.chomp.to_f puts "Введите третью сторону" third_side = gets.chomp.to_f volume = first_side * second_side * third_side square = 2 * ( first_side * second_side + second_sid...
true
6ec783ac540df828a6ba9b92985879dd97884fa7
Ruby
shanyi/Ruby-exercises
/Chap5.rb
UTF-8
560
3.8125
4
[]
no_license
puts 'Hallo there, and what\'s your first name?' fname = gets.chomp puts 'What\'s your middle name?' mname = gets.chomp puts 'How about your last name?' lname = gets.chomp puts 'Your name is ' + fname + ' ' + mname + ' ' + lname + '? what a lovely name!' puts 'Pleased to meet you, ' + fname + ' ' + mname + ' ' + lname ...
true
5ed7e2c6ba9ee90fa9a52b93bdcc95ed4a7052a2
Ruby
copiousfreetime/flat_kit
/lib/flat_kit/command/merge.rb
UTF-8
3,039
3.078125
3
[ "MIT" ]
permissive
require 'csv' module FlatKit class Command class Merge < ::FlatKit::Command def self.name "merge" end def self.description "Merge sorted files together that have the same structure." end def self.parser ::Optimist::Parser.new do banner "#{Merge.de...
true
5c07bcfe2a388aef32acf1ee8d9c123b018f70de
Ruby
pawn-stars/chess-app
/app/models/rook.rb
UTF-8
520
2.734375
3
[]
no_license
class Rook < Piece def move_legal?(to_row, to_col) col == to_col || row == to_row end def king_rook_path_clear?(king_col) return false if move_obstructed?(row, king_col) true end def update_rook_for_castle new_rook_col = col.zero? ? 3 : 5 update_attributes(row: row, col: new_rook_col) ...
true
85681328321081a875f0ca8a1b90ece452a3c74f
Ruby
sonataFarm/algorithms
/week-7/lecture/bfs.rb
UTF-8
705
3.296875
3
[]
no_license
class Paths def initialize(g, s) @g = g @s = s bfs end def has_path_to?(v) !!@distance[v] end def path_to(v) return nil if !has_path_to?(v) path = [] x = v while x != @s do path.unshift(x) x = @edge_to[x] end path.unshift(@s) path end def dist...
true
d43b28bffdb1053e868a7eae67e95c864d1bed6a
Ruby
bartelink/ErikSchierboom.github.io
/_import/movies/moviecollection.rb
UTF-8
435
3.078125
3
[ "Apache-2.0" ]
permissive
require 'nokogiri' require './movie' class MovieCollection include Enumerable attr :movies def initialize(collectionXml) @movies = Nokogiri::XML(collectionXml) .xpath("//Collection/DVD") .select {|movieXml| movieXml.at_xpath('BoxSet/Parent').content.empty? } .collect {|movieXml| Movie.new(movieXml)...
true
fc89ef441f606f384ee6b269ca96e36646887e6d
Ruby
chatwoot/chatwoot
/app/drops/user_drop.rb
UTF-8
437
2.90625
3
[ "MIT", "LicenseRef-scancode-unknown-license-reference" ]
permissive
class UserDrop < BaseDrop def name @obj.try(:name).try(:split).try(:map, &:capitalize).try(:join, ' ') end def available_name @obj.try(:available_name) end def first_name @obj.try(:name).try(:split).try(:first).try(:capitalize) if @obj.try(:name).try(:split).try(:size) > 1 end def last_name...
true
e46a30445de199f3909b16727510f9234bc1d0a2
Ruby
ronaldcnunez/801eb65b65dff5b10f7bade646311dc8
/Task-1/api_endpoints.rb
UTF-8
1,017
3.1875
3
[]
no_license
require 'rest-client' require 'json' require 'yaml' def users_api_call(id) user_id = id.to_i if user_id != 0 query_specific_user(user_id) else query_all_data end end def query_specific_user(user_id) api_info = RestClient.get("https://reqres.in/api/users/#{user_id}") user_data = JSON.parse(api_info...
true
ec9473acab47af281d3412fb749c572327e0ffc3
Ruby
sljuka/bizflow
/lib/bizflow/monkey_patch.rb
UTF-8
212
2.78125
3
[ "MIT" ]
permissive
unless "foo_bar".respond_to? :camelcase_notation class String def camelcase_notation return self if self !~ /_/ && self =~ /[A-Z]+.*/ split('_').map{|e| e.capitalize}.join end end end
true
5a2d2a6960a9fb6a88ea218cd0176298bacf76a8
Ruby
ChanceMims/ruby-oo-object-relationships-collaborating-objects-lab-austin-web-120919
/lib/mp3_importer.rb
UTF-8
450
3.203125
3
[ "LicenseRef-scancode-unknown-license-reference", "LicenseRef-scancode-public-domain" ]
permissive
class MP3Importer attr_reader :path def initialize(path) @path = path end def files #binding.pry get_file_from_path end def import #binding.pry files.each{|filename|Song.new_by_filename(filename)} end def get_file_from_path Dir.en...
true
90d367b6765394cbbe73578e9050e5c8f024909d
Ruby
plainpicture/attachments
/lib/attachments/fake_driver.rb
UTF-8
1,648
2.59375
3
[ "MIT" ]
permissive
module Attachments class FakeMultipartUpload include MonitorMixin def initialize(name, bucket, options, &block) super() @name = name @bucket = bucket block.call(self) if block_given? end def upload_part(data) synchronize do @data ||= "" @data << data ...
true
82ed9cc6864cd965f092260d74916089882e5e28
Ruby
abellotti/insights-api-common-rails
/lib/insights/api/common/filter.rb
UTF-8
11,007
2.515625
3
[ "Apache-2.0" ]
permissive
module Insights module API module Common class Filter INTEGER_COMPARISON_KEYWORDS = ["eq", "not_eq", "gt", "gte", "lt", "lte", "nil", "not_nil"].freeze STRING_COMPARISON_KEYWORDS = ["contains", "contains_i", "eq", "not_eq", "eq_i", "not_eq_i", "starts_with", "starts_with_i", "ends_with", "e...
true
eaafda7c82d1bf46cbfee980d29759349913d209
Ruby
Sephi-Chan/map_data_extractor
/lib/map_data_extractor/paths_extractor.rb
UTF-8
1,872
3.078125
3
[]
no_license
class MapDataExtractor::PathsExtractor def initialize(image, nodes) @image = image @view = image.view(0, 0, image.columns, image.rows) @nodes = nodes end def paths # Find path's starting points from each node. start_points = Hash.new { |k, v| k[v] = [] } @nodes.each do |node| node...
true
8e83bc4c262e35bb5c0667cff23faa018dd5d6d6
Ruby
gildesmarais/dotfiles
/irbrc
UTF-8
1,003
2.703125
3
[]
no_license
#!/usr/bin/env ruby # frozen_string_literal: true require 'rubygems' ## # Improve pasting speed on macos. # # source: https://github.com/ruby/irb/issues/43#issuecomment-572981408 IRB.conf[:USE_MULTILINE] = false ## # monkey-patch (restricted to irb session) Class class Class ## # Show only this class class metho...
true
433ce3c0beedd90d4f77222c72d9b8e29df9a3d1
Ruby
KaitlynMcPartland/health-insurance-helper
/app/models/user.rb
UTF-8
410
2.625
3
[ "MIT" ]
permissive
class User < ActiveRecord::Base include BCrypt def password @password ||= Password.new(password_hash) end def password=(new_password) @password = Password.create(new_password) self.password_hash = @password end def self.authenticate(user_info) user = User.find_by(username: user_info[:username]) if us...
true
dcf73dcf307638ac5fc6694e932ccc1516de9a83
Ruby
dlaststark/machine-learning-projects
/Programming Language Detection/Experiment-2/Dataset/Train/Ruby/100-doors-1.rb
UTF-8
188
2.671875
3
[]
no_license
doors = Array.new(101,0) print "Open doors " (1..100).step(){ |i| (i..100).step(i) { |d| doors[d] = doors[d]^= 1 if i == d and doors[d] == 1 then print "#{i} " end } }
true
b2aeaff6a954b418ea573bd9d998bad2df894bfb
Ruby
catprice444/anagram-detector-online-web-sp-000
/lib/anagram.rb
UTF-8
1,039
4.5
4
[ "LicenseRef-scancode-public-domain", "LicenseRef-scancode-unknown-license-reference" ]
permissive
# Your class, `Anagram` should take a word on initialization, and instances should # respond to a `match` method that takes an array of possible anagrams. It should # return all matches in an array. If no matches exist, it should return an empty # array. class Anagram attr_accessor :word def initialize(word) ...
true
1a8b6e2d2585e583ef575da6c98a0f17f876c2e9
Ruby
Cysioland/phpunit-docker
/Rakefile
UTF-8
2,409
2.625
3
[ "MIT" ]
permissive
require 'rake' require './scripts/Settings' require './scripts/Console' require './scripts/Version' require './scripts/Template' # External args VERSION = ENV['version'] || '' # Version's tasks namespace :version do desc "Add new version" task :add do Console::display_box('Add new version') if Version::c...
true
8d1605948541e1a69465f2995dc842e38f3ca2a6
Ruby
miriamhit02/afternoon_zoo_2105
/spec/zoo_spec.rb
UTF-8
1,341
3.046875
3
[]
no_license
require './lib/animal' require './lib/zoo' RSpec.describe Zoo do it 'exists' do zoo = Zoo.new("Bronx Zoo", "2300 Southern Blvd", "Bronx", "NY", "10460") expect(zoo).to be_a(Zoo) end it 'has a street' do zoo = Zoo.new("Bronx Zoo", "2300 Southern Blvd", "Bronx", "NY", "10460") expect(z...
true
45714249fe34b4bbb16e87eddd7a9d7bbf5c51c3
Ruby
vano468/apple-warranty-scraper
/example.rb
UTF-8
372
2.671875
3
[]
no_license
require_relative 'lib/apple_warranty_scraper' def print_phone_info(info) result = "serial: #{info.serial}" result += ", warranty: #{info.warranty}" result += ", expiration date: #{info.expiration}" if info.warranty == :active puts result end print_phone_info AppleWarrantyScraper.new '013896000639712' print_p...
true
8ca8d76defa6f3e31305b7823d95dc60409a3974
Ruby
tonidas/versi
/lib/versi/generate_command/interactors/extract_release_type_from_commit_message.rb
UTF-8
1,852
2.609375
3
[ "MIT" ]
permissive
require "rescue_interactor" class Versi < Clamp::Command class GenerateCommand < Clamp::Command class Interactors class ExtractReleaseTypeFromCommitMessage include RescueInteractor MERGE_COMMIT_REGEXES = [MERGE_COMMIT_REGEX_BITBUCKET = /.*Merge\sbranch\s\'(.*)\'.*/, ...
true
b2eef2ec2060b4eceef9db1a18aea3979fc822dc
Ruby
Keemtaker/duckrev
/lib/tasks/football_teams.rake
UTF-8
923
2.515625
3
[]
no_license
require 'httparty' base_uri = ENV['BASE_URI'] sports_token_key = ENV['SPORTS_TOKEN_KEY'] sports_token_value = ENV['SPORTS_TOKEN_VALUE'] desc "This task retrieves teams api data" task :football_teams_data => :environment do competition_ids = ["2002", "2014", "2015", "2019", "2021"] competition_ids.each do | compe...
true
9eb88ba100ba9ff45003789d7532481cda2e4f0d
Ruby
skitale-design/viselitsa
/lib/printer.rb
UTF-8
539
3.171875
3
[]
no_license
class Printer IMAGE_PATH = 'image' def initialize(game) @game = game end def print_info @game.word_array.each do |letter| if @game.good_letters.include?(letter) print " #{letter} " else print " _ " end end end def print_image begin File.readlines("#...
true
344f63a7c67316e4ac1ef012bce71d776d6adb7e
Ruby
RianaFerreira/wdi_sydney_2_hw
/w01/d05/nick/Shelter/main.rb
UTF-8
5,016
3.828125
4
[]
no_license
require 'pry' require_relative 'shelter' require_relative 'client' require_relative 'animal' $shelter = Shelter.new def get_input menu_selection = 0 while menu_selection != 7 print "What would you like to do?\n (1) Add client (2) Add animal (3) Adopt animal ...
true
b35c1733e6152b9eba6662cff04c17460619d460
Ruby
afinapd/learn-selenium-ruby
/variable.rb
UTF-8
668
3.71875
4
[]
no_license
# local variable start with small letter or _ class LocalVariable def setData _a = 100 puts _a end def getData puts a end end # Instance variable start with @ class InstanceVariable def sum(a, b) @c = a + b end def display puts @c end end # class variable start with @@ class Clas...
true
032def304ab144cd094513ea92afb1932b77bcc3
Ruby
jrubio12/ejemplosRuby
/general/funciones_01.rb
UTF-8
88
3.09375
3
[]
no_license
def say_hello(name) puts "Hola #{name}" end say_hello("Jesus Rubio") say_hello "Hernandez"
true
ae5cf50c3dc70380a567d381a7a934ad4d0850cd
Ruby
reneedv/class_mngmt_December4_6
/features/step_definitions/assignments_steps.rb
UTF-8
623
2.578125
3
[]
no_license
Given(/^I am on the home page$/) do visit '/' end Then(/^I should see "(.*?)"$/) do |arg1| page.should have_content arg1 end When(/^I (follow|press) "(.*?)"$/) do |click_type, arg1| click_link_or_button arg1 end When(/^I fill in "(.*?)" with "(.*?)"$/) do |arg1, arg2| fill_in arg1, with: arg2 end Then(/^I [...
true
6074a7d3b54c4509617030e521ca1b9a9b275fcf
Ruby
NicciSheets/tdd_methods
/test_array_tdd_methods.rb
UTF-8
403
2.515625
3
[]
no_license
require "minitest/autorun" require_relative "array_tdd_methods.rb" class TestArrayTddMethods < Minitest::Test def test_assert_that_using_reject_method_returns_false_values assert_equal([3, 4, 5, 6], reject_method([1, 2, 3, 4, 5, 6])) end def test_assert_that_returns_same_without_using_method as...
true
c9a09dfedebd9c7786a81359c4c4583615293845
Ruby
DHBW-KA/ruby_on_rails
/1_Ruby/uebungen/ü6.rb
UTF-8
149
2.90625
3
[]
no_license
class Foo def self.bar puts 'class method' end def baz puts 'instance method' end end # Wie wird welche Methode aufgerufen. Warum?
true
7824f9b4788387abf5c425e48d7cdf4f0b755167
Ruby
bingo8670/programming-exercise
/47-directions-reduction.rb
UTF-8
469
3.4375
3
[]
no_license
# 方向计算,去除相邻的相反方向 OPPOSITE = { "NORTH" => "SOUTH", "SOUTH" => "NORTH", "EAST" => "WEST", "WEST" => "EAST" } def dirReduc(arr) stack = [] arr.each do |dir| OPPOSITE[dir] == stack.last ? stack.pop : stack.push(dir) end stack end a = ["NORTH", "SOUTH", "SOUTH", "EAST", "WEST", "NORTH", "WEST"] p di...
true
580e6e328e89d6670958e8056db2ae3689dba6bc
Ruby
malnakli/Ruby_on_Rails_Tutorial
/sample_app/app/models/user.rb
UTF-8
3,617
2.890625
3
[]
no_license
class User < ActiveRecord::Base # dependent: :destroy arranges for the dependent microposts to be destroyed when the user itself is destroyed has_many :microposts , dependent: :destroy # Since destroying a user should also destroy that user’s relationships, # we’ve gone ahead and added dependent: :destroy to t...
true
31945490f2be94022473e42becf4aa7e18b08523
Ruby
graemenelson/hv-app
/app/presenters/dashboard_presenter.rb
UTF-8
1,593
2.8125
3
[]
no_license
class DashboardPresenter class Year attr_reader :label, :months def initialize(label) @label = label @months = [] end def push(customer, report) @months.push(Month.new(customer,report)) end end class Month attr_reader :customer, :repo...
true
3c13e6a83ae5ebf973ee9b87f7c7c5e96ace034a
Ruby
piepieninja/PiePieNinja.zshrc
/scripts/itunes.rb
UTF-8
764
2.78125
3
[]
no_license
#!/usr/bin/env ruby # coding: utf-8 ## # Author: Caleb Adams # Contact: CalebAshmoreAdams@gmail.com # Website: CalebDevelops.com ## require 'colorize' # ੦ᐅᖱ•‣∮ ⌘ ⏸ ⏹ ⏯ ⏲ ☞ ⚡ ✖ ♬ #cmd = "osascript -e 'tell application \"iTunes\" to if player state is playing then \"♬ \" & name of current track & \" - \" & artist...
true
2d7d42043f6f9d37d4dd6e13e5366453392a6180
Ruby
okasten/OO-mini-project-dumbo-web-100818
/app/models/Recipe.rb
UTF-8
937
3.109375
3
[]
no_license
class Recipe @@all = [] attr_reader :name def initialize(name) @name = name @@all << self end def self.all @@all end def recipe_cards RecipeCard.all.select do |card| card.recipe == self end end def self.most_popular most = @@all.sort_by do |recipe| recipe.recipe_...
true
bfc69b12edbbd5be89c890cdac5238a0cbd753df
Ruby
stevenjackson/advent-of-code
/2016/3/day3_test.rb
UTF-8
999
3.421875
3
[]
no_license
require 'minitest/autorun' class Day3Test < Minitest::Test def test_is_triangle input = "3 4 5" assert triangle? input end def test_not_triangle input = "12 1 2" assert_equal(false, triangle?(input)) end def test_pt1 full_input = File.read('input') count = full_input.split("\n").sel...
true
624561e96a1e538271deb2fad6fa5b6341ac07d6
Ruby
xmisao/syobocal
/test/sub_titles/test_parser.rb
UTF-8
1,654
2.75
3
[ "MIT" ]
permissive
require "minitest/autorun" require "syobocal" module Syobocal module SubTitles class TestParser < MiniTest::Test def test_parse sub_titles = <<SUB_TITLES *01*hoge *02*hoge*piyo 03 *04* ** SUB_TITLES expected = [ SubTitle.new("01", "hoge"), SubTitle.new("02", "hoge*piyo...
true
d42d3058523fcd7afff8f78b13c4079b18f712e8
Ruby
pierrenav13/w4d5
/two_sums.rb
UTF-8
1,274
3.90625
4
[]
no_license
def bad_two_sum?(arr, target_sum) arr.each_with_index do |num1, idx1| arr.each_with_index do |num2, idx2| next if idx1 == idx2 return true if num1 + num2 == target_sum end end false end arr = [0, 1, 5, 7] # p bad_two_sum?(arr, 6) # => should be true # p bad_two_sum?(...
true
7ec29448e2962a66c34f86d2ead60254a00f02f3
Ruby
Samkiroko/Algorithms-and-Data-structures
/tower_of_hanoi2.rb
UTF-8
2,078
4.28125
4
[]
no_license
# frozen_string_literal: true # Challenge # Create a program that solves the tower of Hanoi. You will be given one number as input - the number of disks on Peg 1. # Create a method that prints a string with the correct steps to solve the puzzle. # Output Format # Print the peg to move from, an arrow "->", and the p...
true
25d687add2a749b7844c637496a1dcc7a534fc01
Ruby
bstiber/launch_school_exercises
/loops1/loops2-2.rb/8.rb
UTF-8
428
4.34375
4
[]
no_license
# Given the array of several numbers below, use an until loop to print each number. puts "NON destructive version" numbers = [7, 9, 13, 25, 18] index = 0 until index == numbers.size p numbers[index] index += 1 end puts '-' * 35 #------------------------------------------- puts "destructive version" numbers = ...
true
a3233968140c07c64b9bbb1f863652ee9875b6e2
Ruby
jasonZYJ/ruby_python_useful_scripts
/ruby/zip_writer.rb
UTF-8
1,091
2.625
3
[]
no_license
require 'zip' module Purchasing class ZipWriter attr_accessor :input_dir, :output_file def initialize(input_dir, output_file) self.input_dir = input_dir self.output_file = output_file end def write entries = Dir.entries(input_dir) #TODO need to replace with sa file path entr...
true
9507cec8ed641480fefaa2b0187643eb847c8ea9
Ruby
thebravoman/software_engineering_2014
/vhodno_nivo/Veselina_Kolova_11B_8/Veselina_Kolova_16.rb
UTF-8
202
3.375
3
[]
no_license
require 'mathn' x = gets.to_i while x < 0 || x > 10 do x = gets.to_i end arr = Array.new(10) z = 2 (0..x).each do if Prime.prime?(z) && z % 10 == x then puts z arr < z end z++ end puts arr
true
76ce99429193f1b4a6f0f71f52ac1e47306b6ef1
Ruby
torianne02/advent-of-code
/2020/day-05/solution.rb
UTF-8
419
3.4375
3
[]
no_license
def get_seats File.read("2020/day-05/input.txt").split("\n") end def get_seat_ids(seats) seats.map {|seat| seat.tr("BFRL", "1010").to_i(2) } end # part 1 def find_highest_seat_id(seat_ids) seat_ids.max end # part 2 def find_my_seat(seat_ids) my_seat = (seat_ids.min...seat_ids.max).to_a - seat_ids my_seat....
true
1d7a125d1fdc845fa11dd9ff1e10f7afeed1c80b
Ruby
livelink/morandi-rb
/lib/morandi/image_ops.rb
UTF-8
7,679
2.6875
3
[ "MIT" ]
permissive
# frozen_string_literal: true require 'pango' require 'colorscore' module Morandi class ImageOp class << self def new_from_hash(hash) op = allocate hash.each_pair do |key, val| op.instance_variable_set("@#{key}", val) if op.respond_to?(key.intern) end op end...
true
5b41bf39cea523b75deedb5c4735ed4a2533d501
Ruby
programmurr/chess
/spec/move_checks_spec.rb
UTF-8
10,616
2.828125
3
[]
no_license
# frozen_string_literal: true require_relative '../lib/move_checks' describe MoveChecks do before do @board = Board.new @board.set_cell_coordinates @board.place_pawns @board.place_royalty end context '#promote_pawn?' do it 'returns true if there is a white Pawn present on board row 0' do ...
true
8e0ebe0ffab95e25e5f92618cb302370653b8556
Ruby
rodikno/Automation_course
/helpers/redmine_user.rb
UTF-8
663
2.734375
3
[]
no_license
require 'selenium-webdriver' require 'faker' class RedmineUser attr_reader :first_name, :last_name, :full_name, :login, :email attr_accessor :password, :id def initialize(opts={}) @first_name = opts[:first_name] || Faker::Name.first_name @last_name = opts[:last_name] || Faker::Name.last_name @log...
true
b20689e7e52021725ce923301ade54228b5f1966
Ruby
manutazo/radar_module
/spec/attack_mode_spec.rb
UTF-8
815
2.5625
3
[]
no_license
require 'spec_helper' describe AttackMode do describe 'building' do context 'insufficient params' do it 'returns an error' do expect { AttackMode.new }.to raise_error(KeyError) end end context 'sufficient params' do it 'returns an error' do expect(AttackMode.new(mode: '...
true
ec2fda8949950fc7047dbed36c622b18b14a6354
Ruby
bdphilly/chess
/pieces/stepping_piece.rb
UTF-8
835
3.15625
3
[]
no_license
require_relative "./piece.rb" class SteppingPiece < Piece attr_accessor :deltas, :display, :color def initialize(pos, board, color) super(pos, board, color) @deltas = [] end def moves [].tap do |valid_moves| self.deltas.each do |each_delta| current_position = self.position ...
true
c86737caf5aa3070ad7d47e62e51ab2d4c71cc65
Ruby
jlieb10/MazeSolver
/maze_solver.rb
UTF-8
3,845
3.609375
4
[]
no_license
class MazeSolver attr_reader :maze, :traveled_path, :visited_nodes, :node_queue def initialize(maze) @maze = maze # ASCII Maze Input to Class Var @maze_array=[] # @maze variable parsed into an array of rows @start=[] # coordinates of start of maze indicated by "→" @end=[] # coordinates of end of maz...
true
6f42885e656df7d73c8f50178e53ed19352d4231
Ruby
wallezhang/aliyun-odps-ruby-sdk
/lib/odps/models/instance.rb
UTF-8
4,696
2.515625
3
[ "Apache-2.0", "LicenseRef-scancode-warranty-disclaimer" ]
permissive
=begin Copyright 2015 ZhangZhaoyuan 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, softwa...
true
26163afd6d943f317378546c93bd10de2bde63f6
Ruby
traciechang/algorithm-problems
/verifying_an_alien_dictionary.rb
UTF-8
1,746
4.0625
4
[]
no_license
# leet # In an alien language, surprisingly they also use english lowercase letters, but possibly in a different order. The order of the alphabet is some permutation of lowercase letters. # Given a sequence of words written in the alien language, and the order of the alphabet, return true if and only if the given wor...
true
cff7b48bdeef88b421edbdf17e371f21b7a2b775
Ruby
p8952/nginx-puma-sinatra
/app.rb
UTF-8
154
2.515625
3
[]
no_license
require 'sinatra/base' class App < Sinatra::Base get '/' do "<p>This is <i>dynamic</i> content served via puma: #{rand(36**6).to_s(36)}" end end
true