Skip to content

Instantly share code, notes, and snippets.

@Ch0k
Ch0k / select_tag rails
Created September 15, 2022 12:40 — forked from sameera207/select_tag rails
Using selected option in rails select_tag
year array -> ['2012','2011','2010','2009']
selected year -> 2010
<%= select_tag 'year_range', options_for_select(['2012','2011','2010','2009'],'2010') %>
which will always selects '2010'
If you are selecting an object
@Ch0k
Ch0k / rubocop_pre_commit_hook
Created June 3, 2022 12:11 — forked from palkan/rubocop_pre_commit_hook
Rubocop pre-commit hook
#!/usr/bin/env ruby
ADDED_OR_MODIFIED = /^\s*(A|AM|M)/.freeze
changed_files = `git status --porcelain`.split(/\n/)
unstaged_files = `git ls-files -m`.split(/\n/)
changed_files = changed_files.select { |f| f =~ ADDED_OR_MODIFIED }
changed_files = changed_files.map { |f| f.split(" ")[1] }
@Ch0k
Ch0k / TestGuruQuestion.txt
Created September 21, 2021 10:49
html from TestGuru
Что такое тег body
Элемент <body> предназначен для хранения содержания веб-страницы (контента), отображаемого в окне браузера.
Тег <body> предназначен для хранения других элементов, цель которых — помочь браузеру в работе с данными. Также внутри контейнера <head> находятся метатеги, которые используются для хранения информации предназначенной для браузеров и поисковых систем.
@Ch0k
Ch0k / TestGuruQuestion.txt
Created September 21, 2021 10:39
22 from TestGuru
1
@Ch0k
Ch0k / TestGuruQuestion.txt
Created September 21, 2021 10:31
ansible from TestGuru
файлы какого типа использует ansible
yml
conf
@Ch0k
Ch0k / TestGuruQuestion.txt
Created September 21, 2021 10:02
ansible from TestGuru
нужен ли агент на хосте для ansible
da
no
@Ch0k
Ch0k / TestGuruQuestion.txt
Created September 9, 2021 21:03
js from TestGuru
mm
@Ch0k
Ch0k / TestGuruQuestion.txt
Created September 9, 2021 21:02
js from TestGuru
mm
@Ch0k
Ch0k / TestGuruQuestion.txt
Created September 9, 2021 21:01
js from TestGuru
mm
@Ch0k
Ch0k / TestGuruQuestion.txt
Created September 9, 2021 20:58
js from TestGuru
mm