Skip to content

Instantly share code, notes, and snippets.

View Ibochkarev's full-sized avatar
🏠
Working from home

Bochkarev Ivan Ibochkarev

🏠
Working from home
View GitHub Profile
@Ibochkarev
Ibochkarev / migx.md
Created October 12, 2020 12:11
MIGX в MIGX
{set $items = $_modx->resource.tariff_list_service | fromJSON}
{foreach $items as $idx => $item}
    <div class="tariff-plan-item">
        <div class="tariff-plan-item__c {if $item.black_color == 1}color-black{/if}" style="background-color: {$item.hex_color};">
            <div class="tariff-plan-item__body">
                <div class="tariff-plan-item__img">
                    <img src="{$item.image}">
                </div>
@Ibochkarev
Ibochkarev / makeContentsSide.md
Last active October 15, 2020 18:02
Формирование содержания у ресурса по заголовкам H1-H6

Формирование содержания у ресурса по заголовкам H1-H6

Сниппет makeContentsSide

<?php
if (!preg_match_all('#<h(\d)[^>]*?>(.*?)<[^>]*?/h\d>#i', $input, $headers)) {
    return ['content' => $input, 'links' => null];
}
@Ibochkarev
Ibochkarev / seo.md
Created October 10, 2020 10:32
Список ресурсов для подготовки SEO

Сниппет ExportCVS

<?php
header('Content-Encoding: UTF-8');
header('Content-type: text/csv; charset=UTF-8');
header('Content-Disposition: attachment; filename=SEO.csv');
echo "\xEF\xBB\xBF"; // UTF-8 BOM

Шаблон

[2020-09-25 12:44:00] (ERROR @ /home/a/abubakirov/abakus-center.ru/public_html/core/cache/includes/elements/modsnippet/52.include.cache.php : 17) Array
(
    [name] => Vasya Pupkin
    [comment] => 
    [email] => 
    [locationInfoId] => 139
    [phone] => +7999979
    [fromSite] => abakus-center.ru/branches/k922a
)
@Ibochkarev
Ibochkarev / migx.md
Created September 24, 2020 08:56
Fenom migx
<div class="tariff-plan tariff-plan-slider-3">
    {set $items = $_modx->resource.tariff_list_service | fromJSON}
    {foreach $items as $idx => $item}
        <div class="tariff-plan-item">
            <div class="tariff-plan-item__c {if $item.black_color == 1}color-black{/if}" style="background-color: {$item.hex_color};">
                <div class="tariff-plan-item__body">
                    <div class="tariff-plan-item__img">
                        <img src="{$item.image}">
                    </div>
@Ibochkarev
Ibochkarev / characters.md
Created September 23, 2020 17:48
Подсчет времени на чтение поста

Подсчет времени на чтение поста

Сниппет strlen

<?php
return strlen(str_replace(' ', '', strip_tags($input)));
{
  "workbench.colorTheme": "GitHub Sharp Dark",
  "git.autofetch": true,
  "workbench.iconTheme": "material-icon-theme",
  "emmet.triggerExpansionOnTab": true,
  "editor.formatOnSave": true,
  "editor.renderIndentGuides": true,
  "git.confirmSync": false,
  "explorer.confirmDelete": false,
@Ibochkarev
Ibochkarev / intlTelInput.md
Last active November 9, 2023 18:22
Inputmask + intlTelInput
@Ibochkarev
Ibochkarev / online_raschet.md
Last active April 18, 2020 22:56
Расчет кухни онлайн

** AjaxForm / Formit**

[[!AjaxForm?
  &snippet=`FormIt`
  &form=`tpl.AjaxForm.raschet`
  &hooks=`email`
  &emailTpl=`_email`
  &emailSubject=`Новый онлайн расчет кухни`
  &emailTo=`info@gmail.com`
  &_validate=`name:required,email:required,message:required`
<div class="row">
  <div class="col-12">
    <ul class="nav nav-tabs" id="myTab" role="tablist">
      {foreach $_modx->resource.tabs | fromJSON as $item}
      <li class="nav-item">
        <a class="nav-link {if $steps@index == 0}active{/if}" id="{$steps@index}-tab" data-toggle="tab" href="#tab-{$steps@index}" role="tab" aria-controls="{$steps@index}" aria-selected="{if $steps@index == 0}true{else}false{/if}">{$item.tab_name}</a>
      </li>
      {/foreach}
    </ul>