A tweet-sized debugger for visualizing your CSS layouts. Outlines every DOM element on your page a random (valid) CSS hex color.
One-line version to paste in your DevTools
Use $$
if your browser aliases it:
~ 108 byte version
/** | |
* Function: recursive_glob | |
* Recursively goes through a folder and returns all files. | |
* | |
* Parameters: | |
* $pattern - String | |
* $flags - Boolean | |
* $path - String | |
* | |
* Returns: |
@charset "utf-8"; | |
/** | |
* iPhone 4/4s landscape & portrait | |
*/ | |
@media only screen | |
and (min-device-width: 320px) | |
and (max-device-width: 480px) | |
and (-webkit-device-pixel-ratio: 2) | |
and (device-aspect-ratio: 2/3) { | |
} |
<!doctype html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<title> 微信浏览器判断 </title> | |
</head> | |
<body> | |
<?php | |
function is_weixin(){ | |
if ( strpos($_SERVER['HTTP_USER_AGENT'], 'MicroMessenger') !== false ) { |
function data_uri($file, $mime) { | |
$contents=file_get_contents($file); | |
$base64=base64_encode($contents); | |
echo "data:$mime;base64,$base64"; | |
} |
function data_uri($file, $mime) { | |
$contents=file_get_contents($file); | |
$base64=base64_encode($contents); | |
echo "data:$mime;base64,$base64"; | |
} |
unction get_client_language($availableLanguages, $default='en'){ | |
if (isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])) { | |
$langs=explode(',',$_SERVER['HTTP_ACCEPT_LANGUAGE']); | |
//start going through each one | |
foreach ($langs as $value){ | |
$choice=substr($value,0,2); |
unction get_client_language($availableLanguages, $default='en'){ | |
if (isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])) { | |
$langs=explode(',',$_SERVER['HTTP_ACCEPT_LANGUAGE']); | |
//start going through each one | |
foreach ($langs as $value){ | |
$choice=substr($value,0,2); |
unction get_client_language($availableLanguages, $default='en'){ | |
if (isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])) { | |
$langs=explode(',',$_SERVER['HTTP_ACCEPT_LANGUAGE']); | |
//start going through each one | |
foreach ($langs as $value){ | |
$choice=substr($value,0,2); |
<?php | |
/** | |
* | |
* @param String $string | |
* @return float | |
* | |
* Returns a float between 0 and 100. The closer the number is to 100 the | |
* the stronger password is; further from 100 the weaker the password is. | |
*/ | |
function password_strength($string){ |