Skip to content

Instantly share code, notes, and snippets.

View delphinpro's full-sized avatar

Сергей delphinpro

View GitHub Profile

Semantic Commit Messages

See how a minor change to your commit message style can make you a better programmer.

Format: <type>(<scope>): <subject>

<scope> is optional

Example

@function str-split($string, $separator: " ") {
$i: str-index($string, $separator);
@if $i != null {
@return append(
str-slice($string, 1, $i - 1),
str-split(str-slice($string, $i + str-length($separator)), $separator)
);
}
@return $string
}
@delphinpro
delphinpro / BackupCommand.php
Created December 24, 2019 20:52
Backup & Restore content data in EvolutionCMS 2.x
<?php
/**
* @author delphinpro <[email protected]>
* @copyright copyright © 2019 delphinpro
* @license licensed under the MIT license
*
* File: core/custom/packages/custom/src/Console/BackupCommand.php
*/
@delphinpro
delphinpro / PageBuilderInheritable.php
Last active January 14, 2020 02:52
Наследование блоков PageBuilder (EvolutionCMS 2.x)
<?php
/**
* PageBuilderInheritable
*
* @author delphinpro <[email protected]>
* @copyright copyright © 2019 delphinpro
* @license licensed under the MIT license
*/
@delphinpro
delphinpro / dl-evo-installer.php
Created November 17, 2019 08:20
Загрузчик инсталлятора Evo2.0
<?php
$InstallData = EvoInstaller::getPackageInfo();
EvoInstaller::doInstall('2.0');
class EvoInstaller{
static public function downloadFile ($url, $path) {
$newfname = $path;
$rs = file_get_contents($url);
if($rs) $rs = file_put_contents($newfname,$rs);
return $rs;
@delphinpro
delphinpro / includeStylesheet.php
Created November 5, 2019 14:52
Антикэш стилей для Modx
<?php
/*
Usage:
[[includeStylesheet? &file=`/path/to/style.css` ]]
*/
if (!isset($file)) {
return '';
}
$filePath = MODX_BASE_PATH.$file;
@delphinpro
delphinpro / accordion.html
Created May 10, 2019 08:51
Accordion jQuery plugin
<div class="accordion accordion_open">
<div class="accordion__header">
<div class="accordion__title">Заголовок</div>
<button class="accordion__toggle" type="button"><span class="sr-only">Открыть</span></button>
</div>
<div class="accordion__body">
<div class="accordion__content">
<p>Сайт рыбатекст поможет дизайнеру, верстальщику, вебмастеру сгенерировать
несколько абзацев более менее осмысленного текста рыбы на русском языке,
а начинающему оратору отточить навык публичных выступлений в домашних условиях.
@delphinpro
delphinpro / blend-color.html
Created January 7, 2019 14:28
Наложение цвета в CSS
<div class="block">
<img class="img" src="image.png" alt="">
</div>
@delphinpro
delphinpro / gulp.config.js
Created January 4, 2019 12:04
Заготовка для сборки растровых спрайтов
config.sprite.bitmap = {
srcPath : 'source/sprites/bitmap',
srcFiles : '*.{jpg,jpeg,png,gif}',
src2x : 'source/sprites/bitmap/services/*@2x.png',
destImage: path.join(root.build, root.staticDir, 'images'),
destStyle: 'source/sass/',
};
@delphinpro
delphinpro / jquery.uploadbox.html
Last active May 10, 2019 08:56
Поле прикрепления файла
<div class="upload-file">
<label class="upload-file__button">
<input class="upload-file__element" type="file" name="">
<span class="upload-file__icon">{{ svgIcon('plus') }}</span>
<span class="upload-file__button-text">Добавить файл</span>
</label>
<div class="upload-file__file">
<div class="upload-file__filename"></div>
<div class="upload-file__clear">&times;</div>
</div>