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
<?php
namespace App\Exceptions;
use Closure;
use Exception;
use Illuminate\Database\Eloquent\ModelNotFoundException;
use Symfony\Component\HttpKernel\Exception\HttpException;
use Illuminate\Foundation\Exceptions\Handler as BaseHandler;
use Illuminate\Contracts\Debug\ExceptionHandler as ExceptionHandlerContract;
@butschster
butschster / debian-laravel.sh
Last active June 17, 2022 10:24
LEMP server configured for Laravel (MySQL, NGINX, php7.2-fpm, Redis, Websocket server, MongoDB, Composer)
# ================================================
# PHP 7.2
#
# See https://www.colinodell.com/blog/201711/installing-php-72
# ================================================
apt-get install -y apt-transport-https lsb-release ca-certificates
wget -O /etc/apt/trusted.gpg.d/php.gpg https://packages.sury.org/php/apt.gpg
echo "deb https://packages.sury.org/php/ $(lsb_release -sc) main" | tee /etc/apt/sources.list.d/php.list
apt-get update
apt-get install -y php7.2-cli php7.2-gd php7.2-mbstring php7.2-curl php7.2-xml php7.2-zip
@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

@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:
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
# 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;"
@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
<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>
<?php
class TemporarySignature implements TemporarySignatureInterface
{
private string $hashKey;
private int $ttl;
/**
* @param string $hashKey
* @param int $ttl Время жизни токена в минутах
@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) {