This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
load 'scratch.rb' | |
include Scratch | |
default_command_set = Pry::CommandSet.new do | |
command "scratch!", "reload scratch" do |str| | |
load 'scratch.rb' | |
end | |
end | |
Pry.config.commands.import default_command_set |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# if(statement) | |
https://i.stack.imgur.com/MKgie.png | |
#if statement1 == statement2 | |
https://i.stack.imgur.com/5bdbd.png | |
#if st1 === st2 | |
https://i.stack.imgur.com/mmvud.png |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# network manager applet | |
nm-applet |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# linux symbols | |
http://panmental.de/symbols/info.htm | |
#shows special keys matching(alt, ctrl, win) | |
xmodmap | |
# for windows, setup diff windows on start | |
https://faq.i3wm.org/question/243/how-do-i-use-an-exclude-regex-in-i3-config/%3C/p%3E.html | |
# back workspace to external monitor |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# add new user to apache authorization | |
# /etc/apache2/.htpasswd - authorization file, can be rewtitted by website | |
# apache configuration | |
sudo htpasswd /etc/apache2/.htpasswd another_user |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# run specific test | |
ruby my_test -n test_my_test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# check if variables is set | |
if [[ $1 ]]; then | |
echo 'variable is set!' | |
else | |
echo 'ERROR: variable is not set!' | |
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# copy migrations from engine | |
rake railties:install:migrations | |
# record not new/new | |
persisted? # new_record? | |
# execute query in console | |
ActiveRecord::Base.connection.execute("foo") | |
# string to class |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# show changed files for specific commit | |
git show --pretty="format:" --name-only SHA | |
#debugging with git | |
https://git-scm.com/book/ru/v1/%D0%98%D0%BD%D1%81%D1%82%D1%80%D1%83%D0%BC%D0%B5%D0%BD%D1%82%D1%8B-Git-%D0%9E%D1%82%D0%BB%D0%B0%D0%B4%D0%BA%D0%B0-%D1%81-%D0%BF%D0%BE%D0%BC%D0%BE%D1%89%D1%8C%D1%8E-Git | |
# cheatsheet for git | |
https://medium.com/@ABatickaya/%D1%88%D0%BF%D0%B0%D1%80%D0%B3%D0%B0%D0%BB%D0%BA%D0%B0-%D0%BF%D0%BE-git-55eeea487676#.gmoc1vf40 | |
git log --after="2013-11-12 00:00" --before="2013-11-12 23:59" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# always restart code like in development | |
touch tmp/always_restart.txt | |
# restart only once | |
touch tmp/restart.txt |