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
| // Show rendered HTML | |
| const wrapper = shallow(<App />) | |
| console.log(wrapper.debug()) | |
| // Disable lifecycle methods of react within tests | |
| const wrapper = mount(<App />, { disableLifecycleMethods: true }) | |
| // Assert number of occurrences | |
| expect(wrapper.find('p').length).toBe(1) |
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
| npm i $name | |
| установить модуль локально | |
| npm i $name -g | |
| установить модуль глобально | |
| npm ls | |
| список модулей, установленных локально | |
| npm ls -g |
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
| { | |
| "formtabs":[ | |
| { | |
| "MIGX_id":9, | |
| "caption":"", | |
| "print_before_tabs":"0", | |
| "fields":[ | |
| { | |
| "MIGX_id":26, | |
| "field":"image", |
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
| Tabs: [ { | |
| "caption": "Заголовок", | |
| "fields": [ { | |
| "field": "title", | |
| "caption": "Заголовок" | |
| }, | |
| { | |
| "field": "description", | |
| "caption": "Описание", | |
| "inputTVtype": "textarea" |
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
| //0 0 - Начало координат для левого верхнего угла | |
| //#name-id - Идентификатор части спрайта которую нужно показать и переименованный ранее в Inkscape для удобства | |
| //Плюсы: Кешируется, не засоряет html код, а также можно влиять на спрайт с помощью css | |
| //Недостатки: Скорее всего потребуется некий механизм (макрос, хелпер, функция), который будет генерировать код вставки иконки | |
| <svg viewBox="0 0 70 50" width="70" height="50"> | |
| <use xlink:href="img/sprite.svg#name-id"></use> | |
| </svg> | |
| P.S. При defs атрибут viewBox обязателен, при symbol нет |
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 | |
| /* Option */ | |
| .option { | |
| display: block; | |
| margin-bottom: 0.5em; | |
| } | |
| .check { |
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
| // Timer js | |
| Timer: function(){ | |
| function makeTimer() { | |
| var endTime = new Date("december 30, 2020 12:00:00 PDT"); | |
| var endTime = (Date.parse(endTime)) / 1000; | |
| var now = new Date(); | |
| var now = (Date.parse(now) / 1000); |
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
| //HTML | |
| <a href="#" class="toggle-mnu hidden-lg"><span></span></a> | |
| //SASS | |
| .toggle-mnu | |
| display: block | |
| width: 28px | |
| height: 28px | |
| margin-top: 14px |
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
| ************** Базовые команды GIT | |
| git init | |
| git log --pretty=oneline - посмотреть все коммиты. | |
| git log --oneline --graph - Сокращение для одновременного использования опций --pretty=oneline --abbrev-commit. | |
| git status - Текущее состояние репозитория (изменения, неразрешенные конфликты и тп) | |
| git log --reverse --pretty=%H master | grep -A 1 $(git rev-parse HEAD) | tail -n1 | xargs git checkout - переключить на след. коммит | |
| git checkout HEAD^ - переключить на пред. коммит | |
| ---------------------- | |
| git add text.txt - Добавить файл в репозиторий | |
| git add . - Добавить все файлы в репозиторий |
NewerOlder