Skip to content

Instantly share code, notes, and snippets.

View Andrew8xx8's full-sized avatar

Andrew Kulakov Andrew8xx8

View GitHub Profile
@Andrew8xx8
Andrew8xx8 / .rubocop.yml
Last active May 8, 2020 00:09
.rubocop.yml
AllCops:
Exclude:
- db/**/*
- config/**/*
- node_modules/**/*
- bin/*
- vendor/**/*
Bundler/OrderedGems:
Enabled: false
@Andrew8xx8
Andrew8xx8 / readme.md
Last active December 24, 2019 19:15
rename на OSX

Установка OSX

Открыть терминал и выполнить последовательно две команды

/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
brew install rename
@Andrew8xx8
Andrew8xx8 / validate.rb
Created February 5, 2019 08:26
Ruby DSL
class A
def self.validates(attribute, options)
p 'define validator', attribute, options
@@validatos ||= {}
@@validatos[attribute] = options
p '/define validator'
end
def valid?
@@validatos.keys.map do |attribute|
@Andrew8xx8
Andrew8xx8 / ssl_puma.sh
Created March 5, 2018 09:45 — forked from tadast/ssl_puma.sh
localhost SSL with puma
# 1) Create your private key (any password will do, we remove it below)
$ cd ~/.ssh
$ openssl genrsa -des3 -out server.orig.key 2048
# 2) Remove the password
$ openssl rsa -in server.orig.key -out server.key
[[1, 36, 0], [0, 36, 22], [1, 40, 96], [0, 40, 117], [1, 36, 192], [0, 36, 213], [1, 44, 288], [0, 44, 304], [1, 36, 384], [0, 36, 409], [1, 40, 480], [0, 40, 499], [1, 36, 576], [0, 36, 597], [1, 44, 672], [0, 44, 692], [1, 36, 768], [0, 36, 789], [1, 40, 864], [0, 40, 883], [1, 36, 960], [0, 36, 982], [1, 44, 1056], [0, 44, 1073], [1, 36, 1152], [0, 36, 1173], [1, 40, 1248], [0, 40, 1268], [1, 36, 1344], [0, 36, 1363], [1, 44, 1440], [0, 44, 1459], [1, 36, 1536], [0, 36, 1556], [1, 40, 1632], [0, 40, 1652], [1, 36, 1728], [0, 36, 1761], [1, 44, 1824], [0, 44, 1844], [1, 36, 1920], [0, 36, 1941], [1, 40, 2016], [0, 40, 2037], [1, 36, 2112], [0, 36, 2135], [1, 44, 2208], [0, 44, 2224], [1, 37, 2304], [0, 37, 2324], [1, 41, 2400], [0, 41, 2417], [1, 37, 2496], [0, 37, 2518], [1, 45, 2592], [0, 45, 2611], [1, 37, 2688], [0, 37, 2716], [1, 41, 2784], [0, 41, 2801], [1, 37, 2880], [0, 37, 2904], [1, 45, 2976], [0, 45, 2994], [1, 38, 3072], [0, 38, 3095], [1, 42, 3168], [0, 42, 3189], [1, 38, 3264], [0, 38, 3280],
@Andrew8xx8
Andrew8xx8 / gmf.sh
Last active December 13, 2017 16:31
Git merge fuckup
git init
touch correct.txt broken.txt
git add .
git commit -m "Init commit"
git checkout -b feature
echo 'I need to be here!' >> correct.txt
echo 'I need to be here!' >> broken.txt
git add .
git commit -m "Texts added"
git checkout master
@Andrew8xx8
Andrew8xx8 / 0EGATTP.md
Last active October 13, 2017 12:25
E.Letov — Everything goes according to plan for https://jackschaedler.github.io/jazzari/
@Andrew8xx8
Andrew8xx8 / README.md
Last active October 11, 2017 10:12
Разработка рельсового проета в докере

ПОДГОТОВКА

Билд контейнера:

docker-compose build

Создание базы:

docker-compose docker-compose run db:create db:migrate db:seed
can [:memberships, :members], Organization do |organization|
@user.has_role?(:resource_administrator, organization)
all_childrens = @user.admined_organizations.map do |user_admined_organization|
user_admined_organization.actable.get_descendent_memberships.where(member_type: Organization.types)
end
all_childrens.flatten.map do |membership|
membership.member == organization.actable
end.reduce(&:|)
@Andrew8xx8
Andrew8xx8 / quckstart.md
Last active October 4, 2016 21:14
Как начать писать на Rails

Нужна тачка с ubuntu. 16.04 или 14.04. Ставим зависимости

sudo apt-get update
sudo apt-get install git-core curl zlib1g-dev build-essential libssl-dev libreadline-dev libyaml-dev libsqlite3-dev sqlite3 libxml2-dev libxslt1-dev libcurl4-openssl-dev python-software-properties libffi-dev libgdbm-dev libncurses5-dev automake libtool bison libffi-dev

Далее ставим руби с помощью http://rvm.io/ Это такая приблуда для того чтобы руби ставить.