Skip to content

Instantly share code, notes, and snippets.

View VasylShevchenko's full-sized avatar
🏃‍♂️
Running

Vasyl Shevchenko VasylShevchenko

🏃‍♂️
Running
View GitHub Profile
function putZeroDate(number) {
if (number <= 9) {
return '0' + number;
}
return number;
}
function dateFormat(dateTime) {
if (new Date(dateTime) == 'Invalid Date') {
return 'Invalid Date'
@VasylShevchenko
VasylShevchenko / git_flow.md
Last active November 2, 2018 20:19 — forked from PavloBezpalov/git_flow.md
Pivotal Git Flow

Git Flow

Working on stories

  1. Start story in pivotal tracker and copy it id (STORY_ID).

  2. Checkout development branch and pull from remote


Certbot

Working

  1. For get

    server {
      listen 80;
@VasylShevchenko
VasylShevchenko / terminal-git-branch-name.md
Last active October 24, 2021 15:49 — forked from joseluisq/terminal-git-branch-name.md
Add Git Branch Name to Terminal Prompt (Mac)

Add Git Branch Name to Terminal Prompt (Mac)

image

Open ~/.bash_profile in your favorite editor and add the following content to the bottom.

Version 1

@VasylShevchenko
VasylShevchenko / 1 SETUP Ubuntu 20.04 LTS (DigitalOcean)
Last active September 22, 2023 19:31
Deploy Rails to VPS(Ubuntu 20.04LTS). Nginx mainline + pagespeed, Puma with Jungle, Capistrano3, PostgreSQL, RVM, Certbot
//------ ROOT --------
root# apt-get update
root# apt-get upgrade
// Dependencies
apt-get install -y git-core curl zlib1g-dev build-essential libssl-dev libreadline-dev libyaml-dev \
libsqlite3-dev sqlite3 libxml2-dev libxslt1-dev libcurl4-openssl-dev software-properties-common libffi-dev \
libpcre3-dev unzip htop zip
# vim /etc/systemd/system/sidekiq.service
# sudo systemctl start sidekiq.service
# sudo systemctl enable sidekiq.service
[Unit]
Description=Sidekiq for emedcert (staging)
Wants=nginx.service postgresql.service
After=redis.service postgresql.service
[Service]
deploy:
image: ubuntu:latest
stage: deploy
only:
- master
before_script:
- 'which ssh-agent || ( apt-get update -y && apt-get install openssh-client -y )'
- apt-get install -y rsync
- mkdir -p ~/.ssh
- chmod 700 ~/.ssh
gem 'interactor'
gem 'whenever', require: false
gem 'render_async'
gem 'figaro'
gem 'dotenv'
gem 'dotenv-rails', groups: [:development, :test]
@VasylShevchenko
VasylShevchenko / .rubocop.yml
Created June 20, 2019 07:32 — forked from PavloBezpalov/.rubocop.yml
Rubocop settings that helps
AllCops:
DisplayCopNames: true
DisplayStyleGuide: true
TargetRubyVersion: 2.4
DisabledByDefault: true
Exclude:
- db/**/**
- bin/*
# Prefer &&/|| over and/or.
1) Go to bitbucket add ssh key Known hosts
// Add server id_rsa.pub to this link
https://bitbucket.org/winstrategy/NAME_PROJECT/admin/access-keys/
// Generate SSH pub and private and add pub to server
https://bitbucket.org/winstrategy/NAME_PROJECT/admin/addon/admin/pipelines/ssh-keys
// Add dotnet service
deployer$ sudo vim /etc/systemd/system/dotnet.service