Skip to content

Instantly share code, notes, and snippets.

View k41n's full-sized avatar

Andrei Malyshev k41n

View GitHub Profile
@k41n
k41n / .vimrc
Last active September 20, 2021 10:20
VIM config
set nocompatible " choose no compatibility with legacy vi
filetype off " required
"" Plugins
if empty(glob('~/.vim/autoload/plug.vim'))
silent !curl -fLo ~/.vim/autoload/plug.vim --create-dirs
\ https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
autocmd VimEnter * PlugInstall --sync | source $MYVIMRC
endif
call plug#begin('~/.vim/plugged')
@teamon
teamon / prof.rb
Created June 5, 2013 14:56
Profile rails controller with ruby-prof
# gem "ruby-prof"
around_filter :profiler
def profiler(&block)
data = RubyProf::Profile.profile(&block)
filepath = Rails.root.join("tmp", "profiler.html")
File.open(filepath, "w") do |f|
RubyProf::CallStackPrinter.new(data).print(f)