Skip to content

Instantly share code, notes, and snippets.

Avatar

Dimitry Nazarov dimanyc

  • thoughtbot
  • Brooklyn, NY
View GitHub Profile
@dimanyc
dimanyc / .vimrc
Last active Jun 19, 2020
.vimrc as of 5/17/20
View .vimrc
set nocompatible " be iMproved, required
filetype off " required
call plug#begin('~/.vim/plugged')
Plug 'MaxMEllon/vim-jsx-pretty'
Plug 'danilo-augusto/vim-afterglow'
Plug 'dense-analysis/ale'
Plug 'jparise/vim-graphql'
Plug 'junegunn/fzf', { 'do': './install --bin' }
Plug 'junegunn/fzf.vim'
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.
You can’t perform that action at this time.