請配合 SassMeister 使用。
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
1. 取整同时转成数值型 | |
'10.567890'|0 | |
//结果: 10 | |
'10.567890'^0 | |
//结果: 10 | |
-2.23456789|0 | |
//结果: -2 | |
~~-2.23456789 | |
//结果: -2 |
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
input::-ms-clear { display: none;} |
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
#声明文档使用的字符编码是 UTF-8 | |
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> | |
##HTML5 中简化为 | |
<meta charset='utf-8'> | |
#使用关键词描述一个网页的属性,SEO 必选 | |
<meta name="keywords" content="your, tags" /> | |
#使用一段自然语言描述一个网页的属性,SEO 必选 |
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
打开“终端”(应用程序->实用工具),输入以下两条命令: | |
defaults write com.apple.finder _FXShowPosixPathInTitle -bool TRUE;killall Finder |
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
defaults write com.apple.finder AppleShowAllFiles TRUE | |
killall Finder | |
把 TRUE 换曾 FALSE 就可以关闭显示隐藏文件。 |
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
<center> | |
不建议用了。 | |
text-align:center | |
在父容器里水平居中 inline 文字,或 inline 元素 |
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
// 取自 UnderscoreJS 实用框架 | |
function debounce(func, wait, immediate) { | |
var timeout; | |
return function() { | |
var context = this, args = arguments; | |
var later = function() { | |
timeout = null; | |
if (!immediate) func.apply(context, args); | |
}; | |
var callNow = immediate && !timeout; |
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
function doesConnectionExist(file) { | |
var xhr = new XMLHttpRequest(); | |
var randomNum = Math.round(Math.random() * 10000); | |
xhr.open('HEAD', file + "?rand=" + randomNum, false); | |
try { | |
xhr.send(); | |
if (xhr.status >= 200 && xhr.status < 304) { |