Skip to content

Instantly share code, notes, and snippets.

View cave2006's full-sized avatar

Sergey Cave Lebedev cave2006

View GitHub Profile
@cave2006
cave2006 / README-ru-RU.md
Created October 18, 2023 04:41 — forked from Septdir/README-ru-RU.md
Joomla Install Script

Установочный скрипт для Joomla

Пример установочного скрипта для Joomla

@cave2006
cave2006 / custom-joomla-custom-field.md
Created March 11, 2023 03:26 — forked from betweenbrain/custom-joomla-custom-field.md
Developing a custom Joomla custom field plugin

Anatomy of a custom form field

fields
  |
  -- fieldName.php
language
  |
  -- en-GB
    |
 -- en-GB.plg_fields_fieldName.ini
@cave2006
cave2006 / view-module-teml-joomla.php
Created May 16, 2022 00:55 — forked from zaurmag/view-module-teml-joomla.php
Вывод модулей в шаблоне Joomla
<?php //вывод позиции модулей
$document = JFactory::getDocument();
$renderer = $document->loadRenderer('modules');
$options = array('style' => 'xhtml');
$position = 'user1';
echo $renderer->render($position, $options, null);
?>
<!-- или -->
@cave2006
cave2006 / parse_utm.js
Created April 18, 2022 05:21 — forked from hunty/parse_utm.js
Парсит UTM метки и подставляет в скрытые поля
window.onload = function() {
// Parse the URL
function getParameterByName(name) {
var name = name.replace(/[\[]/, "\\[").replace(/[\]]/, "\\]");
var regex = new RegExp("[\\?&]" + name + "=([^&#]*)");
var results = regex.exec(location.search);
return results === null ? "" : decodeURIComponent(results[1].replace(/\+/g, " "));
}
// Give the URL parameters variable names
var source = getParameterByName('utm_source');
Добавить в начале строки Найти ^ Заменить 0;
^\W пробел в начале строки
\d{8} найти 8 цыфр подряд
^\d{4};92 найти В НАЧАЛЕ ЧЕТЫРЕХзначные числа после которы есть ;92
[^=]*$ любые символы, кроме "="
;(.*) все после ;
(\b\S+\b)(?=.*\1) повторение на строке
^$\n - удалить пустые строки
\d [0-9] Цифровой символ