Skip to content

Instantly share code, notes, and snippets.

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

Vasyl Shevchenko VasylShevchenko

🏃‍♂️
Running
View GitHub Profile
@iscle
iscle / gist:66e946553e74a883b4494d3b6df0ee82
Last active April 2, 2025 23:59
Install python2.7 on Ubuntu 23.04 as "python"
wget https://www.python.org/ftp/python/2.7.18/Python-2.7.18.tgz
tar xzf Python-2.7.18.tgz
cd Python-2.7.18
sudo ./configure --enable-optimizations
sudo make altinstall
sudo ln -s "/usr/local/bin/python2.7" "/usr/bin/python"
@ruslan-oliinyk
ruslan-oliinyk / env_variables.md
Last active May 27, 2021 10:08
How to use the same variables inside Ruby ​​and JS code at the same time

How to use the same variables inside Ruby and JS code at the same time

Prerequisites:

  • Ruby 2.3+
  • Rails 5.1+
  • Webpacker 4.x.x
  • Node.js 8.16.0+
  • Yarn 1.x+
@shmdt
shmdt / Encryptable
Last active November 7, 2019 10:11
module Encryptable
def encrypt(key)
crypt.encrypt_and_sign(key)
end
def decrypt(key)
crypt.decrypt_and_verify(key)
end
private
@PavloBezpalov
PavloBezpalov / .rubocop.yml
Created June 19, 2019 14:01
Rubocop settings that helps
AllCops:
DisplayCopNames: true
DisplayStyleGuide: true
TargetRubyVersion: 2.4
DisabledByDefault: true
Exclude:
- db/**/**
- bin/*
# Prefer &&/|| over and/or.
@strangerxx
strangerxx / 1 setup vps
Last active September 18, 2024 21:07 — forked from PavloBezpalov/1 setup vps
Deploy Rails 5.2.1 to VPS(Ubuntu 18.04.1 LTS). Nginx mainline + pagespeed, Puma with Jungle, Capistrano3, PostgreSQL 11, RVM, Certbot
root# apt-get update
root# apt-get upgrade
// dependencies for Ruby
root# 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
// Node.js v7
root# curl -sL https://deb.nodesource.com/setup_14.x | sudo -E bash -
@jgravois
jgravois / aphorisms.md
Last active April 10, 2019 00:22
Questionable career advice
@PavloBezpalov
PavloBezpalov / git_flow.md
Last active November 2, 2018 20:20
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

@PavloBezpalov
PavloBezpalov / 1 setup vps
Last active August 19, 2024 15:09
Deploy Rails 5.1.1 to VPS(Ubuntu 16.04.2 LTS). Nginx mainline + pagespeed, Puma with Jungle, Capistrano3, PostgreSQL 9.6, RVM, Certbot
root# apt-get update
root# apt-get upgrade
// dependencies for Ruby
root# 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 python-software-properties libffi-dev \
libpcre3-dev unzip
// Node.js v7
root# curl -sL https://deb.nodesource.com/setup_7.x | sudo -E bash -
@acbilimoria
acbilimoria / initial-server-setup.sh
Last active September 23, 2024 13:28
Initial Server Setup -- Ubuntu 16.04 Digital Ocean
# to run:
# find and replace username with your username
adduser username
usermod -aG sudo username
su - username
mkdir ~/.ssh
chmod 700 ~/.ssh
vim ~/.ssh/authorized_keys
chmod 600 ~/.ssh/authorized_keys
@ryanflach
ryanflach / rails_setup.md
Last active November 13, 2023 19:49
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)