text stringlengths 10 2.61M |
|---|
# http://projecteuler.net/index.php?section=problems&id=31
#
# In England the currency is made up of pound, £, and pence, p, and there are eight coins in general circulation:
#
# 1p, 2p, 5p, 10p, 20p, 50p, £1 (100p) and £2 (200p).
#
# It is possible to make £2 in the following way:
#
# 1×£1 + 1×50p + 2×20p ... |
class Subject < ActiveRecord::Base
has_many :book_subjects
has_many :books, through: :book_subjects
rails_admin do
list do
field :name
field :books
end
show do
field :name
field :books
end
edit do
field :name
end
end
end
|
module Swow
class Client
AUCTION_DATA_STATUS_REQUEST = "/wow/auction/data".freeze
module Auction
def auction_data_status(realm, locale: @locale)
get("#{AUCTION_DATA_STATUS_REQUEST}/#{realm}", locale: locale)
end
end
end
end
|
class PropertyManagers::RegistrationsController < ApplicationController
before_action :block_current_user, only: [:new]
def new
@manager = PropertyManager.new
end
def create
@manager = PropertyManager.new(property_manager_params)
create_user_model(@manager)
end
end |
# Be sure to restart your server when you modify this file.
# Version of your assets, change this if you want to expire all your assets.
Rails.application.config.assets.version = '1.0'
# Add additional assets to the asset load path.
# Rails.application.config.assets.paths << Emoji.images_path
# Add Yarn node_modules ... |
require 'spec_helper'
# describe "lane_assignments/new.html.haml" do
# before(:each) do
# assign(:lane_assignment, stub_model(LaneAssignment,
# :new_record? => true,
# :lane => 1,
# :scout_id => 1,
# :heat_id => 1
# ))
# end
#
# it "renders new lane_assignment form" do
# rend... |
class ConcertPresenter < BasePresenter
presents :concert
delegate :id, :title, :subtitle, :venue, :venue_address, :city, :state,
:zip, :additional_information, :ticket_price, to: :concert
def formatted_date
concert.date.strftime("%B %-d, %Y")
end
def formatted_start_time
concert.date.str... |
class Board
include DataMapper::Resource
include DataMapper::MassAssignmentSecurity
property 'id', Serial
property 'name', String, index: true, unique: :user_id, required: true
property 'description', Text
property 'user_id', Integer, :index => true
property 'test_features_count', Integer, :default => 0... |
class Allergen
attr_accessor :user, :ingredient
@@all = []
def initialize(user:, ingredient:)
self.user = user
self.ingredient = ingredient
@@all << self
end
def self.all
@@all
end
end |
class AddAttackerNameAndDefenderNameToWars < ActiveRecord::Migration
change_table :wars do |t|
t.string :attacker_name
t.string :defender_name
end
end
|
require "rails_helper"
RSpec.describe ApplicationMailer , :type => :mailer do
describe "update_user_info" do
it "送信されること" do
user = create :mangement
mail_count = ActionMailer::Base.deliveries.count
ApplicationMailer.update_user_info(user).deliver_now
expect(ActionMailer::Base.deliveries.c... |
#!/usr/bin/env ruby
require "time"
require "sqlite3"
require "optparse"
$LOAD_PATH.unshift "#{File.dirname(__FILE__)}/.."
require "gator"
OptionParser.new do |opts|
opts.banner = "Usage: #{__FILE__} [-d /path/to/database]\nDownload all of the obsids specified in the database."
opts.on("-h", "--help", "Displa... |
class SessionsController < ApplicationController
def create
@consultation_id = params[:consultation_id]
@user = current_user
@user.from_auth_hash(auth)
if @consultation_id
redirect_to consultation_path(id: @consultation_id)
else
redirect_to patient_path(current_user.patient)
fla... |
class SubmissionImage < Submission
validates_attachment_presence :file
# To have better naming with helpers (namely routes) we need to set
# the model name to the parent object.
# It is possible to set this up in the parent, but poses problems
# during development. Might be good to eventually set it ... |
#{
# "by" : "norvig",
# "id" : 2921983,
# "kids" : [ 2922097, 2922429, 2924562, 2922709, 2922573, 2922140, 2922141 ],
# "parent" : 2921506,
# "text" : "Aw shucks, guys ... you make me blush with your compliments.<p>Tell you what, Ill make a deal: I'll keep writing if you keep reading. K?",
# "time" : 1314211127,
... |
class RenameDeskType < ActiveRecord::Migration
def change
rename_column :desks, :type, :job_type
end
end
|
pg_owner = input('pg_owner')
pg_conf_file = input('pg_conf_file')
pg_hba_conf_file = input('pg_hba_conf_file')
pg_ident_conf_file = input('pg_ident_conf_file')
control "V-72855" do
title "PostgreSQL must limit privileges to change functions and triggers, and
links to software external to PostgreSQL."
desc "... |
require 'tmpdir'
require 'fileutils'
Twine::Plugin.new # Initialize plugins first in Runner.
module Twine
class Runner
class NullOutput
def puts(message)
end
def string
""
end
end
def self.run(args)
options = CLI.parse(args)
return unless options
... |
class AddForgotPasswordToUserProfile < ActiveRecord::Migration[5.0]
def self.up
add_column :user_profiles, :reset_password_token, :string
add_column :user_profiles, :reset_password_expiry, :datetime
end
def self.down
remove_column :user_profiles, :reset_password_token, :string
remove_column :user... |
#Fedena
#Copyright 2011 Foradian Technologies Private Limited
#
#This product includes software developed at
#Project Fedena - http://www.projectfedena.org/
#
#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 ... |
# frozen_string_literal: true
require 'rails/generators'
module PatternBibz
module Generators
# Extend the Rails model generator
class ExtendModelGenerator < ::Rails::Generators::Base
source_root File.expand_path('templates', __dir__)
desc 'Extend Rails Model generator'
def copy_initialize... |
require "nidyx/objc/model_base"
module Nidyx
class ObjCImplementation < ObjCModelBase
self.template_file = File.join(self.template_path, "implementation.mustache")
attr_accessor :name_overrides
def initialize(name, options)
super
self.file_name = "#{name}.#{EXT}"
self.imports = [name]... |
class ComputerPlayer
attr_accessor :name, :board, :mark
def initialize(name)
@name = name
end
def display(board)
@board = board
end
def get_move
moves = open_moves
moves.each { |pos| return pos if wins?(pos, mark) }
moves.each { |pos| return pos if wins?(pos, opponent_mark) }
retu... |
require "rubygems"
require "nokogiri"
require "xml/xslt"
require "pdfkit"
require "bookchef/tree_merger"
require "bookchef/compilers/html"
require "bookchef/compilers/pdf"
class BookChef
LIB_PATH = File.expand_path(File.dirname(__FILE__) + "/bookchef")
class << self
# Converts XML special characrters into ... |
FactoryBot.define do
factory :location do
sequence :name do |n|
"location#{n}"
end
address { "123 test st" }
city { "test" }
state { "MA" }
zip_code { "12345" }
phone_number { "123-456-7890" }
end
end
|
class NvsDeptsController < ApplicationController
before_filter :find_project, :prepare_combos
before_filter :authorize
before_filter :get_related_projects , :except => [:index, :new, :destroy, :create, :users2dept]
# GET /nvs_depts
# GET /nvs_depts.json
def index
@nvs_depts = NvsDept.all
respond_t... |
require "testing_env"
class BashTests < Homebrew::TestCase
def assert_valid_bash_syntax(files)
output = Utils.popen_read("/bin/bash -n #{files} 2>&1")
assert $?.success?, output
end
def test_bin_brew
assert_valid_bash_syntax "#{HOMEBREW_LIBRARY_PATH.parent.parent}/bin/brew"
end
def test_bash_cm... |
class AddDeleteCheckToRepairs < ActiveRecord::Migration[5.2]
def change
add_column :repairs, :delete_check, :string
end
end
|
json.extract! @insurance,
:id,
:name,
:insurance_type,
:amount,
:premium,
:protection_length,
:paid_period_length,
:consider_year,
:consider_gender,
:company,
:minimum_age,
:maximum_age,
:group,
:created_at,
:updated_at
json.returns @insurance.returns do |r|
json.year r.year
json.age r.age
json.rate r.rate
js... |
class Board
attr_accessor :board, :cells
def initialize(board = nil)
#should start with cells for a new game of Tic-tac-toe. You can and should use #reset!.
@board = board || reset!
end
def self.cells
#stores the data of the state of the board in an array.
@cells = [" "," "," "," "," "," ... |
module RailFenceCipher
VERSION = 1
module_function
def encode(string, rails_count)
Encoder.new(string, rails_count).call
end
def decode(string, rails_count)
Decoder.new(string, rails_count).call
end
class Worker
def initialize(string, rails_count)
@chars = string.chars.each
@fe... |
Pod::Spec.new do |s|
s.name = 'MiawKit'
s.version = '1.2.1'
s.license = { :type => 'MIT', :file => 'LICENSE' }
s.summary = 'A set of utilities that gives localization in Objective-C a little more miaw'
s.homepage = 'https://github.com/robocat/MiawKit'
s.au... |
class Order
attr_reader :items, :placed_at, :time_spent_on_sending_email
include ItemContainer
def initialize
@items = Array.new
end
def place
@placed_at = Time.now
thr = Thread.new do
Pony.mail({
:to => StoreApplication::Admin.email,
:via => :smtp,
:via_options => {
:address ... |
FactoryGirl.define do
factory :position do
title "Position title"
from "2015-09-28 18:30:24"
association :area, factory: :area
end
end
|
class CreatePayslipAdditionalLeaves < ActiveRecord::Migration
def self.up
create_table :payslip_additional_leaves do |t|
t.references :employee_payslip
t.references :employee_additional_leave
t.date :attendance_date
t.boolean :is_half_day
t.timestamps
end
end
def self.down
... |
class OptionsController < ApplicationController
before_action :set_poll
before_action :set_option, only: [:show, :edit, :add_vote]
def add_vote
session[:voted] ||=[]
if session[:voted].include?(@poll.id)
redirect_to @poll
else
@option.add_vote!
session[:voted] << @poll.id
red... |
class Bones
attr_reader :size
def initialize(size = "small")
@size = size
end
end
|
require 'active_command/exceptions'
require 'active_command/base'
require 'active_command/version'
module ActiveCommand
DEFAULT_TYPES = {
string: String,
integer: Integer,
array: Array,
hash: Hash
}.freeze
end
|
class MeasurementsController < ApplicationController
before_action except: :index do
@measuring_session = MeasuringSession.for_regatta(@regatta).find_by(identifier: params[:measuring_session_id])
@measuring_point = if can?(:manage, MeasurementSet) && params[:measuring_point_number].present?
... |
module Adapter
module Facebook
module To
module Schema
class Likes
include Virtus
include Discoverer::Writer
attr_reader :_type
attribute :count
attribute :authors
def initialize likes
@_type = "http://schema.org/AggregateRating"
coerce likes
end
def coerc... |
module Strategy
class Combination < Base
attr_accessor :chooser
def next_turn
strategy = @chooser.call
strategy.for_use_by self
strategy.next_turn
end
end
end
|
# Method to create a list
# input: string of items separated by spaces (example: "carrots apples cereal pizza")
# steps:
# define method for list which takes in items and quantities as parameters.
# create new hash for grocery list.
# take string of items and convert to array.
# loop through each item in... |
# Includes: MyRackspaceDNS -- small myrackspace wrapper class
#
# Author: Taylor Carpenter <taylor@codecafe.com>
#
# Copyright (C) 2012 CodeCafe
#
# 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 Soft... |
class OAuth2Controller < ApplicationController
protect_from_forgery with: :null_session
before_action :get_service_provider
before_action :check_content_type, only: [:unauthorized, :revoke, :introspect], if: -> { request.post? }
def authorize
if params[:response_type].nil?
json = {
error: 'in... |
class FontBukyvedeRegular < Formula
head "https://kodeks.uni-bamberg.de/aksl/media/BukyVede-Regular.ttf"
desc "BukyVede Regular"
homepage "https://kodeks.uni-bamberg.de/aksl/Schrift/BukyVede.htm"
def install
(share/"fonts").install "BukyVede-Regular.ttf"
end
test do
end
end
|
require 'dotenv/load'
require 'spec_helper'
require 'riotapi'
require 'rest-client'
require 'vcr_setup'
describe 'Riot Api' do
it "gets the challenger league" do
VCR.use_cassette('riotapi/get_challenger_league') do
client = RiotApi.new
response = client.get_challenger_league
expect(response['ti... |
describe ManageIQ::Providers::IbmCloud::PowerVirtualServers::CloudManager::AuthKeyPair do
let(:ems) do
FactoryBot.create(:ems_ibm_cloud_power_virtual_servers_cloud, :provider_region => "us-south")
end
describe 'validations' do
it 'fails create with invalid parameters' do
expect(subject.class.valida... |
require_relative '../../../../spec_helper'
describe 'govuk_user', :type => :define do
let(:title) { 'hungrycaterpillar' }
let(:ssh_dir) { '/home/hungrycaterpillar/.ssh' }
let(:ssh_file) { '/home/hungrycaterpillar/.ssh/authorized_keys' }
context 'default params' do
let(:params) {{
:fullname => 'Hungr... |
require 'net/http'
require 'json'
require 'jelastic/request_error'
module Jelastic
class Request
TIMEOUT = 1200
attr_reader :client, :path, :params
def initialize(client, path = [], params = {})
@client = client
@path = build_uri_path(path)
@params = if client.authenticated?
... |
require_relative 'polytreenode'
require 'byebug'
class KnightsTravails
attr_reader :visited_pos
attr_accessor :board, :starting_node
def initialize(pos)
@starting_node = PolyTreeNode.new(pos)
@board = Array.new(8) { Array.new(8) }
@visited_pos = [self.starting_node]
end
def find_path(end_pos)
... |
class SpellsController < ApplicationController
def index
@spells = Spell.all
if params[:search]
@spells = Spell.where('name lIKE ?', "%#{params[:search]}%")
end
end
def show
@spell = Spell.find(params[:id])
end
def new
@spell = Spell.new
end
def create
@spellbooks = Spellbook... |
#================================================================================
# Configure Capybara for feature specs / end-to-end testing in a "real"
# browser environment.
# To use Selenium (the default), comment out everything below. Otherwise...
#==============================================================... |
module ActiveRecord
module ConnectionAdapters
class AbstractAdapter
class SchemaCreation # :nodoc:
def initialize(conn)
@conn = conn
end
private
def column_options(o)
column_options = {}
column_options[:null] = o.null unless o.null.nil?
... |
class VotosController < ApiController
before_action :crear_service
def dar_voto
@voto = @service.dar_voto
render json: @voto
end
def eliminar_voto
@service.eliminar_voto
end
private
def crear_service
@service = VotosService.new(params)
end
end |
class ApplicationController < ActionController::Base
protect_from_forgery with: :exception
# helper_method :current_user, :signed_in?, :current_location, :get_meal_type_filter, :current_order
protected
# def current_location
# if current_user
# Location.includes(:meals).where(id: current_user.... |
class Employee < ApplicationRecord
belongs_to :dog
def name
"#{self.first_name} #{self.last_name}"
end
validates :title, :alias, uniqueness: true
#validates :alias, uniqueness: true
# validates :img_url, presence: true
validates :img_url, presence: {message: "Please add image URL t... |
json.array! @parkings do |parking|
json.partial! "v1/parkings/parking", parking: parking
end
|
class Admin::Continents::AdminContinentsController < AdminController
before_action :set_continent
private
def set_continent
@continent = Continent.find(params[:continent_id])
end
end
|
# == Informacion de la tabla
#
# Nombre de la tabla: *dbm_especialistas*
#
# idEspecialistas :integer(11) not null, primary key
# idDescriptorGenerico :integer(11) not null
# nombre :string(100) default(""), not null
# telefono :string(50)
# celular :st... |
class Review < ApplicationRecord
belongs_to :user
belongs_to :tour
validates :user_id, presence: true
validates :tour_id, presence: true
validates :rating, inclusion: 1..10, presence: true
validates :subject, length: { maximum: 20 }, presence: true
validates :content, length: { maximum: 1000 }, presence: ... |
require 'rails_helper'
describe ApplicationHelper do
describe '#inch_to_centimeters' do
it "converts inches to centimeters" do
expect(helper.inch_to_centimeters(2)).to eq(5.08)
end
end
describe '#next_page' do
it "returns @page + 1" do
assign(:page, 3)
expect(helper.next_page).to eq(4)
end
end... |
class MessagesController < ApplicationController
# respond_to :html, :json
before_action :set_message, only: [:show, :edit, :update, :destroy]
before_action :user_only, except: [:edit, :update, :user_lookup]
before_action :admin_only, only: [:edit, :update, :user_lookup]
# GET /messages
# GET /messages.jso... |
class Statement
def initialize
@row = Row.new
end
def print(transactions)
puts 'date || credit || debit || balance'
puts transaction_output(transactions)
end
private
attr_reader :row
def transaction_output(transactions)
transactions.map do |transaction|
row.display_transaction(tr... |
# This file should contain all the record creation needed to seed the database with its default values.
# The data can then be loaded with the rails db:seed command (or created alongside the database with db:setup).
#
# Examples:
#
# movies = Movie.create([{ name: 'Star Wars' }, { name: 'Lord of the Rings' }])
# Ch... |
class Topic < ActiveRecord::Base
has_many :votes
belongs_to :user
validates_presence_of :title
validates_presence_of :description
def vote_from(user)
votes.find_by(user_id: user.id)
end
def has_vote_from?(user)
votes.find_by(user_id: user.id).present?
end
end
|
# frozen_string_literal: true
class CommentsController < ApplicationController
before_action :user, only: %i[create destroy]
before_action :movie, only: %i[create destroy]
rescue_from ActiveRecord::RecordNotFound, with: :not_found
def create
render(status: :conflict) && return if Comment.exists?(user: @us... |
require 'spec_helper'
describe CommandLineReporter::Table do
context 'creation' do
it 'defaults options hash' do
expect {
CommandLineReporter::Table.new
}.to_not raise_error
end
it 'defaults the border' do
CommandLineReporter::Table.new.border.should be_false
end
it 'a... |
class CreateEquipment < ActiveRecord::Migration[5.2]
def change
create_table :equipment do |t|
t.references :brand, null: false
t.references :model, null: false
t.string :asset_tag, limit: 6
t.string :hostname
t.string :serial_number
t.string :phone_number
t.string :sim_n... |
katz_deli = []
def line(current_line)
if current_line.length == 0
puts "The line is currently empty."
else
line_string = "The line is currently: "
current_line.each_with_index do |name, index|
line_string += "#{index + 1}. #{name} "
end
line_string = line_string[(0..-2)]
puts line_str... |
$block_indent = 0
def better_log(desc, &block)
puts " "*$block_indent + "Beginning \"#{desc}\"..."
$block_indent += 1
result = block.call
$block_indent -= 1
puts " "*$block_indent + "...\"#{desc}\" finished, returning: #{result}"
end
better_log "outer block" do
better_log "some little block" do
better_... |
# == Schema Information
#
# Table name: users
#
# id :integer not null, primary key
# email :string(255) not null
# password_digest :string(255) not null
# session_token :string(255) not null
# created_at :datetime
# updated_at :datetime
#
class User < A... |
module CassandraObject
module BelongsTo
class Association
attr_reader :owner, :reflection
attr_accessor :record_variable
delegate :options, to: :reflection
def initialize(owner, reflection)
@loaded = false
@owner = owner
@reflection = reflection
end
de... |
FactoryGirl.define do
factory :hotel_context, class: Spree::Context do
ignore do
variant ""
adults 1
childs 1
plan "plan-all-inclusive"
start_date Date.today + 5
end_date Date.today + 10
end
line_item
after(:create) { |context, evaluator|
context_params = {}
... |
require 'rails_helper'
describe Contact, type: :model do
subject { build_stubbed(:contact) }
it 'has a valid factor' do
expect(subject).to be_valid
end
describe 'associations' do
it { should belong_to(:company) }
end
describe 'validations' do
it 'is not valid without a name' do
subject... |
class PhotosController < ApplicationController
def show
@photo = Photo.find(params[:id])
@comment = Comment.new
@comments = @photo.comments
end
def create
fan = current_account
concert = Concert.find(params[:concert_id])
photo = Photo.new(photo_params.merge(fan: fan, concert: concert))
... |
require "spec_helper"
RSpec.describe "Day 5: Hydrothermal Venture" do
let(:runner) { Runner.new("2021/05") }
let(:input) do
<<~TXT
0,9 -> 5,9
8,0 -> 0,8
9,4 -> 3,4
2,2 -> 2,1
7,0 -> 7,4
6,4 -> 2,0
0,9 -> 2,9
3,4 -> 1,4
0,0 -> 8,8
5,5 -> 8,2
TXT
... |
# As seen in the previous exercise, the time of day can be represented as the number of minutes before or after midnight. If the number of minutes is positive, the time is after midnight. If the number of minutes is negative, the time is before midnight.
# Write two methods that each take a time of day in 24 hour form... |
module Grape
class API
class << self
# Adds a route to the API for retreiving one instance
def get_one_route(resource_name, representer)
desc "Returns one #{resource_name}"
params do
requires :query_parameter_id, type: String, desc: "The id of the #{resource_name}"
e... |
ActiveAdmin.register Holiday do
permit_params :holiday_date
end
|
class AddIndexToApikeyKey < ActiveRecord::Migration[5.0]
def change
add_index :apikeys, :appid, unique: true
add_index :apikeys, :soapi, unique: true
add_index :apikeys, :mapi, unique: true
add_index :apikeys, :adminapi, unique: true
end
end
|
class CropsController < ApplicationController
before_action :authenticate_user!
def create
plant_id = params[:plant_id]
@crop = Crop.create(user_id: current_user.id, plant_id: plant_id)
@plant = Plant.find(plant_id)
@plant.cycles.each do |cycle|
@crop.crop_cycles.create(cycle_id: cycle.id)
end
redire... |
class AddBaseFieldToTransaction < ActiveRecord::Migration[5.0]
def self.up
add_column :transactions, :amount, :int
add_column :transactions, :status, :string
add_column :transactions, :method, :string
end
def self.down
remove_column :transactions, :amount, :int
remove_column :transactions, :s... |
require 'test_helper'
require 'gds_api/test_helpers/email_alert_api'
class EmailSignupsControllerTest < ActionController::TestCase
include FeedHelper
include GdsApi::TestHelpers::EmailAlertApi
view_test 'GET :new with a valid field displays the subscription form' do
topic = create(:topic)
get :new, para... |
class NotifyMe::Action < ActiveRecord::Base
self.table_name = "notify_me_actions"
belongs_to :notification
belongs_to :commandable, :polymorphic => true
validates :notification, :presence => true
validates :commandable_type, :presence => true
validates :commandable_action, :presence => true
valid... |
class SendNotificationsJob
include Sidekiq::Worker
sidekiq_options queue: 'send_email', :retry => true
def perform(event_id)
event = Event.find(event_id)
users = Users.where(theme_id: event.theme_id, city_id: event.city_id)
.where("starts_at <= ? and finish_at >= ?", event.starts_at, event.f... |
module BlacklightSolrplugins
module HelperBehavior
def xfacet_record_count(count)
if count > 0
"(#{count} record#{count > 1 ? 's' : ''})"
end
end
# hook for transforming the reference type value into a human-readable string
def xfacet_ref_type_display(ref)
ref.humanize.capi... |
require File.dirname(__FILE__) + '/../../spec_helper'
describe "/title_reviews/new.html.erb" do
include TitleReviewsHelper
before(:each) do
@title_review = mock_model(TitleReview)
@title_review.stub!(:new_record?).and_return(true)
@title_review.stub!(:user_id).and_return("1")
@title_review.stub!... |
#
# Cookbook Name:: cc_rails_app
# Recipe:: portal
#
# Copyright 2011, YOUR_COMPANY_NAME
#
# All rights reserved - Do Not Redistribute
#
include_recipe "unzip"
include_recipe "xslt"
include_recipe "cc_rails_app::default"
cc_rails_app "portal" do
app :portal
end
config = node[:cc_rails_app][:portal]
root = config[... |
# == Schema Information
#
# Table name: incidents
#
# id :integer not null, primary key
# student_id :integer
# user_id :integer
# institution :integer
# description :text
# date_incident :date
# soluction :text
# created_at :datetime not null
# u... |
class Tree < ActiveRecord::Base
has_many :branches
has_many :nuts
has_many :squirrels, through: :branches
end
|
class Cambiandoproductos < ActiveRecord::Migration
def change
rename_column :productos, :cantidad, :url
end
end
|
Pod::Spec.new do |s|
s.name = 'Pingpp'
s.version = '2.2.3'
s.summary = 'Pingplusplus iOS SDK'
s.description = <<-DESC
移动应用支付接口。
开发者不再需要编写冗长的代码,简单几步就可以使你的应用获得支付功能。
让你的移动应用接入支付像大厦接入电力一样简单,方便,和温暖。
支持微信支付,公众账号支付,支付宝钱包,百度钱... |
require 'set'
module Hutch
# Include this module in a class to register it as a consumer. Consumers
# gain a class method called `consume`, which should be used to register
# the routing keys a consumer is interested in.
module Consumer
attr_accessor :broker, :delivery_info
def self.included(base)
... |
class Klasa < ApplicationRecord
has_many :students
end |
class CreateUsages < ActiveRecord::Migration
def change
create_table :usages do |t|
t.date :month
t.decimal :elec
t.decimal :gas
t.decimal :biomass
t.decimal :chp_elec
t.decimal :chp_gas
t.decimal :wind
t.decimal :solar
t.timestamps
end
end
end
|
require 'sqlite3/errors'
require 'sqlite3/resultset'
class String
def to_blob
SQLite3::Blob.new( self )
end
end
module SQLite3
# A class for differentiating between strings and blobs, when binding them
# into statements.
class Blob < String; end
# A statement represents a prepared-but-unexecuted SQL... |
class AddBankcodeToTransactionLogs < ActiveRecord::Migration
def change
add_column :transaction_logs, :bank_code, :string
end
end
|
require 'json'
require 'uri'
require 'net/http'
class CamundaExternalTaskScript
attr_reader :request
def run
loop do
url = URI("https://auth-staging.creditas.com.br/api/internal_clients/tokens")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.ne... |
# -*- encoding: utf-8 -*-
Gem::Specification.new do |s|
s.name = "at_fork"
s.version = "0.0.1"
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
s.authors = ["Vasily Fedoseyev"]
s.email = ["vasilyfedoseyev@gmail.com"]
s.date = %q{2011-04-15}
s.descr... |
class FontNotoNastaliqUrdu < Formula
head "https://noto-website-2.storage.googleapis.com/pkgs/NotoNastaliqUrdu-unhinted.zip", verified: "noto-website-2.storage.googleapis.com/"
desc "Noto Nastaliq Urdu"
homepage "https://www.google.com/get/noto/#nastaliq-aran"
def install
(share/"fonts").install "NotoNastal... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.