Skip to content

Instantly share code, notes, and snippets.

View Exact1990's full-sized avatar

Nikolay Zykov Exact1990

View GitHub Profile
В общем, если генерить её вот так:
formula = '= ИНДЕКС({"";"сто ";"двести ";"триста ";"четыреста ";"пятьсот ";"шестьсот ";"семьсот ";"восемьсот ";"девятьсот "};ОСТАТ(ОТБР(' + row_link + '/10^8);10)+1)&ВЫБОР(ОСТАТ(ОТБР(' + row_link + '/10^7);10)+1;"";ИНДЕКС({"десять ";"одиннадцать ";"двенадцать ";"тринадцать ";"четырнадцать ";"пятнадцать ";"шестнадцать ";"семнадцать ";"восемнадцать ";"девятнадцать "};ОСТАТ(ОТБР(' + row_link + '/10^6);10)+1);"двадцать ";"тридцать ";"сорок ";"пятьдесят ";"шестьдесят ";"семьдесят ";"восемьдесят ";"девяносто ")&ЕСЛИ(ОСТАТ(ОТБР(' + row_link + '/10^7);10)<>1;ИНДЕКС({"";"один ";"два ";"три ";"четыре ";"пять ";"шесть ";"семь ";"восемь ";"девять "};ОСТАТ(ОТБР(' + row_link + '/10^6);10)+1);"")&ЕСЛИ(ОСТАТ(ОТБР(' + row_link + '/10^6);1000);"миллион"&ЕСЛИ(ОСТАТ(ОТБР(' + row_link + '/10^7);10)=1;"ов ";ВПР(ОСТАТ(ОТБР(' + row_link + '/10^6);10);{0;"ов ":1;" ":2;"а ":5;"ов "};2));"")&ИНДЕКС({"";"сто ";"двести ";"триста ";"четыреста ";"пятьсот ";"шестьсот ";"семьсот ";"восемьсот ";"девятьсот "}
module ApplicationType
extend ActiveSupport::Concern
module ClassMethods
def model_name
superclass.model_name
end
def name
superclass.name
Doorkeeper.configure do
orm :active_record
resource_owner_authenticator do
#здесь логика на проверку access_token присланного
current_user
end
resource_owner_from_credentials do
#здесь логика на проверку пары логин-пароль, на выходе true or false
class UserSignInType
include ApplicationTypeWithoutActiveRecord
attribute :login, String
attribute :password, String
validates :login, :password, presence: true
validate :check_authenticate
class Network::ActionPostType < Network::ActionPost
include Concerns::DefaultPublishedToggle
include Concerns::RequiredPictureType
permit :published, :title, :title_en, :announcement, :announcement_en, :description, :description_en,
:mobile_site_description, :mobile_site_description_en, :mobile_app_description,
:mobile_app_description_en, :has_mobile_site_description, :has_mobile_site_description_en,
:has_mobile_app_description, :has_mobile_app_description_en, :cafe, :delivery
validates :mobile_site_description, presence: true, if: :has_mobile_site_description?
module SmsChannelRepository
extend ActiveSupport::Concern
include BaseRepository
module ClassMethods
def active
find_by(active: true)
end
end
end
@Exact1990
Exact1990 / rails http status codes
Created January 27, 2016 06:36 — forked from mlanett/rails http status codes
HTTP status code symbols for Rails
HTTP status code symbols for Rails
Thanks to Cody Fauser for this list of HTTP responce codes and their Ruby on Rails symbol mappings.
Status Code Symbol
1xx Informational
100 :continue
101 :switching_protocols
102 :processing