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
# бекап из всех таблиц максимум по 100 записей | |
mysqldump mydatabase --where="true limit 100" | gzip > mydatabase.sql.gz |
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
<div class="col-md-6 move-right"> | |
<input type="button" class="btn btn-primary publish" name="publish" value="[[%ticket_publish]]" title="" /> | |
<div class="spinner-border" style="display:none; float: left; width: 2rem; height: 2rem;"></div> | |
<style> | |
.form-actions .btn:disabled + .spinner-border {display:block!important} | |
</style> | |
<input type="submit" class="btn btn-danger draft" name="draft" value="[[%ticket_draft]]" title="Ctrl + Shift + Enter" /> | |
</div> |
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
sed -n 's/CREATE TABLE IF NOT EXISTS //p' sqldump.sql |
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 | |
$date = $modx->getOption("date_endless_action"); | |
if ($date) { | |
$dt = strtotime($date); | |
$now = time(); | |
if ($now + 172840 >= $dt) { | |
$new = date(DATE_ISO8601, $dt + 259200); | |
$modx->setOption("date_endless_action",$new); | |
$response = $modx->runProcessor('system/settings/update', array( | |
'key' => 'date_endless_action', |
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 | |
$resources = $modx->getCollection('modResource'); | |
foreach ($resources as $find_order) { | |
$cacheKey = $find_order->getCacheKey(); | |
$modx->cacheManager->refresh(array( | |
'resource' => array('key' => $cacheKey), | |
)); | |
} | |
$modx->cacheManager->refresh(); |
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
/*_____________________ VeryLazy ______________________*/ | |
// - Подгрузка изображений в блоках при их показе на экране | |
block_selector = '.home ._block'; // Селектор блоков | |
function VeryLazy(){ | |
if ($('html').hasClass('webp')) { | |
$(document).find(block_selector).each(function(index, element){ | |
if ($(document).scrollTop() > $(this).offset().top - $(window).height()){ | |
$(this).addClass('active').find('img[data-src],img[data-webp]').each(function() { | |
if ($(this).data().webp) |
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 | |
switch ($modx->event->name) { | |
case 'OnHandleRequest': | |
$q = trim(@$_REQUEST[$modx->context->getOption('request_param_alias', 'q')]); | |
$matches = explode('/', rtrim($q, '/')); | |
if (count($matches) < 2 && $matches[0] != 'item') { | |
return; | |
} | |
$board_uri = array_pop($matches); | |
$board_uri = preg_split('/-/', $board_uri, 2); |