sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
- Download zsh-autosuggestions by
# Must run from the root of a Laravel app | |
alias clearlog="truncate -s 0 $PWD/storage/logs/laravel.log" | |
alias clearlogs="truncate -s 0 $PWD/storage/logs/*.log" | |
# Or using git rev-parse | |
alias clearlog="truncate -s 0 $(git rev-parse --show-toplevel)/storage/logs/laravel.log" | |
alias clearlogs="truncate -s 0 $(git rev-parse --show-toplevel)/storage/logs/*.log" |
<?php | |
namespace App\Nova\Actions; | |
use Illuminate\Database\Eloquent\Model; | |
use Illuminate\Queue\SerializesModels; | |
use Illuminate\Support\Collection; | |
use Laravel\Nova\Actions\Action; | |
use Laravel\Nova\Fields\ActionFields; |
function calculate_age($birthday) { | |
$birthday_timestamp = strtotime($birthday); | |
$age = date('Y') - date('Y', $birthday_timestamp); | |
if (date('md', $birthday_timestamp) > date('md')) { | |
$age--; | |
} | |
return $age; | |
} | |
//вызов функции |
<?php | |
if (! function_exists('dbd')) { | |
/** | |
* Showing all database queries. | |
* Отображение всех запросов в базу. | |
* | |
* @param null|\Illuminate\Console\Command|\Psr\Log\LoggerInterface $channel | |
*/ | |
function dbd($channel = null) |
<?php | |
if(!function_exists('config_path')) | |
{ | |
/** | |
* Return the path to config files | |
* @param null $path | |
* @return string | |
*/ | |
function config_path($path=null) |
<?php | |
require_once "vendor/autoload.php"; | |
use Symfony\Component\Console\Application; | |
use Illuminate\Database\Console\Migrations; | |
use Pimple\Container; | |
$container = new Container(); | |
$container['migration-table'] = 'migration'; |
# Ask for the user password | |
# Script only works if sudo caches the password for a few minutes | |
sudo true | |
# Install kernel extra's to enable docker aufs support | |
# sudo apt-get -y install linux-image-extra-$(uname -r) | |
# Add Docker PPA and install latest version | |
# sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 36A1D7869245C8950F966E92D8576A8BA88D21E9 | |
# sudo sh -c "echo deb https://get.docker.io/ubuntu docker main > /etc/apt/sources.list.d/docker.list" |