Skip to content

Instantly share code, notes, and snippets.

View Septdir's full-sized avatar

Igor Berdichevskiy Septdir

View GitHub Profile
@Septdir
Septdir / install_jyproextra.php
Created February 28, 2020 22:47
Install jYProExtra in insall script
<?php
defined('_JEXEC') or die;
use Joomla\CMS\Factory;
use Joomla\CMS\Installer\Installer;
use Joomla\CMS\Installer\InstallerAdapter;
use Joomla\CMS\Installer\InstallerHelper;
use Joomla\CMS\Language\Text;
use Joomla\CMS\Plugin\PluginHelper;
@Septdir
Septdir / joomla-ajax.js
Last active April 5, 2020 17:14
Ajax request for joomla
let request = new XMLHttpRequest(),
requestUrl = '', // Указываем url запроса
formData = new FormData(); // Перадаем <form> или просто добавляем ниже через append что нужно
request.open('POST', requestUrl);
request.send(formData);
request.onreadystatechange = function () {
if (this.readyState === 4 && this.status === 200) {
let response = false;
try {
@Septdir
Septdir / default.php
Created July 15, 2019 14:41
com_content artcle for yootheme pro
<?php
/**
* @package Septdir Workshop Package
* @version __DEPLOY_VERSION__
* @author Septdir Workshop - septdir.com
* @copyright Copyright (c) 2018 - 2019 Septdir Workshop. All rights reserved.
* @license GNU/GPL license: https://www.gnu.org/copyleft/gpl.html
* @link https://www.septdir.com/
*/
@Septdir
Septdir / demo.html
Created February 11, 2021 13:42
Ratio height for ellements
<div class="block-1" ratio-height="4:3">
Block 4:3 width 250<br/>
<em>ratio-height="4:3"</em>
</div>
<div class="block-2" ratio-height="16:9">
Block 16:9 width 500<br/>
<em>ratio-height="16:9"</em>
</div>
<div class="block-3" ratio-height="1:1">
Block 1:1 width 750<br/>
@Septdir
Septdir / demo.html
Last active February 11, 2021 14:22
Numbers only
<input type="text" numbers-only >
<script>
document.addEventListener('DOMContentLoaded', function () {
document.querySelectorAll('input[numbers-only]').forEach(function (input) {
input.addEventListener('input', function () {
input.value = input.value.replace(/[^.\d]+/g, '').replace(/^([^.]*\.)|\./g, '$1');
});
});
});
</script>
@Septdir
Septdir / uk-number.css
Created February 25, 2019 14:41
UIkit3 number
[input-number] input,
[input-number] input:focus,
[input-number] input:hover,
[input-number] input:active {
-webkit-appearance: textfield;
-moz-appearance: textfield;
appearance: textfield;
padding-right: 42px;
box-sizing: border-box;
}
@Septdir
Septdir / cluster.php
Last active December 1, 2022 04:31
Map cluster icon generator
<?php
header('Content-type: image/svg+xml');
$fill = (!empty($_GET['fill'])) ? '#' . str_replace('#', '', $_GET['fill']) : '#000000';
$size = (isset($_GET['size']) && (int) $_GET['size']) ? (int) $_GET['size'] : 120;
?>
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="-100 -100 200 200"
width="<?php echo $size; ?>" height="<?php echo $size; ?>">
<defs>
<g id="marker" transform="rotate(45)">
<path d="M0 47A47 47 0 0 0 47 0L62 0A62 62 0 0 1 0 62Z" fill-opacity="0.7"/>
@Septdir
Septdir / yoothemepro-chosen.less
Last active January 11, 2023 05:30
Less for YOOtheme Pro chosen
.hook-form-misc() {
@internal-form-search-image: "../../images/icons/search.svg";
.chzn-container {
font: inherit;
}
.chzn-container-single .chzn-single {
display: inline-block;
vertical-align: middle;
width: 100%;
@Septdir
Septdir / README-ru-RU.md
Last active October 18, 2023 04:41
Joomla Install Script

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

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

@Septdir
Septdir / joomla-fix-cli-uri.php
Created December 13, 2023 10:50
Methods to fix uri and links in Joomla CLI
<?php
use Joomla\CMS\Uri\Uri;
class JoomlaCLILinksFix
{
/**
* Is URI already ReInstance.
*
* @var bool