Skip to content

Instantly share code, notes, and snippets.

View butschster's full-sized avatar
☀️
If you are looking for a mentor I'm ready to discuss.

Pavel Buchnev butschster

☀️
If you are looking for a mentor I'm ready to discuss.
View GitHub Profile
@butschster
butschster / ClientServiceExample.php
Last active August 16, 2023 10:18
GrpcExceptionMapper
<?php
declare(strict_types=1);
namespace Shared\gRPC\Service\Client;
use Shared\gRPC\Attribute\ServiceClient;
use Shared\gRPC\Service\ServiceClientTrait;
use Shared\gRPC\Services\Auth\v1\AuthServiceInterface;
use Shared\gRPC\Services\Auth\v1\Request\ChangePasswordRequest;
@butschster
butschster / 3.8.0.md
Last active August 15, 2023 12:41
3.8.0.md

Improvements

1. Added instructions feature for scaffold generator

We are excited to announce a new feature, that enhances the scaffold generation process by providing clear and concise instructions on the next steps to be taken after generating various classes for your application.

With the Instructions feature, you can generate classes for the following components:

  • Bootloader
  • Command
  • Config
@butschster
butschster / EventBootloader.php
Last active January 25, 2022 20:40
Spiral Framework EventDispatcher
<?php
declare(strict_types=1);
namespace App\Bootloader;
use App\Event\EventHandler;
use App\Event\ShouldBeQueued;
use Spiral\Boot\Bootloader\Bootloader;
use Spiral\Core\Container;
@butschster
butschster / 2021-11-19-en.md
Last active December 3, 2021 16:38
CycleORM news digest

Hello everybody!

We know, that you are looking forward to a CycleORM updates and this fact motivates us working faster and more efficiently.

Here they are!

1. Added support for Entity typecast handlers.

CycleORM is used to allow otping a column type among the primitive types such as int, string, float, datetime and callable, but now you can create typecast handler class, that implements Cycle\ORM\Parser\TypecastInterface and define it (or array of handlers) as an Entity columns typecast handler.

@butschster
butschster / notify.js
Created July 30, 2020 07:34
Vue notifications
import Noty from 'noty'
import Vue from 'vue'
const notify = {
/**
* @param {String} text
* @returns {*}
*/
success(text) {
<?php
class TemporarySignature implements TemporarySignatureInterface
{
private string $hashKey;
private int $ttl;
/**
* @param string $hashKey
* @param int $ttl Время жизни токена в минутах
<template>
<layout>
<page-header :title="title"></page-header>
<page-content>
<news-form :onSubmit="onSubmit" :data="news" :loading="loading"></news-form>
</page-content>
</layout>
</template>
<script>
@butschster
butschster / dbdiagram-builder.php
Created January 14, 2020 20:15
Database diagram builder for https://dbdiagram.io/
<?php
namespace App\Console\Commands;
use Doctrine\DBAL\Schema\AbstractSchemaManager;
use Illuminate\Console\Command;
use Illuminate\Database\ConnectionInterface;
use Illuminate\Support\Arr;
class BuildDatabaseSchemaDiagramCommand extends Command
# INSTALL
# REQUIRES:
# - server (the server instance)
# - user (the database user instance)
#
# Add MySQL User
mysql --user="root" --password="IywEehlDEnpoOLSPgWEO" -e "DROP USER IF EXISTS test;"