Skip to content

Instantly share code, notes, and snippets.

View shov's full-sized avatar
🐊
^^

Alexander Shevchenko shov

🐊
^^
View GitHub Profile
@shov
shov / TestHelperTrait.php
Created February 26, 2018 08:54
Laravel test migration and seeding helper
<?php declare(strict_types=1);
namespace Tests\Feature;
use Illuminate\Foundation\Testing\DatabaseMigrations;
use Illuminate\Contracts\Console\Kernel;
/**
* Some functionality for TestCases
*
@shov
shov / gitroutine.md
Last active November 6, 2018 09:54
git routine

New empty repository started on github

  1. Go github, create new repo
  2. Copy ssh/https link
  3. Go to your project folder 4.git clone <paste link here> and all project will be downloaded to new folder with same name as project is
  4. Or you can set name of this folder git clone <paste link here> newfolder

New repository from existing project

@shov
shov / autoload.php
Last active February 13, 2019 06:28 — forked from holisticnetworking/autoload.php
Autoloading for both WordPress classes and PSR-4
<?php
/**
* Autoload PSR-4 and Wordpress compatible named classes,
* Require it in very begin of your functions.php or plugin
*
* @author Alexandr Shevchenko <ls.shov@gmail.com>
* @author Thomas J Belknap <tbelknap@holisticnetworking.net>
*/
namespace App; //Change it
/** @var string : autoload root $rootDir */
@shov
shov / reborn_brew.sh
Created April 1, 2019 12:16
Reborn brew packages after migration
#!/bin/bash
brew list -1 > brew.txt \ # list out all installed packages
&& brew list -1 | xargs brew rm --force \ # remove all installed packages
&& brew install $(cat brew.txt | tr '\n' ' ') \ # install all previously installed packages
&& rm brew.txt
@shov
shov / links.txt
Created January 22, 2019 12:57
XDebug on laradock
@shov
shov / array-to-texttable.php
Created April 26, 2017 12:49 — forked from tony-landis/array-to-texttable.php
PHP: Array to Text Table Generation Class
<?php
/**
* Array to Text Table Generation Class
*
* @author Tony Landis <tony@tonylandis.com>
* @link http://www.tonylandis.com/
* @copyright Copyright (C) 2006-2009 Tony Landis
* @license http://www.opensource.org/licenses/bsd-license.php
*/
class ArrayToTextTable
@shov
shov / default.conf
Created March 18, 2020 08:41
Nginx to Nodejs proxy with SSL
server {
listen 80;
server_name example.com;
# Redirect all traffic to SSL
rewrite ^ https://$server_name$request_uri? permanent;
}
server {
@shov
shov / git_log.sh
Created October 11, 2018 09:25
Beautiffied git log
git log --graph --abbrev-commit --decorate --format=format:'%C(bold blue)%h%C(reset) - %C(bold green)(%ar)%C(reset) %C(white)%s%C(reset) %C(dim white)- %an%C(reset)%C(bold yellow)%d%C(reset)' --all
@shov
shov / Dockerfile-part
Created May 12, 2018 12:23
Laradock dockerfile parts for php-fpm and workspace to install zeroMQ zmq
##PHP-FPM
RUN apt-get update -yqq && \
apt-get install -y build-essential libtool autoconf pkg-config libsodium-dev libzmq-dev && \
echo '' | pecl install -o -f zmq-beta && rm -rf /tmp/pear && \
echo "extension=zmq.so" > /usr/local/etc/php/conf.d/zmq.ini \
##WORCKSPACE
RUN apt-get update -yqq && \
apt-get install -y build-essential libtool autoconf pkg-config libsodium-dev libzmq-dev && \
echo '' | pecl install -o -f zmq-beta && rm -rf /tmp/pear && \
@shov
shov / biggest10DirFile.sh
Created June 5, 2017 08:29
Looking for 10 biggest dir and file
#!/bin/bash
echo "Dirs"
du -hsx * | sort -rh | head -10
echo "Files"
find . -type f -printf '%s %p\n'| sort -nr | head -10