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
vyspiansky / image-src-regexpr.php
Last active Nov 4, 2019
PHP: get image src attribute (regular expression)
View image-src-regexpr.php
// Source:
$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
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:
Rodrigo54 / php-html-css-js-minifier.php
Last active Feb 4, 2020 — forked from taufik-nurrohman/php-html-css-js-minifier.php
PHP Function to Minify HTML, CSS and JavaScript
View php-html-css-js-minifier.php
* -----------------------------------------------------------------------------------------
* Based on ``
* -----------------------------------------------------------------------------------------
// HTML Minifier
function minify_html($input) {
You can’t perform that action at this time.