This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
try { | |
throw new Exception('wrong'); | |
} catch(Exception $ex) { | |
$msg = 'Error:'.$ex->getMessage()."\n"; | |
$msg.= $ex->getTraceAsString()."\n"; | |
$msg.= '异常行号:'.$ex->getLine()."\n"; | |
$msg.= '所在文件:'.$ex->getFile()."\n"; | |
//将异常信息记录到日志中 | |
file_put_contents('error.log', $msg); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$img = imagecreatetruecolor(100, 40); | |
$black = imagecolorallocate($img, 0x00, 0x00, 0x00); | |
$green = imagecolorallocate($img, 0x00, 0xFF, 0x00); | |
$white = imagecolorallocate($img, 0xFF, 0xFF, 0xFF); | |
imagefill($img,0,0,$white); | |
//生成随机的验证码 | |
$code = ''; | |
for($i = 0; $i < 4; $i++) { | |
$code .= rand(0, 9); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.has-transition { | |
-webkit-transition: margin-left 1s ease-out; | |
-moz-transition: margin-left 1s ease-out; | |
-o-transition: margin-left 1s ease-out; | |
transition: margin-left 1s ease-out; | |
} | |
li { | |
background: #ccc; | |
border: 1px #000 solid; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
img{ | |
max-width: 100%; | |
vertical-align: top; | |
height: auto; | |
width: auto; | |
} | |
.type{ | |
max-width: 50em; | |
margin: auto; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'Helvetica Neue', Arial, 'Hiragino Sans GB', | |
'Microsoft Yahei', 'WenQuanYi Micro Hei', sans-serif; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
background-image: -webkit-linear-gradient(-410deg, rgba(68, 68, 68, 0.6) 20%, rgba(0, 0, 0, 0.9)); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if(!document.URL.match(new RegExp('v\\.baidu\\.com'))){ | |
(function() { | |
Function.prototype.bind = function() { | |
var fn = this, args = Array.prototype.slice.call(arguments), obj = args.shift(); | |
return function() { | |
return fn.apply(obj, args.concat(Array.prototype.slice.call(arguments))); | |
}; | |
}; | |
function A() {} | |
A.prototype = { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if ($.browser.msie && parseInt($.browser.version, 10) === 7) { | |
alert('IE7'); | |
} else { | |
alert('Non IE7'); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
* { | |
margin: 0; | |
padding: 0; | |
} | |
.cont { | |
background-color: #ccc; | |
font-size: 24px; | |
height: 150px; | |
text-align: center; | |
overflow: hidden; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
html { -webkit-animation-name:thePage; -webkit-animation-duration:600ms; -webkit-animation-timing-function:ease-in-out; } @-webkit-keyframes thePage { 0% { opacity: 0; -webkit-transform: translateY(-50px); } 100% { opacity: 1; -webkit-transform: translateY(0); }} | |
@-webkit-keyframes thePage { 0% { opacity: 0; -webkit-transform: translateY(-50px); } 100% { opacity: 1; -webkit-transform: translateY(0) |