Skip to content

Instantly share code, notes, and snippets.

View k41n's full-sized avatar

Andrei Malyshev k41n

View GitHub Profile
FROM postgres:14.13
WORKDIR /app
RUN echo "deb http://archive.debian.org/debian stretch main" > /etc/apt/sources.list && \
apt-get update && apt install curl unzip groff -y && \
curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip" && \
unzip awscliv2.zip && \
./aws/install
RUN rm -r ./* && rm -rf /var/cache/apt
ENTRYPOINT ["/bin/bash"]
@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')
@k41n
k41n / prof.rb
Created September 8, 2017 12:01 — forked from teamon/prof.rb
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)
@k41n
k41n / task_report.rb
Created June 20, 2016 14:20
Tasks report script
#!/usr/local/bin/ruby
class AbstractTask < ActiveRecord::Base
self.table_name = 'tasks'
self.inheritance_column = nil
has_many :owners, through: :task_owners, source: :user
has_many :task_owners, dependent: :destroy, foreign_key: 'task_id'
has_many :work_logs, -> { order('started_at asc') }, dependent: :destroy, foreign_key: 'task_id'
COMPANY_ID = 953
LAST_WEEK = (Time.now - 1.week)..Time.now
@k41n
k41n / gist:11142946
Created April 21, 2014 13:37
issue with deckgrid
@media only screen and (min-device-width : 320px) and (max-device-width : 568px) and (orientation : landscape)
.entries-deckgrid[deckgrid]::before
content: '3 .column.column-1-3'
font-size: 0
visibility: hidden
.entries-deckgrid[deckgrid]::after
content: ' '
clear: both