This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// директивы | |
v-if="expression" | |
v-else-if="expression" | |
v-else="expression" | |
v-show="expression" - если обновление выражения очень частое (более быстрый аналог v-if). не удаляет DOM элемент, а просто меняет css display | |
v-for="item in dataitems" (желательно добавлять спец аттрибут :key="item.id" и иметь этот id в данных | |
либо использовать вариант v-for="(item, index) in dataitems" :key="index"), dataitems может быть целым числом | |
v-bind:attribute='dataitem' (или сокрашенно :attribute='dataitem') - связать атрибут html-тега и данные dataitem | |
v-bind:class="объект" или v-bind:class="{ имя_класса: логическое выражение[, 'имя_класса2': логическое выражение2]}" - установка класса с помощью объекта | |
вместо объекта можно указывать функцию, возвращающую объект |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# css | |
1. использовать em (и другие относительные единицы) везде, где возможно | |
2. стараться использовать классы , но не идентификаторы для стилизации | |
3. для размещения и позиционирования элементов в строку использовать flexbox | |
4. для элементов, реагирующих на действия пользователей, использовать псевдоэлементы | |
5. высота блочных элементов зависит ТОЛЬКО от контента | |
6. идентификаторы используются для форм, в js и в качестве ссылок на место в документе | |
7. желательно использовать normalize.css или подобные библиотеки для очистки и нормализации стилей браузера | |
#БЭМ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports = сущность- глобальный объект для экспортирования сущностей | |
require('файл') - подключение экспортируемых сущностей из файла | |
>npm install -D package - установка пакета в список зависимостей ТОЛЬКО для разработки (не продакшен) | |
>npm run command - запуск команды command из раздела scripts файла package.json |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## docker and virtualbox on the same Windows 10 host | |
As outlined here, Docker for Windows requires Hyper-V. This needs to be disabled before you can run VirtualBox. | |
# Run from elevated prompt (admin privileges) | |
bcdedit /set hypervisorlaunchtype off | |
And to start using Docker for Windows again, re-enable Hyper-V: | |
# Run from elevated prompt (admin privileges) | |
bcdedit /set hypervisorlaunchtype auto |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#версия системы | |
lsb_release -a | |
cat /etc/os-release | |
hostnamectl | |
#создать ссылку для приложения на рабочем столе | |
gnome-desktop-item-edit ~/Desktop/ --create-new | |
#пофиксить проблему с монтированием флешки | |
sudo ntfsfix /dev/partitionName |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# вызвать событие focus на элементе с заданным идентификатором id | |
function focusOnElementWithId('id') { | |
var event = new Event('focus'); | |
document.getElementById(id).dispatchEvent(event); | |
} | |
# елемент удаляет самого себя | |
var element = document.getElementById('foo') | |
element.parentNode.removeChild(element); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## https://dev.to/nishina555/how-to-ignore-files-already-managed-with-git-locally-19oo | |
## как игнорировать изменения уже отслеживаемого файла/папки | |
# если нужно менять локально и не отправлять затем в основную ветку | |
git update-index --skip-worktree путь/к/файлу/файл | |
# обратная операция | |
git update-index --no-skip-worktree путь/к/файлу/файл | |
# если не нужно менять локальные файлы (при подтягивании изменений из основной ветки) | |
git update-index --assume-unchanged путь/к/файлу/файл | |
# обратная операция | |
git update-index --no-assume-unchanged путь/к/файлу/файл |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## get vscode installed extensions list | |
code --list-extensions | % { "code --install-extension $_" } | |
## vscode extension list | |
code --install-extension alefragnani.Bookmarks | |
code --install-extension bmewburn.vscode-intelephense-client | |
code --install-extension CoenraadS.bracket-pair-colorizer | |
code --install-extension dbaeumer.vscode-eslint | |
code --install-extension donjayamanne.githistory | |
code --install-extension DotJoshJohnson.xml |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//подробный форматированный вывод переменных | |
$name_of_var = var_value; | |
var_dump($name_of_var); | |
//установить runtime настройку на время выполнения скрипта | |
ini_set | |
//настройка xdebug для vscode при использовании OpenServer | |
1) редактируем/раскомментируем в C:\OSPanel\userdata\config\PHP_7.1-x64_php.ini следующие строки: | |
zend_extension = php_xdebug.dll |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# httpd-vhosts.conf for Apache 2.2 | |
<VirtualHost *:80> | |
ServerAdmin [email protected] | |
DocumentRoot "/xampp-1.77/htdocs/" | |
Alias "/site" "I:/localhost/site_folder" | |
<Directory "I:/localhost/site_folder" > | |
Order allow,deny | |
Allow from all | |
</Directory> | |
ServerName localhost |
NewerOlder