Skip to content

Instantly share code, notes, and snippets.

@vterdunov
vterdunov / production.rb
Last active September 3, 2015 20:37
set rails log level
config.logger = Logger.new(STDOUT)
config.log_level = :info
config.logger.level = 1 # { 0: :debug, 1: :info, 2: :warn, 3: :error, 4: :fatal }
config.lograge.enabled = true
config.lograge.custom_options = lambda do |event|
params = event.payload[:params].reject do |k|
['controller', 'action'].include? k
end
@vterdunov
vterdunov / step.sh
Last active September 24, 2015 14:27
init rbenv for Jenkins
export PATH=$HOME/.rbenv/bin:$HOME/.rbenv/shims:$PATH
eval "$(rbenv init -)"
@vterdunov
vterdunov / gist:7301a23b9035317060f5
Created October 14, 2015 21:40
git flow settings for sublime text
{
"git_executables": {
"git": ["/usr/bin/git"],
"git_flow": ["/usr/bin/git", "flow"],
"legit": ["legit"]
}
}
@vterdunov
vterdunov / gist:3f880debaef35a18c895
Created October 22, 2015 17:36
Проблема schema.rb
1. feature_1 - сделали изменения в базе (добавили миграцию, прогнали ее). Изменился schema.rb
2. Переключились в другую ветку, для работы над feature_2. Сделали изменения в базе (добавили миграцию, прогнали ее). И вот тут в schema.rb подтянулись изменения из feature_1.
Это самый распространенный кейс.
zzet [5:46 PM]
Лечится организационным моментом. Если такое происходит: `RAILS_ENV=test rake db:drop db:create db:schema:load db:migrate`
@vterdunov
vterdunov / playbook.yml
Last active March 1, 2016 16:13
вариант запускать сервисы от колличества ядер без генерации хэша
- hosts: localhost
vars:
myhashes:
service_name: service
port: 8085
env: production
tasks:
- name: test
debug: msg="service {{ myhashes['service_name']+item }} port {{ myhashes['port']+item | int }}"
with_sequence: count={{ ansible_processor_vcpus }}
@vterdunov
vterdunov / rubocop.yml
Last active April 3, 2016 08:47
By default, the linter plugin looks for a config file called .rubocop.yml in the current directory and its parents. To override the config file path, you would add this to the linter settings:
---
Rails:
Enabled: true
Style/AsciiComments:
Enabled: false
Metrics/LineLength:
Max: 120
@vterdunov
vterdunov / sublime-settings.yml
Last active March 14, 2016 14:39
sublime-settings
{
"default_encoding": "UTF-8",
"default_line_ending": "unix",
"ensure_newline_at_eof_on_save": true,
"tab_size": 2,
"translate_tabs_to_spaces": true,
"trim_trailing_white_space_on_save": true,
"highlight_modified_tabs": true,
"color_scheme": "Packages/User/SublimeLinter/Monokai (SL).tmTheme",

Keybase proof

I hereby claim:

  • I am vterdunov on github.
  • I am vterdunov (https://keybase.io/vterdunov) on keybase.
  • I have a public key whose fingerprint is 0879 17BB A52C BE03 EF1F 7E01 34D3 9B6B 00A1 F72C

To claim this, I am signing this object:

@vterdunov
vterdunov / bashrc
Last active June 16, 2020 10:43
Gets tracking branch name
get_branch_tr_name() {
local br_name
br_name=$(git rev-parse --abbrev-ref --symbolic-full-name @{u} 2>/dev/null)
if [[ -n $br_name ]]; then
echo "[$(__git_ps1 "%s")->${br_name}]"
else
__git_ps1 ["%s"]
fi
}
FROM rabbitmq:3.6
ENV RABBITMQ_USER user
ENV RABBITMQ_PASSWORD password
ARG PLUGIN_ADDRESS_AUTH_BACKEND_HTTP=https://bintray.com/rabbitmq/community-plugins/download_file?file_path=rabbitmq_auth_backend_http-3.6.x-1b27d722.ez
ARG PLUGIN_ADDRESS_MANAGEMENT_VISUALIZATOR=https://bintray.com/rabbitmq/community-plugins/download_file?file_path=rabbitmq_auth_backend_http-3.6.x-1b27d722.ez
# RUN curl -i -u guest:guest -H "content-type:application/json" \
# -XPUT -d'{"type":"direct","durable":true}' \