Skip to content

Instantly share code, notes, and snippets.

View moin786's full-sized avatar
💭
I may be slow to respond.

Mohammed Minuddin(Peal) moin786

💭
I may be slow to respond.
View GitHub Profile
@moin786
moin786 / resize_image.php
Created July 6, 2020 10:46 — forked from janzikan/resize_image.php
PHP: Resize image - preserve ratio of width and height
/**
* Resize image - preserve ratio of width and height.
* @param string $sourceImage path to source JPEG image
* @param string $targetImage path to final JPEG image file
* @param int $maxWidth maximum width of final image (value 0 - width is optional)
* @param int $maxHeight maximum height of final image (value 0 - height is optional)
* @param int $quality quality of final image (0-100)
* @return bool
*/
function resizeImage($sourceImage, $targetImage, $maxWidth, $maxHeight, $quality = 80)
@moin786
moin786 / paginate.php
Created December 17, 2019 09:54 — forked from vluzrmos/paginate.php
Laravel Paginate Collection or Array
<?php
/**
* Gera a paginação dos itens de um array ou collection.
*
* @param array|Collection $items
* @param int $perPage
* @param int $page
* @param array $options
*
* @return LengthAwarePaginator
<?php
namespace App\Blog\AbstractModel;
use App\Blog\Contracts\IConsume;
abstract class AbstractComsumeModel implements IConsume {
/**
* Show blog posts
*