Skip to content

Instantly share code, notes, and snippets.

View AlexanderKomkov's full-sized avatar

Alexander Komkov AlexanderKomkov

View GitHub Profile
FROM php:7.2-fpm-alpine
# add our user and group first to make sure their IDs get assigned consistently, regardless of whatever dependencies get added
#RUN addgroup -S alpine && adduser -S -G alpine alpine
#ARG uid=1000
#ARG gid=1000
#RUN addgroup -g $gid -S alpine
#RUN adduser -u $uid -S alpine -G alpine
export interface Selector {
paramId: string
multiple: boolean
value: string | string[]
prevValue: string | string[]
}
{
"params": [
{
"id": "01h260rxh1wkp9jm5jx696r1mv",
"title": "Грузоподьемность борта",
"name": "gruzopodemnost_borta",
"type": "radio",
"multiple": false,
"required": true,
"main": true,
@AlexanderKomkov
AlexanderKomkov / sect_sort.php
Last active June 9, 2023 14:09
Задачка сортировка массива
<?php
function sect_sort($array, $start, $length = null)
{
$ar_start = [];
$ar_sort = [];
$ar_end = [];
$sort_index = 0;
<?php
namespace App\Repositories\Manager\Content\Resource\Resources\Settings;
use App\Repositories\Manager\Content\Resource\Resources\Resource;
use App\Repositories\Manager\Manager;
use App\Repositories\Manager\Content\Resource\Libs\Form\Tabs\Tab;
@AlexanderKomkov
AlexanderKomkov / Reader.php
Last active November 29, 2020 11:36
Читатель больших Excel XLSX файлов на PHP
<?php
namespace App\Repositories\Xlsx;
class Reader
{
/** @var integer memory_get_usage() **/
protected $start_memory = 0;
/** @var integer memory_get_usage() **/
@AlexanderKomkov
AlexanderKomkov / Torg12PDF.php
Last active January 16, 2020 15:33
Формирование ТОРГ-12 на PHP FPDF
<?php
/*
* FPDF - http://www.fpdf.org/
* EasyTable - https://github.com/fpdf-easytable/fpdf-easytable
*/
namespace App\Repositories\Fpdf;
use App\Repositories\Fpdf\exFPDF;
@AlexanderKomkov
AlexanderKomkov / myCustomFilter.php
Last active April 12, 2017 08:49
myCustomFilter
<?php
class myCustomFilter extends mse2FiltersHandler {
/**
* Retrieves values from Resource table
*
* @param array $fields Name of resource fields.
* @param array $ids Ids of needed resources
*
* @return array Array with resource fields as keys and resources ids as values
@AlexanderKomkov
AlexanderKomkov / index.html
Created April 21, 2015 08:27
Стилизация input с типом Number
<!DOCTYPE HTML>
<html lang="ru">
<head>
<title>Тест</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<style>
a {
text-decoration: none;
}
@AlexanderKomkov
AlexanderKomkov / getListFromJson.php
Last active April 10, 2020 00:50
Modx Revolution, сниппет вывода JSON через $pdoTools->getChunk(). Условие можно сделать только 1. Оператор ==.
<?php
$time = microtime(true);
$json = $modx->getOption('json', $scriptProperties, '');
$json = !empty($json) ? $modx->fromJSON($json) : array();
$log = $modx->getOption('showLog', $scriptProperties, '');
$tpl = $modx->getOption('tpl', $scriptProperties, '');
$where = $modx->getOption('where', $scriptProperties, '');
$where = !empty($where) ? $modx->fromJSON($where) : array();