Skip to content

Instantly share code, notes, and snippets.

View Erth0's full-sized avatar

Eluert Mukja Erth0

View GitHub Profile
@Erth0
Erth0 / createdb.sh
Last active September 2, 2022 17:27
Creates a database if not exists based on laravel .env file and opens the database with the default application.
createdb () {
[ ! -f .env ] && { echo "No .env file found."; exit 1; }
DB_CONNECTION=$(grep DB_CONNECTION .env | grep -v -e '^\s*#' | cut -d '=' -f 2-)
DB_HOST=$(grep DB_HOST .env | grep -v -e '^\s*#' | cut -d '=' -f 2-)
DB_PORT=$(grep DB_PORT .env | grep -v -e '^\s*#' | cut -d '=' -f 2-)
DB_DATABASE=$(grep DB_DATABASE .env | grep -v -e '^\s*#' | cut -d '=' -f 2-)
DB_USERNAME=$(grep DB_USERNAME .env | grep -v -e '^\s*#' | cut -d '=' -f 2-)
DB_PASSWORD=$(grep DB_PASSWORD .env | grep -v -e '^\s*#' | cut -d '=' -f 2-)
<?php
use PhpCsFixer\Config;
use PhpCsFixer\Finder;
$rules = [
'array_syntax' => ['syntax' => 'short'],
'binary_operator_spaces' => [
'default' => 'single_space',
'operators' => ['=>' => null],
@Erth0
Erth0 / .txt
Created December 22, 2019 09:28
Install Supervisor Ubuntu And Set it Up.
1)sudo apt install supervisor or
sudo apt-get install supervisor
2)cd /etc/supervisor/conf.d 3)create new file inside
sudo vim queue-worker.conf
File Content
[program:email-queue]
process_name=%(program_name)s_%(process_num)02d
@Erth0
Erth0 / Initials.php
Created January 17, 2019 08:54
PHP Initials Class
<?php
class Initials
{
/**
* Generate initials from a name
*
* @param string $name
* @return string
*/
@Erth0
Erth0 / txt
Created July 2, 2018 07:53
Resizable panels with javascript.
https://nathancahill.github.io/Split.js/