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 | |
return $query->whereJsonContains('fields', ['sub-field' => 'value']) |
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
mongorestore --gzip --db $DB_NAME --drop $PATH/ |
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 CE и docker-compose на систему, если у вас MacOS или Windows | |
вы можете скачать установщик с офф. сайта | |
https://www.docker.com/get-started | |
Если же у вас Linux проводим установку как указано здесь: | |
https://docs.docker.com/install/linux/docker-ce/ubuntu/#install-docker-ce | |
Далее устанавливаем docker-compose | |
https://www.digitalocean.com/community/tutorials/how-to-install-docker-compose-on-ubuntu-16-04 |
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
// Изменяем функцию сохранения контента в файл | |
public function onSave() | |
{ | |
if (!$this->checkEditor()) | |
return; | |
$fileName = post('file'); | |
// Format <p> delete | |
// Вторым параметро указываем те теги, которые разрешаем к допуску | |
$formattedContent = strip_tags(post("content"), '<a></a>'); |
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 | |
// Скрипт формирования уникального ключа формы | |
session_start(); | |
if($_SESSION["verify"]) | |
{ | |
unset($_SESSION["verify"]); | |
} | |
$_SESSION["verify"]=md5(uniqid(rand(),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
<?php | |
$id = $_GET['id']; | |
if ($res = $modx->getObject('modResource',intval($id))) { | |
if(intval($res->get('template')) == 2) | |
{ | |
$js =" | |
<script type='text/javascript'> | |
Ext.onReady(function () { | |
var tb = Ext.getCmp('modx-action-buttons'); | |
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
//p.obj_header_insert.before( t.param.htmltable.header_cell.replace( '<!--ph-->', p.data.h[ i ].c.replace( /xxx"/g, '"' ) ) ); | |
// input-v4.js |
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 $posts = get_posts([ | |
'post_type' => 'slider' | |
]); | |
foreach ($posts as $post) : | |
$imgObj = get_post_meta($post->ID, 'image', true); | |
$label = get_post_meta($post->ID, 'definition', true); | |
echo "<pre>"; | |
var_dump($imgObj, $label); | |
echo "</pre><br>"; |
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
Utils\Planb::pretty_print($arResult, false, false); |
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
font-variant-numeric: lining-nums | |
-moz-font-feature-settings: "lnum" | |
-webkit-font-feature-settings: "lnum" | |
font-feature-settings: "lnum" |