To access from remote
mysql –u root -p
GRANT ALL PRIVILEGES ON *.* TO root@'%' IDENTIFIED BY 'password';
FLUSH PRIVILEGES;
# Source1: https://www.digitalocean.com/community/tutorials/how-to-install-linux-apache-mysql-php-lamp-stack-on-ubuntu-20-04 | |
sudo apt update | |
sudo apt install -y apache2 | |
sudo apache2 -v | |
sudo apt install -y mysql-server | |
sudo apt install -y php libapache2-mod-php php-mysql php-common php-cli php-common php-json php-opcache php-readline php-dom php-curl | |
php -v |
<?php | |
function isMatched(string $pattern, string $value): bool | |
{ | |
if ($pattern == $value) { | |
return true; | |
} | |
$pattern = preg_quote($pattern, '#'); |
mysql –u root -p
GRANT ALL PRIVILEGES ON *.* TO root@'%' IDENTIFIED BY 'password';
FLUSH PRIVILEGES;
auth_socket
to mysql_native_password
)<?php | |
namespace App\Helpers; | |
/** | |
* XML to Associative Array Class | |
* | |
* Usage: | |
* $domObj = new xmlToArrayParser($xml); |
sudo npm install npm@latest -g
npm -v
sudo npm cache clean -f
<?php | |
$finder = Symfony\Component\Finder\Finder::create() | |
->notPath('bootstrap/cache') | |
->notPath('storage') | |
->notPath('vendor') | |
->in(__DIR__) | |
->name('*.php') | |
->name('_ide_helper') | |
->notName('*.blade.php') | |
->ignoreDotFiles(true) |
((0|44|\+44|\+44\s*\(0\)|\+44\s*0)\s*)?7(\s*[0-9]){9}
<?php | |
//----------------------------------------How to use?---------------------------------------------- | |
// 1. Add the following private method in App\Providers\AppServiceProvider class | |
// 2. Call this function from boot() method of same class: $this->extendCollectionWithPaginate(); | |
//------------------------------------------------------------------------------------------------- | |
/** | |
* Macro to extends Laravel Collection | |
* If you have a collection called $item and you want to paginate it like Eloquent paginate: | |
* $items->paginate($perPage) |
/* | |
<a href="posts/2" data-method="delete"> <---- We want to send an HTTP DELETE request | |
- Or, request confirmation in the process - | |
<a href="posts/2" data-method="delete" data-confirm="Are you sure?"> | |
*/ | |
(function() { |
import html | |
from tkinter import * | |
import xml.dom.minidom as dom | |
# author Al Imran Ahmed | |
# A very simple interface to decoded xml. i.e. <tag> => <tag> | |
# requires python3^ with tkinter GUI library installed | |
class Application(Frame): | |
def decode_xml(self): |