Replace IRB with Pry (in your Gemfile) and Byebug with pry-byebug.
gem 'pry-rails', group: [:development, :test]
gem 'pry-byebug', group: [:development, :test]| #!/usr/bin/env ruby | |
| ADDED_OR_MODIFIED = /^\s*(A|AM|M)/.freeze | |
| changed_files = `git status --porcelain`.split(/\n/) | |
| unstaged_files = `git ls-files -m`.split(/\n/) | |
| changed_files = changed_files.select { |f| f =~ ADDED_OR_MODIFIED } | |
| changed_files = changed_files.map { |f| f.split(" ")[1] } |
| module BootstrapPaginationHelper | |
| class LinkRenderer < WillPaginate::ActionView::LinkRenderer | |
| protected | |
| def page_number(page) | |
| if page == current_page | |
| link(page, "#", :class => 'active') | |
| else | |
| link(page, page, :rel => rel_value(page)) | |
| end |
| Trix.config.lang = | |
| bold: "Жирный" | |
| bullets: "Маркерованный список" | |
| byte: "Байт" | |
| bytes: "Байты" | |
| captionPlaceholder: "Введите описание здесь…" | |
| captionPrompt: "Добавить описание…" | |
| code: "Код" | |
| heading1: "Заголовок" | |
| indent: "Увеличить уровень" |
| ### Nginx ### | |
| check process nginx with pidfile /opt/nginx/logs/nginx.pid | |
| start program = "/etc/init.d/nginx start" | |
| stop program = "/etc/init.d/nginx stop" | |
| if cpu > 60% for 2 cycles then alert | |
| if cpu > 80% for 5 cycles then restart | |
| if memory usage > 80% for 5 cycles then restart | |
| if failed host 127.0.0.1 port 80 protocol http then restart | |
| if 3 restarts within 5 cycles then timeout | |
| # 1) Create your private key | |
| $ cd ~/.ssh | |
| $ openssl genrsa -des3 -passout pass:x -out lvh.me.pass.key 2048 | |
| # 2) Generate RSA key | |
| $ openssl rsa -passin pass:x -in lvh.me.pass.key -out lvh.me.key | |
| # 3) Get rid of private key | |
| $ rm lvh.me.pass.key |
CloudFlare is an awesome reverse cache proxy and CDN that provides DNS, free HTTPS (TLS) support, best-in-class performance settings (gzip, SDCH, HTTP/2, sane Cache-Control and E-Tag headers, etc.), minification, etc.
| # A xterm-256color based TERMINFO that adds the escape sequences for italic. | |
| # | |
| # Install: | |
| # | |
| # tic xterm-256color-italic.terminfo | |
| # | |
| # Usage: | |
| # | |
| # export TERM=xterm-256color-italic | |
| # |
| = surround '(', ')' do | |
| %a{ href: "food" } chicken | |
| -# Produces: | |
| -# (<a href='food'>chicken</a>) | |
| = succeed '.' do | |
| %a{ href: "thing" } here | |
| -# Produces: | |
| -# <a href='thing'>here</a>. |