Skip to content

Instantly share code, notes, and snippets.

View asanikovich's full-sized avatar
🏠
Working from home

Aliaksei Sanikovich asanikovich

🏠
Working from home
View GitHub Profile
@asanikovich
asanikovich / ubuntu_install.sh
Created March 21, 2023 19:15 — forked from nginx-gists/ubuntu_install.sh
Automating Installation of WordPress with NGINX Unit on Ubuntu
#!/usr/bin/env bash
if [ "$EUID" -ne 0 ];then
>&2 echo "This script requires root level access to run"
exit 1
fi
if [ -z "${WORDPRESS_DB_PASSWORD}" ]; then
>&2 echo "WORDPRESS_DB_PASSWORD must be set"
>&2 echo "Here is a random one that you can paste:"
@asanikovich
asanikovich / .bashrc
Created December 6, 2022 14:03 — forked from shmaltorhbooks/.bashrc
paratest with multiple db instances
alias paratest='php bin/console test:init:database:pool -e=test 10 && vendor/bin/paratest -f -p 10 —max-batch-size 5 —coverage-html=build/coverage'
@asanikovich
asanikovich / credit-card-regex.md
Created April 3, 2019 16:25 — forked from michaelkeevildown/credit-card-regex.md
Credit Card Regex Patterns

Credit Card Regex

  • Amex Card: ^3[47][0-9]{13}$
  • BCGlobal: ^(6541|6556)[0-9]{12}$
  • Carte Blanche Card: ^389[0-9]{11}$
  • Diners Club Card: ^3(?:0[0-5]|[68][0-9])[0-9]{11}$
  • Discover Card: ^65[4-9][0-9]{13}|64[4-9][0-9]{13}|6011[0-9]{12}|(622(?:12[6-9]|1[3-9][0-9]|[2-8][0-9][0-9]|9[01][0-9]|92[0-5])[0-9]{10})$
  • Insta Payment Card: ^63[7-9][0-9]{13}$
  • JCB Card: ^(?:2131|1800|35\d{3})\d{11}$
  • KoreanLocalCard: ^9[0-9]{15}$
@asanikovich
asanikovich / README.md
Created April 20, 2017 16:10 — forked from Im0rtality/README.md
PHP CLI Debugging in Vagrant using Xdebug and PHPStorm

In host:

  1. Go to PHPStorm Settings > Project settings > PHP > Servers
  2. Add server with following parameters:
    • Name: vagrant (same as serverName= in debug script)
    • Host, port: set vagrant box IP and port
    • Debugger: Xdebug
    • [v] Use path mappings
    • Map your project root in host to relative dir in guest
  • Hit OK
@asanikovich
asanikovich / rets.php
Created April 20, 2017 15:37
RETS implementation for CRMLS
<?php namespace App\Lib;
/**
* This class is customized specifically for the CRMLS
* ( California Regional Multiple Listing Service )
*/
class rets extends phRETS {
public $rets_url = 'http://rets.mrmlsmatrix.com/rets/login.ashx';
@asanikovich
asanikovich / Install-xdebug-php7.1.md
Last active May 24, 2018 14:45 — forked from hollodotme/Install-php7.md
Installing xdebug for php7.1 on Ubuntu 14.04

Install xdebug extension

# Download stable release of xdebug from https://xdebug.org/download.php
wget -c "https://xdebug.org/files/xdebug-2.5.3.tgz"
# Extract archive
tar -xf xdebug-2.5.3.tgz

cd xdebug-2.5.3/