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 gist:96b3eff608e5e10bb66b4dff901e4df1
let g:ctrlp_custom_ignore = 'node_modules\|DS_Store\|git\|tmp\|coverage'
View gist:e7daad788e90b48e9681cd0d52ccc791
map <Leader>t :call RunCurrentSpecFile()<CR>
map <Leader>s :call RunNearestSpec()<CR>
map <Leader>l :call RunLastSpec()<CR>
map <Leader>a :call RunAllSpecs()<CR>
let g:rspec_command = "!bundle exec rspec {spec} "
View gist:bdb1ae474daf0a759bca59d54056e20a
let g:molokai_original = 1
let g:rehash256 = 1
colorscheme molokai
" set background=dark
" set termguicolors
" let g:quantum_italics=1
" colorscheme quantum
View .coc.vimrc
" if hidden is not set, TextEdit might fail.
set hidden
" Some servers have issues with backup files, see #649
set nobackup
set nowritebackup
" Better display for messages
set cmdheight=2
View new vimrc using Plug
set nocompatible " be iMproved, required
filetype off " required
call plug#begin('~/.vim/plugged')
Plug 'ctrlpvim/ctrlp.vim'
Plug 'danilo-augusto/vim-afterglow'
Plug 'embear/vim-localvimrc'
Plug 'flazz/vim-colorschemes'
Plug 'mileszs/ack.vim'
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
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)
ary.map { |member| format_member(member) }
.flatten
.uniq
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
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
end
end
# 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
You can’t perform that action at this time.