This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { | |
ArgumentsHost, | |
Catch, | |
ExceptionFilter, | |
HttpException, | |
} from '@nestjs/common'; | |
import { Request, Response } from 'express'; | |
interface ErrorObject { | |
[key: string]: { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env php | |
<?php | |
/** | |
* --host: host example.dev | |
* --path: project-name/ | |
* --company: company name if you want to use SSL | |
* --country: country name if you want to use SSL | |
**/ | |
$args = getopt(null, ["host:", "path:", "company:", "country:"]); | |
$file = file_get_contents('./nginx/sites/app.conf.example'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Array | |
( | |
[GRU] => Array | |
( | |
[2018/03/10] => Array | |
( | |
[0] => Array | |
( | |
[0] => Array | |
( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
return [ | |
'1033edge.com', | |
'11mail.com', | |
'123.com', | |
'123box.net', | |
'123india.com', | |
'123mail.cl', | |
'123qwe.co.uk', | |
'150ml.com', | |
'15meg4free.com', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// PDO Connection to MySQL | |
$conn = new PDO('mysql:host=localhost;dbname=yourdbname', 'username', 'password'); | |
// PDO Connection to PostgreSQL | |
$conn = new PDO('pgsql:host=localhost;dbname=yourdbname', 'username', 'password'); | |
// A quick Select Query with For Loop | |
foreach ($conn->query("SELECT * FROM profile") as $row) | |
echo $row['fullname']; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
#your db settings | |
USER="db_root" | |
PASS="db_pass" | |
PATH="/path/to/backup/folder" | |
HOST="mysql_host" | |
DATE=`date +%d%m%y%H%M` | |
#get databases list | |
databases=`mysql --host=$HOST --user=$USER --password=$PASS -e "SHOW DATABASES;" | tr -d "| " | grep -v Database` |