Skip to content

Instantly share code, notes, and snippets.

View Synkevych's full-sized avatar
🇺🇦
Stand With Ukraine

Roman Synkevych

🇺🇦
Stand With Ukraine
View GitHub Profile
<!DOCTYPE html>
<html lang="en" >
<head>
<meta charset="UTF-8">
<title>CodePen - Space 404</title>
<style>
html,
body {
height: 100%;
width: 100%;
@Synkevych
Synkevych / cloudSettings
Last active December 18, 2020 21:55
First lessons for Python [tceh]
{"lastUpload":"2020-12-18T21:55:43.232Z","extensionVersion":"v3.4.2"}
@Synkevych
Synkevych / setup_rails_dependencies.sh
Created January 10, 2021 19:09
Automatically configure all project dependencies based on Rails framework.
#!/bin/bash
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
Synkevych / pre-push
Last active April 8, 2021 12:46
Run RSpec tests on pre-push - git hook for Rails projects
#!/bin/sh
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
else
echo "There no changes, move on to the next task"
@Synkevych
Synkevych / cloudSettings
Last active July 24, 2021 21:59
Visual Studio Code Settings Sync Gist
{"lastUpload":"2021-07-24T21:59:37.624Z","extensionVersion":"v3.4.3"}
#!/bin/sh
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
OLDBRANCH=$1
@Synkevych
Synkevych / pre-commit
Last active November 10, 2021 14:47
Run Rubocop on pre-commit - git hook for Rails projects.
#!/usr/bin/env ruby
require 'English'
require 'rubocop'
ADDED_OR_MODIFIED = /A|AM|^M/.freeze
changed_files = `git status --porcelain`.split(/\n/).
select { |file_name_with_status|
file_name_with_status =~ ADDED_OR_MODIFIED
@Synkevych
Synkevych / linux_commands.md
Last active February 1, 2022 13:00
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

FROM --platform=linux/amd64 ubuntu:18.04
LABEL maintainer Synkevych Roman "synkevych.roman@gmail.com"
RUN apt-get update && apt-get install -y \
language-pack-en openssh-server vim software-properties-common \
build-essential make gcc g++ zlib1g-dev git python3 python3-dev python3-pip \
gfortran autoconf libtool automake flex bison cmake git-core \
libeccodes0 libeccodes-data libeccodes-dev libeccodes-tools \
libnetcdff-dev unzip curl wget
@Synkevych
Synkevych / rails_shortcut.md
Last active November 21, 2023 16:14
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