This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
dict = ENV.fetch('DICTIONARY', ["две", "сотни", "тысячи"]) | |
string = ENV.fetch('WORD', "двесотни") | |
def in_dictionary?(dictionary:, string:) | |
formatted_string = string.gsub(/\s/, '') | |
squashed_dictionary = dictionary.flatten.each_with_object([]) do |i, res| | |
res << i.to_s unless i.nil? || i.empty? | |
end.uniq |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"SELECT *, (fund_value / COALESCE((SELECT value FROM currency_rates \n WHERE currency_rates.date <= pifs_transactions.date AND \n currency_rates.curr_code = 'RUB' \n ORDER BY date DESC LIMIT 1), 1)) as fund_value_converted, (sumall / COALESCE((SELECT value FROM currency_rates \n WHERE currency_rates.date <= pifs_transactions.date AND \n currency_rates.curr_code = 'RUB' \n ORDER BY date DESC LIMIT 1), 1)) as sumall_converted, (mark / COALESCE((SELECT value FROM currency_rates \n WHERE currency_rates.date <= pifs_transactions.date AND \n currency_rates.curr_code = 'RUB' \n ORDER BY date DESC LIMIT 1), 1)) as mark_converted, (tax / COALESCE((SELECT value FROM currency_rates \n WHERE currency_rates.date <= pifs_transactions.date AND \n currency_rates.curr_code = 'RUB' \n |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'gserver' | |
require 'socket' | |
require 'google_timezone' | |
require 'geokit' | |
require 'timezone' | |
class TimeServer < GServer | |
def initialize(port=3000, *args) | |
super(port, *args) | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ################################# | |
.yllw-fullscreen-hero{ | |
background-color: #eff3f6; | |
padding: 35px 40px; | |
padding-top: 35px; | |
padding-right: 40px; | |
padding-bottom: 35px; | |
padding-left: 40px; | |
border-radius: 5pt; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//////////////////////// | |
require 'sidekiq' | |
require 'json' | |
require 'net/http' | |
require 'net/https' | |
require 'uri' | |
module MagazCore | |
class WebhooksWorker |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module MagazCore | |
module ShopServices | |
class CreateEvent | |
include MagazCore::Concerns::Service | |
attr_accessor :event | |
def call(subject:, message:, description:, verb:) | |
@event = subject.events.new | |
MagazCore::Event.connection.transaction do |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Templates: | |
abandoned_checkout_notification: | |
name: 'Abandoned Checkout Notification' | |
title: 'Complete your Purchase' | |
body: 'Your shopping cart has been reserved and is waiting for your return!' | |
template_type: 'abandoned_checkout_notification' | |
contact_buyer: | |
name: 'Contact Buyer' | |
title: 'Order with some stuff' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'test_helper' | |
module MagazCore | |
class ShopServices::CreateInviteTest < ActiveSupport::TestCase | |
include Rails.application.routes.url_helpers | |
setup do | |
@shop = create(:shop, name: 'shop_name') | |
@host = shop_name.magaz.local:3000 | |
@email = '[email protected]' | |
end |