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 / 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;"
sudo export LANGUAGE=en_US.UTF-8
sudo export LANG=en_US.UTF-8
sudo export LC_ALL=en_US.UTF-8
sudo locale-gen en_US.UTF-8
sudo dpkg-reconfigure locales
sudo apt-get update && sudo apt-get upgrade
sudo apt-get install -y python-software-properties
@butschster
butschster / Pipelines Environment variables
Created August 3, 2018 20:05
Bitbucket pipelines Laravel + deployer
DEPLOYER_VERSION=6.2.0
APP_ENV=testing
DB_CONNECTION=sqlite
DB_DATABASE=:memory:
@butschster
butschster / install-comodo-ssl-cert-for-nginx.rst
Created June 2, 2018 10:12 — forked from bradmontgomery/install-comodo-ssl-cert-for-nginx.rst
Steps to install a Comodo PositiveSSL certificate with Nginx.

Setting up a SSL Cert from Comodo

I use Namecheap.com as a registrar, and they resale SSL Certs from a number of other companies, including Comodo.

These are the steps I went through to set up an SSL cert.

Purchase the cert