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
| var pxShow = 300; //height on which the button will show | |
| var fadeInTime = 400; //how slow/fast you want the button to show | |
| var fadeOutTime = 400; //how slow/fast you want the button to hide | |
| var scrollSpeed = 300; //how slow/fast you want the button to scroll to top. can be a value, 'slow', 'normal' or 'fast' | |
| // Show or hide the sticky footer button | |
| jQuery(window).scroll(function() { | |
| if (jQuery(window).scrollTop() >= pxShow) { | |
| jQuery("#go-top").fadeIn(fadeInTime); |
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
| //jquery | |
| let height = $('.block').innerHeight(); | |
| let height = $('.block').height(); | |
| //clientHeight высота содержимого вместе с полями padding, но без полосы прокрутки. | |
| let height = document.querySelector('.block').clientHeight; | |
| //offsetHeight «внешняя» высота блока, включая рамки. | |
| let height = document.querySelector('.block').offsetHeight; |
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://qna.habr.com/q/242409 | |
| <?= $form->field($model, 'ru')->widget(CKEditor::className(), [ | |
| 'kcfinder' => true, | |
| 'kcfOptions' => [ | |
| 'uploadURL' => '@web/upload', | |
| 'uploadDir' => '@webroot/upload', | |
| ], | |
| 'clientOptions' => [ |
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
| "minimum-stability": "stable", | |
| # если нужно меньше то | |
| "minimum-stability": "dev", | |
| "prefer-stable" : true, |
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
| #переходим в папку нашего сайта | |
| cd ~/test.com | |
| # увеличивает лимит памяти, не обязательно | |
| php -d memory_limit=-1 /usr/local/bin/composer | |
| #временное увеличение памяти | |
| Мои сайты - Настройка сайта - Настройка параметров PHP - Turbo Boost | |
| # устанавливает yii2 в папку www |
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
| <?php | |
| /* | |
| Создать файл debug.php в нутри папки config | |
| Подключить файл в файле config/web.php | |
| require_once(__DIR__.'/debug.php'); | |
| */ | |
| function debug($array = false, $exit = true) | |
| { |
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
| <?php | |
| use yii\helpers\Html; | |
| ?> | |
| <?php $this->beginPage() ?> | |
| <html> | |
| <head> | |
| <?//= Html::csrfMetaTags() ?> | |
| <? $this->head() ?> | |
| </head> | |
| <body> |
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
| const array = [10, 11, 3, 20, 5]; | |
| // Array.filter() method is used to find an element in an array under specific condition. | |
| const greaterThanTen = array.filter(element => element > 10); | |
| console.log(greaterThanTen) //[11, 20] | |
| // Syntax | |
| let newArray = array.filter(callback); | |
| // Array.find() method is used to find the first element in an array under specific condition. |
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
| $(document).ready(function() { | |
| $('#studied').click(function() { | |
| let selectedCheckBoxes = $('input[name="state"]:checked'); | |
| if (selectedCheckBoxes.length == 0) return alert('Не выделены слова'); | |
| let checkedValues = Array.from(selectedCheckBoxes).map(item => item.value); | |
| location.href = '/word/studied?ids=' + checkedValues.join(); |
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
| document.querySelector('.products').addEventListener('change', function(e) { | |
| let $product = e.target.closest('.product'); | |
| console.log($product); | |
| }); | |
| document.querySelector('.products').addEventListener('change', (e) => let product = e.target.closest('.product')); | |
NewerOlder