Skip to content

Instantly share code, notes, and snippets.

YarikST

Block or report user

Report or block YarikST

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View Google maps
#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 =>
View Contacts list ABC
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),
View Full Text Search
View AGR element or group in jsoin
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),
View Sidekiq servise
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
View Sidekiq systemctl
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
View Nginx
#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
View Deploy
. 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
View Bash pull
sudo nano /usr/sbin/pull
#!/bin/bash
# Load RVM into a shell session *as a function*
printf "Load RVM.\n"
if [[ -s "$HOME/.rvm/scripts/rvm" ]] ; then
# First try to load from a user install
source "$HOME/.rvm/scripts/rvm"
elif [[ -s "/usr/local/rvm/scripts/rvm" ]] ; then
# Then try to load from a root install
source "/usr/local/rvm/scripts/rvm"
View Recursive Categories
DROP TABLE IF EXISTS categories;
DROP TABLE IF EXISTS product_categories;
DROP TABLE IF EXISTS products;
CREATE TEMP TABLE categories
as
select *
from (
VALUES
(1 :: int, 'a' :: VARCHAR, null),
(2 :: int, 'b' :: VARCHAR, null),
You can’t perform that action at this time.