Skip to content

Instantly share code, notes, and snippets.

Dimitry Nazarov dimanyc

  • thoughtbot
  • Brooklyn, NY
Block or report user

Report or block dimanyc

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View .vimrc
set nocompatible " be iMproved, required
filetype off " required
"--- Vundle
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
map <Leader>t :call RunCurrentSpecFile()<CR>
dimanyc / array_refinement.rb
Created Jun 7, 2017
MemberUniqualizer Array Refinement
View array_refinement.rb
module MemberUniquelizer
refine Array do
# makes each member within an array
# unique by appending a unique number
def uniquelize(ary = self) { |member| format_member(member) }
View node.rb
### Node Class
using MemberUniquelizer
class Node < HashWithIndifferentAccess
attr_reader :id
# constructs a new hash based on injected
# headers and attributes
def self.from_rows(headers, attributes)
headers = uniqualize_headers(headers)
dimanyc / gist:fd9568f4b58991c5b255a0d18adfd3d8
Created Sep 2, 2016 — forked from metaskills/gist:4065702
Example Of Other/Legacy DB Connection Management & Query Cache
View gist:fd9568f4b58991c5b255a0d18adfd3d8
# Assuming you champioin your other DB connection with a class.
module OtherDb
class Connection < ActiveRecord::Base
establish_connection :other_db
self.abstract_class = true
# Alway use the connection for other/legacy connections.
View .tmux.conf
set -g default-terminal "screen-256color"
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-sensible'
set -g @plugin 'tmux-plugins/tmux-copycat'
set -g @plugin 'tmux-plugins/tmux-yank'
# Use vim keybindings in copy mode
setw -g mode-keys vi
bind [ copy-mode
View .Xresources
XTerm*faceName: Bitstream Vera Serif Mono
xterm*faceSize: 13
xterm*vt100*geometry: 80x60
xterm*saveLines: 16384
xterm*VT100.Translations: #override \
Ctrl Shift <Key>V: insert-selection(CLIPBOARD) \n\
Ctrl Shift <Key>C: copy-selection(CLIPBOARD)
# update Xterm config:
dimanyc /
Last active Jul 14, 2016
basic VIM commands


v(*)"+y - will copy lines selected in Visual mode.


zfat or zfit - folds HTML by indentation?

Find / Replace:

:s%/foo/bar/g - Change each 'foo' to 'bar', (% means in every line)

dimanyc / capybara cheat sheet
Last active Mar 2, 2016 — forked from zhengjia/capybara cheat sheet
capybara cheat sheet
View capybara cheat sheet
=Clicking links and buttons=
click_link('Link Text')
click('Link Text') # Click either a link or a button
click('Button Value')

Common Google Analytics RegEx operators

^   beginning of string
$   end of string
.   any character (wildcard)
*   match 0 or more times
+   match 1 or more times 
?   match 0 or 1 time
|   alternative
dimanyc / doskey.bat
Last active Oct 22, 2015 — forked from PierreMage/PowerShell-profile.ps1
Make your Windows command line better with doskey
View doskey.bat
:: F7 = history
:: Alt+F7 = history -c
:: F8 = Ctrl+R
:: Use & to run multiple commands e.g.: command1 & command2
:: 1. Go to your Windows folder and find regedit.exe
:: 2. Head over to:
:: HKEY_LOCAL_MACHINE\Software\Microsoft\Command
:: or
You can’t perform that action at this time.