This file contains 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 device.id, device.name, device.created_at FROM devices as device | |
WHERE ( | |
( | |
SELECT device_id FROM device_zones AS zones | |
WHERE (zones.id IS NOT NULL AND zones.device_id = device.id) | |
LIMIT 1 | |
) IS NOT NULL | |
) LIMIT 4; |
This file contains 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
async loginHandler(evt) { | |
evt.preventDefault() | |
this.loading = true // Use This later to show a spinner | |
this.error = false // Reset error message if one exists | |
// Options for the ApiRequest | |
const options = { | |
method: 'POST', | |
url: '/auth/sign_in', | |
data: this.form |
This file contains 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
## Current | |
NotifictionConfig | |
properties: { | |
"ru" => { | |
"body" => "", | |
"subject" => "" | |
}, | |
} | |
## Sample 1 // Dictionary version. |
This file contains 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
# frozen_string_literal: true | |
class ApplicationService | |
attr_reader :errors | |
## Etc. | |
def self.call(params) | |
new(params).process | |
end |
This file contains 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
class KafkaProducer | |
include Singleton | |
class << self | |
def assign_kafka | |
kafka = Kafka.new( | |
ENV.fetch('KAFKA_BROKERS').split(','), | |
sasl_scram_username: ENV['KAFKA_USERNAME'], | |
sasl_scram_password: ENV['KAFKA_PASSWORD'], | |
sasl_scram_mechanism: ENV['KAFKA_MECHANISM'], |
This file contains 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
arr = [2, 4, 5, 5, 8, 9, 11, 13] | |
t = 14 | |
min_index = 0 | |
max_index = arr.length - 1 | |
success = false | |
while (min_index != max_index) && !success do | |
sum = arr[min_index] + arr[max_index] | |
if sum > t |
This file contains 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
Need to do a series of string updates for the Property Page, Dashboard and Po Dashboard | |
1. Property / Index | |
1.1 `$string_old` -> `$string_new` | |
1.2 .. | |
2. Property / Show | |
2.1 `$string_old` -> `$string_new` | |
2.2 .. |
This file contains 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
294767818 | |
8929244 | |
16187546 | |
4902154 | |
151077392 |
This file contains 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
1. 139111249 | |
2. 16187546 |
This file contains 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
# Иногда менеджерам требуется составлять шаблоны писем с динамическими данными. | |
# Поэтому требуется разработать сервис, который позволит создавать и хранить шаблоны, | |
# а также отправлять письма на их основе. | |
# Данные: | |
Account(balance:float currency:string name:string email:string) | |
Message(title:string, text:text) | |
# Пример сообщения: "Здравствуйте, {{name}}. Ваш баланс: {{balance}}{{currency}}". |
NewerOlder