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 Destination::addSelect(['last_flight' => Flight::select('name') | |
->whereColumn('destination_id', 'destinations.id') | |
->orderBy('arrived_at', 'desc') | |
->limit(1) | |
])->get(); | |
// Query Builder | |
return Destination::addSelect(['last_flight' => function ($query) { | |
$query->select('name') | |
->from('flights') |
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
Carbon::macro('isValidDate', function ($string, $format = 'Y-m-d') { | |
$d = \DateTime::createFromFormat($format, $string); | |
return $d && $d->format($format) === $string; | |
}); | |
Carbon::macro('sunrise', function ($lat, $lng) { | |
$info = date_sun_info(time(), $lat, $lng); | |
return Carbon::parse($info['sunrise'], config('app.timezone')); | |
}); |
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
phpdoc -d ./app -t ./public/phpdoc --template="new-black" | |
#abstract | |
#checkstyle | |
#clean | |
#new-black | |
#old-ocean | |
#responsive-twig | |
#responsive |
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
foreach(range(6000,6999) as $i){ | |
// Remote image URL | |
$url = 'https://ozgrozer.github.io/100k-faces/0/6/00' . $i . '.jpg'; | |
$img = public_path('avatars/' . $i . '.jpg'); | |
$ch = curl_init($url); | |
$fp = fopen($img, 'wb'); | |
curl_setopt($ch, CURLOPT_FILE, $fp); | |
curl_setopt($ch, CURLOPT_HEADER, 0); | |
curl_exec($ch); |
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
composer require laravel/ui | |
php artisan ui bootstrap --auth |
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
npm install -g npm-check-updates | |
ncu -u | |
npm update | |
npm install | |
// Update NPM - PowerShell as Admin | |
Set-ExecutionPolicy Unrestricted -Scope CurrentUser -Force | |
npm install --global --production npm-windows-upgrade | |
npm-windows-upgrade |
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
https://codepen.io/stephenbunch/pen/KWBNVo |
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
certbot -d '*.hins.dev' --manual --preferred-challenges dns certonly | |
sudo chmod 0755 /etc/letsencrypt/ | |
sudo chmod 0711 /etc/letsencrypt/live/ | |
sudo chmod 0750 /etc/letsencrypt/live/hins.dev/ | |
sudo chmod 0711 /etc/letsencrypt/archive/ | |
sudo chmod 0750 /etc/letsencrypt/archive/hins.dev/ | |
sudo chmod 0640 /etc/letsencrypt/archive/hins.dev/{cert,chain,fullchain}*.pem | |
sudo chmod 0640 /etc/letsencrypt/archive/hins.dev/privkey*.pem |
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
netsh advfirewall firewall add rule name="80" dir=in action=allow protocol=TCP localport=80 | |
netsh advfirewall firewall add rule name="80" dir=out action=allow protocol=TCP localport=80 | |
netsh advfirewall firewall add rule name="443" dir=in action=allow protocol=TCP localport=443 | |
netsh advfirewall firewall add rule name="443" dir=out action=allow protocol=TCP localport=443 |
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
certbot -d *.mikehins.com --manual --preferred-challenges dns certonly |