Skip to content

Instantly share code, notes, and snippets.

#!/bin/bash
# # For flat structure (all files in one directory):
# ./convert_to_jxl.sh /path/to/source/folder /path/to/destination flat
# # For maintaining directory structure:
# ./convert_to_jxl.sh /path/to/source/folder /path/to/destination structured
# Check if correct number of arguments provided
if [ "$#" -ne 3 ]; then
@GDXbsv
GDXbsv / gitlag_api.php
Last active October 11, 2023 09:24
Gitlab graphql api example
<?php
// GitLab API URL
$api_url = 'https://gitlab.com/api/graphql';
// Your GitLab personal access token
$access_token = 'glpat-qsdfsdfsdfsdf';
// Your GitLab group's full path
$group_path = 'gotphoto';
@GDXbsv
GDXbsv / README.md
Created July 22, 2023 13:48 — forked from fesor/README.md
Symfony without ORM

Удобный менеджмент миграций с Symfony и Doctrine

Мало кто знает, но что бы работал migration:diff вам не нужно ставить ORM.

Что бы это работало объявим простой сервис:

<?php
@GDXbsv
GDXbsv / Dockerfile
Created March 15, 2023 09:22 — forked from hermanbanken/Dockerfile
Compiling NGINX module as dynamic module for use in docker
FROM nginx:alpine AS builder
# nginx:alpine contains NGINX_VERSION environment variable, like so:
# ENV NGINX_VERSION 1.15.0
# Our NCHAN version
ENV NCHAN_VERSION 1.1.15
# Download sources
RUN wget "http://nginx.org/download/nginx-${NGINX_VERSION}.tar.gz" -O nginx.tar.gz && \
<?php
function file_get_contents(string $pathname): string
{
$result = '';
$fp = fopen($pathname, 'rb');
while (!feof($fp)) {
$chunk = 1024;
Fiber::getCurrent() && ($chunk = (Fiber::suspend() ?: 1024));
@GDXbsv
GDXbsv / table_gateway.php
Created November 30, 2021 10:34
Table Gateway DBAL PHP
<?php
declare(strict_types=1);
namespace App\Notification;
use Doctrine\DBAL\Connection;
use Doctrine\DBAL\Platforms\AbstractPlatform;
use Doctrine\DBAL\Types\Type;
use JetBrains\PhpStorm\Immutable;
@GDXbsv
GDXbsv / locking.php
Last active March 9, 2021 22:28
Locking
<?php declare(strict_types=1);
final class DoctrineSagaPersistence implements SagaPersistence
{
private ManagerRegistry $mr;
private SagaFinding $sagaFinding;
public function __construct(ManagerRegistry $mr, SagaFinding $sagaFinding)
{
$this->mr = $mr;
$this->sagaFinding = $sagaFinding;
<?php declare(strict_types=1);
use Doctrine\Common\EventManager;
use Doctrine\DBAL\Configuration;
use Doctrine\DBAL\Connection;
use Doctrine\DBAL\Driver;
class ReconnectConnection extends Connection
{
/** @var int */
@GDXbsv
GDXbsv / README.md
Created April 4, 2019 13:55 — forked from fesor/README.md
Project Structure

Структура проекта

Нагло своровано у angular styleguide и адаптировано под Symfony

LIFT

Структура проекта должны быть интуитивно понятна новому человеку в проекте. Для этого можно воспользоваться принципами LIFT. Согласно им структура проекта должна позволять

  • L - (Locate) легко находить нужный нам код
  • I - (Identify) идентифицировать ответственность с первого взгляда