View main.js
This file contains 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
$('form').on('beforeSubmit', function(event) { | |
let $form = $(this), | |
data = $form.data('yiiActiveForm'); | |
if ($form.data('yiiSubmitFinalizePromise') && data.validated) { | |
data.validated = false; | |
return true; | |
} | |
return false; | |
}); |
View another-view.php
This file contains 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
->widget(DatePicker::class, [ | |
// 'pluginOptions' => [ | |
// 'autoclose' => true, | |
// 'format' => 'dd.mm.yyyy', | |
// 'todayHighlight' => true, | |
// ], | |
'removeButton' => false, | |
]); |
View gist:c9521e91a3439d6e8a5dd21592a47c64
This file contains 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
sudo groupadd -r -g 82 alpine-www-data | |
groups | |
sudo usermod -a -G alpine-www-data $(id -un) | |
# exit and re-login | |
groups | |
dev sudo alpine-www-data docker | |
#apply to folders | |
sudo chown -R :dev alpine-www-data folder | |
sudo chmod -R g+w folder |
View docker_desc.sh
This file contains 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
#!/bin/bash | |
parent_short_id=$1 | |
parent_id=`docker inspect --format '{{.Id}}' $1` | |
get_kids() { | |
local parent_id=$1 | |
docker inspect --format='ID {{.Id}} PAR {{.Parent}}' $(docker images -a -q) | grep "PAR ${parent_id}" | sed -E "s/ID ([^ ]*) PAR ([^ ]*)/\1/g" | |
} | |
print_kids() { |
View myform.js
This file contains 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
$('.feedback-form__form').on('submit', (function (e) { | |
// first time call before first call yii.activeForm submitForm | |
// set $.Deferred() in submitForm () | |
// second time call before second call yii.activeForm submitForm | |
// note: fire submit again after ajax | |
// don't call form twice - js validate already is true | |
console.log('feedback-form__form submit'); | |
let $form = $(this), | |
submitButton = $('input[type="submit"]', $form), |
View nginx.conf
This file contains 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
# кеширование изображений из версионированных папок | |
location ~ ^/assets/.*\.(png|jpg|gif|svg)$ { | |
expires max; | |
try_files $uri =404; | |
} | |
# раскомментируйте строки ниже во избежание обработки Yii обращений к несуществующим статическим файлам | |
location ~ \.(png|jpg|gif|swf|ico|pdf|mov|fla|zip|rar)$ { | |
try_files $uri =404; | |
} |
View gist:88416dd46555d08fe57463624b613c56
This file contains 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 | |
namespace console\controllers; | |
use Yii; | |
use yii\console\Controller; | |
use yii\console\ExitCode; | |
use yii\console\widgets\Table; | |
class RedirectController extends Controller |