Skip to content

Instantly share code, notes, and snippets.

@volodymyr-nt
volodymyr-nt / config.yml
Created October 25, 2018 20:01 — forked from osulyanov/config.yml
Circle CI workflows config to test and deploy Ruby on Rails application with PostgreSQL database. Test with Rspec, precompile assets then deploy with Capistrano.
# Ruby CircleCI 2.0 configuration file
#
# Check https://circleci.com/docs/2.0/language-ruby/ for more details
#
defaults: &defaults
working_directory: ~/repo
docker:
- image: circleci/ruby:2.4.1-node-browsers
environment:
@volodymyr-nt
volodymyr-nt / action_policy__i18n.rb
Created August 22, 2018 13:34 — forked from palkan/action_policy__i18n.rb
ActionPolicy i18n basics
# See issue: https://github.com/palkan/action_policy/issues/15
module ActionPolicy
module I18n
class << self
def full_message(policy_class, rule)
# generate candidates
candidates = [:"#{policy_class.identifier}.#{rule}"]
# add global fallbacks
@volodymyr-nt
volodymyr-nt / gist:5f720c89a9af12bde52fa52db571d2ca
Created December 12, 2016 13:13 — forked from stuart11n/gist:9628955
rename git branch locally and remotely
git branch -m old_branch new_branch # Rename branch locally
git push origin :old_branch # Delete the old branch
git push --set-upstream origin new_branch # Push the new branch, set local branch to track the new remote
@volodymyr-nt
volodymyr-nt / tmux-cheatsheet.markdown
Created November 12, 2016 16:58 — forked from MohamedAlaa/tmux-cheatsheet.markdown
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@volodymyr-nt
volodymyr-nt / gist:fe9fc4599039c3ca3151f18e1fa7f05b
Created September 24, 2016 21:24 — forked from rgo/gist:2025990
Gnome-shell dual monitor separate workspaces
# By default the behavior is:
# Primary monitor work as always and second monitor only have one and fixed workspace
# I.e. you change to next workspace, primary monitor change to this workspace and second monitor remain as is.
# The desired behaviour is:
# Primary monitor and secondary monitor are linked workspace.
# I.e. you change to next workspace, primary monitor change to this workspace and second monitor too.
$ gconf-editor
# Look for /desktop/gnome/shell/windows/workspaces_only_on_primary and set to false
@volodymyr-nt
volodymyr-nt / rubocop_pre_commit_hook
Created August 8, 2016 15:50 — forked from mpeteuil/rubocop_pre_commit_hook
Ruby style guide git pre-commit hook using Rubocop as the style guide checker. Only runs on staged ruby files that have been added and/or modified.
#!/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
@volodymyr-nt
volodymyr-nt / Enhance.js
Created July 31, 2016 00:40 — forked from sebmarkbage/Enhance.js
Higher-order Components
import { Component } from "React";
export var Enhance = ComposedComponent => class extends Component {
constructor() {
this.state = { data: null };
}
componentDidMount() {
this.setState({ data: 'Hello' });
}
render() {
@volodymyr-nt
volodymyr-nt / osx-10.11-setup.md
Created April 24, 2016 10:29 — forked from kevinelliott/osx-10.11-setup.md
Mac OS X 10.11 El Capitan Setup

Mac OS X 10.11 El Capitan

Custom recipe to get OS X 10.11 El Capitan running from scratch, setup applications and developer environment. This is very similar (and currently mostly the same) as my 10.10 Yosemite setup recipe (as found on this gist https://gist.github.com/kevinelliott/0726211d17020a6abc1f). Note that I expect this to change significantly as I install El Capitan several times.

I use this gist to keep track of the important software and steps required to have a functioning system after a semi-annual fresh install. On average, I reinstall each computer from scratch every 6 months, and I do not perform upgrades between distros.

This keeps the system performing at top speeds, clean of trojans, spyware, and ensures that I maintain good organizational practices for my content and backups. I highly recommend this.

You are encouraged to fork this and modify it to your heart's content to match your own needs.

@volodymyr-nt
volodymyr-nt / ruby_setup.md
Created December 23, 2015 10:46 — forked from julionc/ruby_setup.md
Deploy Ruby On Rails on Ubuntu 14.04

Deploy Ruby On Rails on Ubuntu 14.04

Server: Nginx with Phusion Passenger

Ruby Version: 2.1.3

User System: deploy

User System

@volodymyr-nt
volodymyr-nt / Capfile.rb
Created November 11, 2015 20:26 — forked from osulyanov/Capfile.rb
Nginx + Unicorn + Capistrano http://habrahabr.ru/post/120368/
load 'deploy'
# Uncomment if you are using Rails' asset pipeline
load 'deploy/assets'
load 'config/deploy' # remove this line to skip loading any of the default tasks