Skip to content

Instantly share code, notes, and snippets.

View shubkb07's full-sized avatar
๐Ÿ˜€
Meowing...

Shubham Kumar Bansal shubkb07

๐Ÿ˜€
Meowing...
View GitHub Profile
@shubkb07
shubkb07 / class-minify.php
Created December 12, 2024 18:49
A PHP class that minifies CSS and JS by removing unnecessary whitespace, comments, and other characters to produce cleaner, more efficient code.
<?php
/**
* Minify class file.
*
* This file defines the Minify class, which provides methods to minify CSS and JS content.
* It strips comments, whitespace, and other unnecessary characters to produce smaller,
* more efficient code.
*
* @package Minify
*/
@shubkb07
shubkb07 / class-image-optimizer.php
Created December 12, 2024 18:49
PHP Image Optimizer Class: Provide Options to deal with Binary Data, URL, and Path to File. This PHP class, ImageOptimizer, provides image optimization, conversion, resizing, and metadata management capabilities using PHP's GD library, supporting formats like JPG, PNG, SVG, and WebP, with both lossy and lossless compression options.
<?php
/**
* ImageOptimizer class.
*
* A class providing image optimization, conversion, resizing, and metadata management capabilities.
* The class uses PHP's built-in GD library and finfo for mime detection. It does not rely on external APIs
* or third-party libraries.
*
* @package ImageOptimizer
* @author Shubham <shub@shubkb.com>