A Pen by Robert Fridzema on CodePen.
A Pen by Robert Fridzema on CodePen.
Configure octane laravel/octane
Install swoole extension (place in corresponding .ini
file(s)):
pecl install swoole
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
$schema = collect(DB::connection()->getDoctrineSchemaManager()->listTableNames())->map(function ($item, $key) { | |
return [ | |
'name' => $item, | |
'colomns' => DB::getSchemaBuilder()->getColumnListing($item) | |
]; | |
}); |
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
select | |
first_name, | |
last_name | |
from | |
users | |
left join | |
companies on companies.id = users.company_id | |
where ( | |
companies.name like 'TERM%' or | |
first_name like 'TERM%' or |
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 generateRelationsQuery($request, $db_query, $model, $filter_relations) | |
{ | |
$filter_appends = []; | |
foreach ($filter_relations as $key => $value) { | |
if (!isset($value['custom_query'])) { | |
if ($request->has('filter-remote-' . strtolower($key))) { | |
$select_value = $request->input('filter-remote-' . strtolower($key)); | |
if (!empty($select_value)) { | |
$filter_appends['filter-remote-' . strtolower($key)] = $select_value; |
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
$tables = collect(Schema::getAllTables())->pluck('Tables_in_pmp'); | |
$softdeletes = []; | |
foreach ($tables as $table) { | |
if (Schema::hasColumn($table, 'deleted_at')) { | |
$softdeletes[$table] = DB::table($table)->whereNotNull('deleted_at')->count(); | |
} | |
} |
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 | |
# Sample script written for Part 4 of the RHCE series | |
# This script will return the following set of system information: | |
# -Hostname information: | |
echo -e "\e[31;43m***** HOSTNAME INFORMATION *****\e[0m" | |
hostnamectl | |
echo "" | |
# -File system disk space usage: | |
echo -e "\e[31;43m***** FILE SYSTEM DISK SPACE USAGE *****\e[0m" |
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 | |
sudo apt-get autoremove -y; | |
sudo apt-get autoclean -y; | |
sudo updatedb; | |
sync; echo 1 > /proc/sys/vm/drop_caches | |
sudo reboot -h now; |
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
declare -A colors | |
#curl www.bunlongheng.com/code/colors.png | |
# Reset | |
colors[Color_Off]='\033[0m' # Text Reset | |
# Regular Colors | |
colors[Black]='\033[0;30m' # Black | |
colors[Red]='\033[0;31m' # Red | |
colors[Green]='\033[0;32m' # Green |
NewerOlder