Skip to content

Instantly share code, notes, and snippets.

Alan Zhang alan-zhang-

Block or report user

Report or block alan-zhang-

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@Rodrigo54
Rodrigo54 / php-html-css-js-minifier.php
Last active Oct 13, 2019 — forked from tovic/php-html-css-js-minifier.php
PHP Function to Minify HTML, CSS and JavaScript
View php-html-css-js-minifier.php
<?php
/**
* -----------------------------------------------------------------------------------------
* Based on `https://github.com/mecha-cms/mecha-cms/blob/master/system/kernel/converter.php`
* -----------------------------------------------------------------------------------------
*/
// HTML Minifier
function minify_html($input) {
@nbouvrette
nbouvrette / inputTypeNumberPolyfill.js
Last active Apr 18, 2019
Stand alone JavaScript polyfill allow only numbers on input of type number.
View inputTypeNumberPolyfill.js
/**
* Stand alone polyfill allow only numbers on input of type number.
*
* While input filtering is already supported by default by some browsers, maximum length has not been implemented by
* any. This script will solve both issue and make sure that only digits can be entered in input elements of type
* number. If the optional attribute `max` is set, it will calculate it's length and mimic the `maxlength` behavior on
* input of type text.
*
* Supports:
*
@vyspiansky
vyspiansky / image-src-regexpr.php
Last active Mar 21, 2019
PHP: get image src attribute (regular expression)
View image-src-regexpr.php
<?php
// Source: http://goo.gl/qyLFbg
$html = '<img border="0" src="/images/image.jpg" alt="Image" width="100" height="100" />';
preg_match( '@src="([^"]+)"@' , $html, $match );
$src = array_pop($match);
// will return /images/image.jpg
You can’t perform that action at this time.