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
# You have an array of ints. Create function which groups numbers by sum of pairs | |
# (for example: sum = 5). Each element of array has to be used only once. | |
# function getPairs(arr, sum) { | |
# // ... | |
# } | |
# --- | |
# test data: | |
# input: [22, 3, 5, 0, 2, 2] | |
# resutls: [[3, 2], [5, 0]] | |
# input: [-5, 33, 2, 2, 3, 5, 0, 10, 3] |
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
upstream everbot-puma { | |
server unix:///home/deployer/apps/everbot/tmp/sockets/puma.sock fail_timeout=0; | |
} | |
server { | |
server_name bot.everlabs.com; | |
root /home/deployer/apps/everbot; | |
try_files $uri/index.html $uri @everbot-puma; |
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. create file in /etc/systemd/system/<your-puma>.service | |
[Unit] | |
Description=Puma HTTP Server Everbot | |
After=network.target | |
[Service] | |
# Foreground process (do not use --daemon in ExecStart or config.rb) | |
Type=simple |
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
require_relative 'log_to_db' | |
require_relative '../models/log_record' | |
require_relative '../models/report' | |
class ClientCheck | |
attr_accessor :users, :correct_users, :incorrect_users | |
def initialize(users) | |
@users = users |
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
var addressPoints = [ | |
[55.626808,37.745056,"2018-03-25 05:51:15 +0300","completed"], | |
[55.61932,37.719244,"2018-03-25 08:06:19 +0300","cancelled"], | |
[55.781224,37.450152,"2018-03-25 08:51:00 +0300","cancelled"], | |
[55.744244,37.56178,"2018-03-25 09:11:32 +0300","cancelled"], | |
[55.798368,37.569148,"2018-03-25 09:01:15 +0300","cancelled"], | |
[55.612116,37.61782,"2018-03-25 09:02:11 +0300","cancelled"], | |
[55.854308,37.408488,"2018-03-25 09:02:15 +0300","cancelled"], | |
[55.827344,37.649724,"2018-03-25 08:56:00 +0300","cancelled"], | |
[55.601236,37.61794,"2018-03-25 09:32:21 +0300","cancelled"] |
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
# in my experience, adding this will duplicate the filter list next to the input | |
en: | |
active_admin: | |
filters: | |
predicates: | |
not_eq: "Not equals" |
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
upstream app_1 { server unix:/home/deployer/apps/first_app/tmp/sockets/puma.sock fail_timeout=0; } | |
upstream app_2 { server unix:/home/deployer/apps/second_app/tmp/sockets/puma.sock fail_timeout=0; } | |
server { | |
listen 80; | |
server_name some.domen.ru; | |
return 301 https://$server_name$request_uri; | |
} |