This file contains 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
public function getCategoryBySlug($slug, $request) | |
{ | |
return Category::with([ | |
'parent', | |
'products' => function ($table) use ($request) { | |
$params = collect($request); | |
$orderBy = isset($params['order_by']) ? $params['order_by'] : 'created_at'; | |
$order = isset($params['order']) ? $params['order'] : 'DESC'; | |
$results = isset($params['results']) ? $params['results'] : 30; | |
$filters = $params->except(['order', 'results', 'order_by']); |
This file contains 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 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
{ | |
"type": "dark", | |
"colors": { | |
"focusBorder": "#292d36", | |
"foreground": "#3d424d", | |
"widget.shadow": "#00010a", | |
"selection.background": "#161f2afd", | |
"textBlockQuote.background": "#0d1016", | |
"textLink.foreground": "#e6b450", | |
"textLink.activeForeground": "#e6b450", |
This file contains 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 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 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 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` |