Skip to content

Instantly share code, notes, and snippets.

View Synkevych's full-sized avatar
👀
Looking for a job

Roman Synkevych

👀
Looking for a job
View GitHub Profile
@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

@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

@amkisko
amkisko / .github__gitlab__rails_postgresql_redis_rspec_codecov
Last active September 12, 2023 07:31
Rails, GitHub Actions, GitLab CI, PostgreSQL, Redis, rspec, codecov, Apollo GraphQL
Configuration files for Rails-driven project basic continuous integration using GitHub Actions and GitLab CI.
2020, amkisko (Andrei Makarov).
@wxguy
wxguy / wgrib2_auto_compile_script.sh
Last active March 1, 2024 18:45
A small bash script to compile wgrib2 from source on Ubuntu OS...
#!/bin/bash
# License for this script is GNU 2
# A small bash script to download, compile and install latest wgrib2 from source.
# I have written this script so that I can automate the proceedure whenever I change Linux OS
# Make it executable before running the script using'chmod +x ./wgrib2_auto_compile_script.sh'
# Ensure to run the script with sudo (sudo ./wgrib2_auto_compile_script.sh) or under root environment

The PATH is an important concept when working on the command line. It's a list of directories that tell your operating system where to look for programs, so that you can just write script instead of /home/me/bin/script or C:\Users\Me\bin\script. But different operating systems have different ways to add a new directory to it:

Windows

  1. The first step depends which version of Windows you're using:
  • If you're using Windows 8 or 10, press the Windows key, then search for and
@hewerthomn
hewerthomn / install_postgresql9.3_postgis2.1_ubuntu.md
Last active October 19, 2020 09:02
Installing PostgreSQL 9.3 and PostGIS on Ubuntu 14.04

Remove old PostGIS Installation

The first step is to remove older version of PostGIS if any.

sudo apt-get purge postgis

Setup repository

wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -
sudo sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt/ trusty-pgdg main" >> /etc/apt/sources.list.d/postgresql.list'
@johnhamelink
johnhamelink / git-pre-push-hook-install.sh
Last active January 29, 2021 08:13 — forked from ssaunier/git-pre-push-hook-install.sh
Made the echo command output colour on a Linux terminal, removed karma and added a crunchbang
cd /path/to/your/repo
curl https://gist.githubusercontent.com/johnhamelink/577b8613ae82d2b3037b/raw/ad71fb72a1b86ee9a90ac62eccc4a55367578625/pre-push.sh > .git/hooks/pre-push
chmod u+x .git/hooks/pre-push
@sindresorhus
sindresorhus / post-merge
Last active February 14, 2024 06:20
git hook to run a command after `git pull` if a specified file was changed.In this example it's used to run `npm install` if package.json changed and `bower install` if `bower.json` changed.Run `chmod +x post-merge` to make it executable then put it into `.git/hooks/`.
#!/usr/bin/env bash
# MIT © Sindre Sorhus - sindresorhus.com
# git hook to run a command after `git pull` if a specified file was changed
# Run `chmod +x post-merge` to make it executable then put it into `.git/hooks/`.
changed_files="$(git diff-tree -r --name-only --no-commit-id ORIG_HEAD HEAD)"
check_run() {
echo "$changed_files" | grep --quiet "$1" && eval "$2"
@halloffame
halloffame / RubyDateFormats.md
Last active May 19, 2023 20:16
Quick reference for ruby date format abbreviations.

Date

Year

%Y - Year with century (can be negative, 4 digits at least) -0001, 0000, 1995, 2009, 14292, etc.

  • %C - year / 100 (round down. 20 in 2009)
  • %y - year % 100 (00..99)
@mucar
mucar / random_color_array.js
Created October 16, 2012 11:47
Javascript Random Color Array
var colorArray = ['#FF6633', '#FFB399', '#FF33FF', '#FFFF99', '#00B3E6',
'#E6B333', '#3366E6', '#999966', '#99FF99', '#B34D4D',
'#80B300', '#809900', '#E6B3B3', '#6680B3', '#66991A',
'#FF99E6', '#CCFF1A', '#FF1A66', '#E6331A', '#33FFCC',
'#66994D', '#B366CC', '#4D8000', '#B33300', '#CC80CC',
'#66664D', '#991AFF', '#E666FF', '#4DB3FF', '#1AB399',
'#E666B3', '#33991A', '#CC9999', '#B3B31A', '#00E680',
'#4D8066', '#809980', '#E6FF80', '#1AFF33', '#999933',
'#FF3380', '#CCCC00', '#66E64D', '#4D80CC', '#9900B3',
'#E64D66', '#4DB380', '#FF4D4D', '#99E6E6', '#6666FF'];