Skip to content

Instantly share code, notes, and snippets.

Learning something

Lloric Mayuga Garcia lloricode

Learning something
View GitHub Profile
lloricode / pint.json
Created Aug 9, 2022
Optimal Laravel Pint Configuration
View pint.json
"preset": "psr12",
"exclude": [
"notPath": [
"rules": {
"align_multiline_comment": true,
lloricode / AppServiceProvider.php
Created Nov 15, 2021 — forked from themsaid/AppServiceProvider.php
Re-encryption after APP_KEY rotation
View AppServiceProvider.php
namespace App\Providers;
use App\Encrypter;
use Illuminate\Support\Str;
use Illuminate\Support\ServiceProvider;
class AppServiceProvider extends ServiceProvider
View TestFormRequest.php
namespace Tests;
use Illuminate\Contracts\Auth\Authenticatable;
use Illuminate\Foundation\Http\FormRequest;
use Illuminate\Validation\ValidationException;
use Illuminate\Validation\Validator;
use Symfony\Component\HttpFoundation\ParameterBag;
use function PHPUnit\Framework\assertFalse;
lloricode / gist:d2b56b6b2ae13c9227d839ad336b6fc4
Created Jul 30, 2020 — forked from rxaviers/gist:7360908
Complete list of github markdown emoji markup
View gist:d2b56b6b2ae13c9227d839ad336b6fc4


:bowtie: :bowtie: 😄 :smile: 😆 :laughing:
😊 :blush: 😃 :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
😆 :satisfied: 😁 :grin: 😉 :wink:
😜 :stuck_out_tongue_winking_eye: 😝 :stuck_out_tongue_closed_eyes: 😀 :grinning:
😗 :kissing: 😙 :kissing_smiling_eyes: 😛 :stuck_out_tongue:
View One Liner to Download the Latest Release from Github
  • Use curl to get the JSON response for the latest release
  • Use grep to find the line containing file URL
  • Use cut and tr to extract the URL
  • Use wget to download it
curl -s \
| grep "browser_download_url.*deb" \
| cut -d : -f 2,3 \
| tr -d \" \
lloricode / gist:25c962582fe76acb9b21b87c0ce387d1
Created Oct 31, 2019 — forked from LuenCC/gist:e8dcf4a38096617799f3002644012af6
Laravel find nearest location in km from lat, long database
View gist:25c962582fe76acb9b21b87c0ce387d1
private function findNearestLocation(Request $request)
$location = DB::table('locations')
->select('name', 'latitude', 'longitude', 'region', DB::raw(sprintf(
'(6371 * acos(cos(radians(%1$.7f)) * cos(radians(latitude)) * cos(radians(longitude) - radians(%2$.7f)) + sin(radians(%1$.7f)) * sin(radians(latitude)))) AS distance',
->having('distance', '<', 50)
->orderBy('distance', 'asc')
lloricode /
Created Jul 29, 2019 — forked from jeremykenedy/
SQL Server Driver Installer for Laravel Homestead
# SQL Server Driver Installer for Laravel Homestead
# This script downloads, compiles, and installs the PHP 7 extension
# files for both the native sqlsrv and the PDO pdo_sqlsrv drivers.
# Get the Microsoft Driver Source Code from Github
cd ~
git clone
cd msphpsql
lloricode /
Created Jul 29, 2019 — forked from LegitDongo/
SQLSRV PHP 7.2 Drivers that work for Laravel Homestead
# Best if added to `` so that this gets run every time the box is provisioned
# composer won't be able to download updates with an active proxy, and will hang trying to get the newest file
# You may want to comment this out based on your network configuration
sudo bash -c 'echo "export NO_PROXY=*" >> ~/.profile'
sudo add-apt-repository ppa:ondrej/php -y
sudo apt-get update
sudo apt-get install php7.2-dev php7.2-xml mcrypt php-pear php-mbstring unixodbc unixodbc-dev -y --allow-unauthenticated
View composer install
Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
View sudo apt install php7.2-imagick
Reading package lists... Done
Building dependency tree
Reading state information... Done
Note, selecting 'php-imagick' instead of 'php7.2-imagick'
The following additional packages will be installed:
fonts-droid-fallback fonts-noto-mono ghostscript gsfonts imagemagick-6-common libcupsfilters1 libcupsimage2 libfftw3-double3 libgs9 libgs9-common libijs-0.35 libjbig2dec0
liblqr-1-0 libmagickcore-6.q16-3 libmagickwand-6.q16-3 libpaper-utils libpaper1 poppler-data ttf-dejavu-core
Suggested packages:
fonts-noto ghostscript-x libfftw3-bin libfftw3-dev libmagickcore-6.q16-3-extra poppler-utils fonts-japanese-mincho | fonts-ipafont-mincho fonts-japanese-gothic
| fonts-ipafont-gothic fonts-arphic-ukai fonts-arphic-uming fonts-nanum