Skip to content

Instantly share code, notes, and snippets.

@ovc
ovc / tmux.conf
Created April 3, 2014 15:09 — forked from shinzui/tmux.conf
# ~/.tmux.conf
#
# See the following files:
#
# /opt/local/share/doc/tmux/t-williams.conf
# /opt/local/share/doc/tmux/screen-keys.conf
# /opt/local/share/doc/tmux/vim-keys.conf
#
# URLs to read:
#
@ovc
ovc / grok_vi.mdown
Last active August 29, 2015 14:15 — forked from nifl/grok_vi.mdown

Answer by Jim Dennis on Stack Overflow question http://stackoverflow.com/questions/1218390/what-is-your-most-productive-shortcut-with-vim/1220118#1220118

Your problem with Vim is that you don't grok vi.

You mention cutting with yy and complain that you almost never want to cut whole lines. In fact programmers, editing source code, very often want to work on whole lines, ranges of lines and blocks of code. However, yy is only one of many way to yank text into the anonymous copy buffer (or "register" as it's called in vi).

The "Zen" of vi is that you're speaking a language. The initial y is a verb. The statement yy is a simple statement which is, essentially, an abbreviation for 0 y$:

0 go to the beginning of this line. y yank from here (up to where?)

@ovc
ovc / monit.rc
Last active August 31, 2015 14:06 — forked from vkurennov/monit.rc
Пример конфига для запуска процессов через monit
### 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
@ovc
ovc / production.rb
Last active August 31, 2015 14:06 — forked from vkurennov/production.rb
Пример конфига unicorn
# paths
app_path = "/home/deployer/qna"
working_directory "#{app_path}/current"
pid "#{app_path}/current/tmp/pids/unicorn.pid"
# listen
listen "/tmp/unicorn.qna.sock", :backlog => 64
# logging
stderr_path "log/unicorn.stderr.log"
@ovc
ovc / always-view-mode.emacs
Created December 9, 2015 07:42 — forked from valvallow/always-view-mode.emacs
emacs, view-mode, find-file-hook
(add-hook 'find-file-hook
'(lambda ()
(interactive)
(view-mode)))
(setq mu4e-mu-binary "/usr/local/bin/mu"
mu4e-sent-folder "/[Gmail].Sent Mail"
mu4e-drafts-folder "/[Gmail].Drafts"
mu4e-trash-folder "/[Gmail].Trash"
mu4e-refile-folder "/Archives"
mu4e-use-fancy-chars nil)
(setq user-mail-address "foo"
user-full-name "bar"
mail-user-agent 'message-user-agent
@ovc
ovc / tmux-cheatsheet.markdown
Created March 10, 2017 11:09 — forked from MohamedAlaa/tmux-cheatsheet.markdown
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@ovc
ovc / Vendor_05ac_Product_0220.kcm
Created July 30, 2017 17:39 — forked from jettero/Vendor_05ac_Product_0220.kcm
Android Keymap and Charmap files — that I used to reverse the Fn key results for my Anker® T300 Ultra-Slim Mini Bluetooth 3.0 Wireless Keyboard
# Copyright (C) 2010 The Android Open Source Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
@ovc
ovc / org-mode-reference-in.org
Created September 7, 2017 08:06 — forked from drj42/org-mode-reference-in.org
This is a cheat sheet for Emacs org-mode... in org-mode format!
@ovc
ovc / summary.org
Created December 9, 2017 09:01 — forked from Profpatsch/summary.org
Summary of the Talk “Literate DevOps With Emacs”