Skip to content

Instantly share code, notes, and snippets.

Have fun

Roman Synkevych

Have fun
View GitHub Profile
Synkevych / cloudSettings
Last active Dec 18, 2020
First lessons for Python [tceh]
View cloudSettings
Synkevych / cloudSettings
Last active Jul 24, 2021
Visual Studio Code Settings Sync Gist
View cloudSettings
View 404_redirect.html
<!DOCTYPE html>
<html lang="en" >
<meta charset="UTF-8">
<title>CodePen - Space 404</title>
body {
height: 100%;
width: 100%;
Synkevych /
Last active Jan 17, 2022
Bash Commands and Tips for Beginners

Info about the system

whoami current user name
hostname current pc name
cat /etc/os-release - info about current system getent group sudo | cut -d: -f4 - show all sudo users
su - user2 - switch between users
sudo chmod a+rwx folderName/* add all access to the folder
chown -R username directory - add full permission directory and to all files and directories in that directory
chowd -R u+rX directory - the same as previous

Synkevych /
Last active Dec 30, 2021
Basic commands for working with a Rails project

Rails commands

irb - command to launch ruby interpreter in any directory
rails c - command lets you interact with your Rails application from the command line
reload! - reload rails environment if you had changed model functionality
gem outdated - show all outdated gems on project
gem update [<gem_name>] - update a specific gem
./bin/webpack-dev-server - start webpacker dev server for fast compiling
code $(bundle show gem_name) - shortcut to open a Ruby gem in VS Code

Synkevych /
Created Jan 10, 2021
Automatically configure all project dependencies based on Rails framework.
echo "This is a script to try automatically configure all project dependencies basid on Rails framework."
# exit on the first error
set -e
echo "Check Ruby version"
required_ruby_version=$(cat .ruby-version)
current_ruby_version=`/usr/bin/ruby -e 'puts RUBY_VERSION'`
Synkevych / pre-commit
Last active Nov 10, 2021
Run Rubocop on pre-commit - git hook for Rails projects.
View pre-commit
#!/usr/bin/env ruby
require 'English'
require 'rubocop'
changed_files = `git status --porcelain`.split(/\n/).
select { |file_name_with_status|
file_name_with_status =~ ADDED_OR_MODIFIED
Synkevych / pre-push
Last active Apr 8, 2021
Run RSpec tests on pre-push - git hook for Rails projects
View pre-push
changed_files=`git status --short`
if [ "$changed_files" ]; then
echo "There some changes:"
echo "$changed_files"
echo "please commit or reset them, before push."
exit 1
echo "There no changes, move on to the next task"
View post-checkout
echo "post-checkout hook will be executed"
# source rvm and .rvmrc if present
[ -s "$HOME/.rvm/scripts/rvm" ] && . "$HOME/.rvm/scripts/rvm"
[ -s "$PWD/.rvmrc" ] && . "$PWD/.rvmrc"
# rollback migrations if present