Skip to content

Instantly share code, notes, and snippets.

View YarikST's full-sized avatar
👨‍💻
Focusing

Malyk Yaroslav YarikST

👨‍💻
Focusing
View GitHub Profile
@YarikST
YarikST / gist:b5179f0b192bdc67c1194f44f56509a4
Created August 3, 2022 15:29
Run Rubocop only on changed files
1. Create cop.diff file. On theses files we would run Rubocop
git diff-tree -r --no-commit-id --name-only --diff-filter=dr head origin/master > cop.diff
diff-filter - allow to filter some records, we dont need deleted file
origin/master - is a target for comparison
2. Run Rubocop
cat cop.diff | xargs bundle exec rubocop -A
@YarikST
YarikST / Interview
Created April 13, 2022 10:31
Questions for interviewee
Link: https://docs.google.com/document/d/1xkiuwVO6vZvhLO6DnYpjbeHW2I-OWYF01OeaM_EEIok/edit?usp=sharing
#More detali safepal and mobstar
google api key - https://developers.google.com/maps/documentation/javascript/get-api-key
doc - https://github.com/tomchentw/react-google-maps
//--authorization
import React from "react"
import { compose, withProps } from "recompose"
import { withScriptjs, withGoogleMap } from "react-google-maps"
export default Map =>
DROP TABLE IF EXISTS contacts;
CREATE TEMP TABLE contacts
as
select *
from (
VALUES
(1::int, 'abc'::VARCHAR),
(2::int, 'Aac'::VARCHAR),
(3::int, 'bvC'::VARCHAR),
(4::int, 'Bvc'::VARCHAR),
DROP TABLE IF EXISTS histories;
CREATE TEMP TABLE histories
as
select *
from (
VALUES
(1::int, 1::int, 'status_1'::VARCHAR),
(2::int, 1::int, 'status_1'::VARCHAR),
(3::int, 1::int, 'status_1'::VARCHAR),
(4::int, 2::int, 'status_2'::VARCHAR),
sudo nano /etc/init.d/sidekiq
#!/bin/sh
# File: /etc/init.d/sidekiq
### BEGIN INIT INFO
# Provides: unicorn
# Required-Start: $local_fs $remote_fs $network $syslog
# Required-Stop: $local_fs $remote_fs $network $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: starts the sidekiq
touch /lib/systemd/system/sidekiq.service
# Run:
# - systemctl enable sidekiq
# - systemctl {start,stop,restart} sidekiq
#
# This file corresponds to a single Sidekiq process. Add multiple copies
# to run multiple processes (sidekiq-1, sidekiq-2, etc).
#
# See Inspeqtor's Systemd wiki page for more detail about Systemd:
# https://github.com/mperham/inspeqtor/wiki/Systemd
#acme
location ^~/.well-known {
default_type "text/plain";
root /var/www/html;
}
events {
worker_connections 768; #10000 Load balancer
multi_accept on;
}
#Load balancer redirect http to https and http to www-version
. Update system
sudo apt update -y && sudo apt upgrade -y && sudo apt full-upgrade -y
. Install standart
sudo apt-get install -y libmagickwand-dev imagemagick ffmpeg libpq-dev htop curl git gem gnupg build-essential
*node.js(auto install npm) - https://nodejs.org/en/download/package-manager
curl -sL https://deb.nodesource.com/setup_9.x | sudo -E bash -
sudo apt-get install -y nodejs
sudo ln -sf /usr/bin/nodejs /usr/local/bin/node
. Install Rvm with Ruby and standart configureted
sudo gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 7D2BAF1CF37B13E2069D6956105BD0E739499BDB