Skip to content

Instantly share code, notes, and snippets.

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

Vasyl Shevchenko VasylShevchenko

🏃‍♂️
Running
View GitHub Profile
@VasylShevchenko
VasylShevchenko / readme.md
Created April 1, 2021 07:43 — forked from yosukehasumi/readme.md
DigitalOcean Rails/Ubuntu/NGINX (16.04) Setup

DigitalOcean Rails/Ubuntu/NGINX (16.04) Setup

  1. Setup
  2. Swapfile
  3. NGINX
  4. ElasticSearch
  5. RVM
  6. Rails
  7. Postgres
  8. Capistrano
@VasylShevchenko
VasylShevchenko / rails_setup.md
Created March 13, 2020 21:29 — forked from ryanflach/rails_setup.md
Common setup for a new Rails project
  1. rails new <project_name> -d postgresql --skip-turbolinks --skip-spring -T
  • -d postgresql sets up the project to use PostgreSQL
  • --skip-turbolinks & --skip-spring creates a project that does not use turbolinks or spring
  • -T skips the creation of the test directory and use of Test::Unit
  1. In the Gemfile:
  • Available to all environments:
    • gem 'figaro' - store environment variables securely across your app (docs)
    • Uncomment gem 'bcrypt', '~> 3.1.7' if you will be hosting your own user accounts with passwords (docs)
  • Inside of group :test:
    • gem 'rspec-rails' - user rspec in place of minitest (docs)

Project workflow:

  1. Load/Reload waffle.
  • Get most current list of actions for the project.
  1. Choose a card from the backlog in waffle. If we're working separately, it's best to move that card that you've chosen into ready and perhaps assign it to yourself as well.
  • Make sure multiple team members aren't working on the same issue; ensure everyone knows what each other is working on.
  1. git checkout master
  2. git pull origin master
  • Ensure you're starting on the master branch and have the most recent changes pulled down.
  1. run rspec
  • Make sure there are no outstanding issues with code on master.
module Encryptable
def encrypt(key)
crypt.encrypt_and_sign(key)
end
def decrypt(key)
crypt.decrypt_and_verify(key)
end
private
module Encryptable
def encrypt(key)
crypt.encrypt_and_sign(key)
end
def decrypt(key)
crypt.decrypt_and_verify(key)
end
private
@VasylShevchenko
VasylShevchenko / box-shadow.html
Created August 6, 2019 13:15 — forked from ocean90/box-shadow.html
CSS3 Box Shadow, only top/right/bottom/left and all
<!DOCTYPE html>
<html>
<head>
<title>Box Shadow</title>
<style>
.box {
height: 150px;
width: 300px;
margin: 20px;
@VasylShevchenko
VasylShevchenko / Breakpoints
Created August 5, 2019 21:06 — forked from janily/Breakpoints
Mobile-first CSS Media Queries Breakpoints
@media (min-width:320px) { /* smartphones, portrait iPhone, portrait 480x320 phones (Android) */ }
@media (min-width:480px) { /* smartphones, Android phones, landscape iPhone */ }
@media (min-width:600px) { /* portrait tablets, portrait iPad, e-readers (Nook/Kindle), landscape 800x480 phones (Android) */ }
@media (min-width:801px) { /* tablet, landscape iPad, lo-res laptops ands desktops */ }
@media (min-width:1025px) { /* big landscape tablets, laptops, and desktops */ }
@media (min-width:1281px) { /* hi-res laptops and desktops */ }
@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.
@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 / 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