[1,2,3,4].filter(function(a){
console.log(this);
console.log('a:'+a);
return a!==this[0];
},[2]);
This file contains 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> | |
<head> | |
<meta name="renderer" content="webkit|ie-comp|ie-stand"> | |
</head> | |
<body> | |
</body> | |
</html> |
This file contains 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
var fs = require('fs'); | |
var iconv = require('iconv-lite'); | |
fs.readFile('./a_uft8.md', function(err, data) { | |
if (err) { | |
console.error(err); | |
} else { | |
var str = iconv.decode(data, 'utf-8'); | |
var str2 = iconv.encode(str, 'gbk') | |
var str3 = iconv.decode(str2, 'gbk') |
This file contains 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
# http://zhang.zipeng.info/library/coffeescript/07_the_bad_parts.html | |
# 使用typeof | |
# 这里是jQuery的$.type的实现的例子 | |
type = do -> | |
classToType = {} | |
for name in "Boolean Number String Function Array Date RegExp Undefined Null".split(" ") | |
classToType["[object " + name + "]"] = name.toLowerCase() | |
(obj) -> |
This file contains 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 color(){ | |
return '#' + Math.floor(0x1000000 + Math.random() * 0x1000000).toString(16).slice(1); | |
} |
This file contains 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
/* | |
动态加载jQuery并等待载入完毕后回调main | |
Author:McFog | |
*/ | |
_unique_main = function() { | |
//maincode with jquery support | |
}//end of main | |
if(typeof $ != 'function' || typeof $().jquery != 'string') { | |
_unique_doc = document.getElementsByTagName('head')[0]; | |
_unique_js = document.createElement('script'); |
This file contains 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
<!DOCTYPE HTML> | |
<html> | |
<head> | |
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"> | |
<title>图片垂直居中demo</title> | |
</head> | |
<style> | |
/*全局样式*/ | |
body, div, dl, dt, dd, ul, ol, li, h1, h2, h3, h4, h5, h6, pre, code, form, fieldset, legend, input, textarea, p, blockquote, th, td, hr, button, article, aside, details, figcaption, figure, footer, header, hgroup, menu, nav, section { margin: 0; padding: 0; } | |
body, button, input, select, textarea { font: 12px/1.5 Arial,"microsoft yahei","微软雅黑E\8F6F\96C5\9ED1"; } |
This file contains 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
<!DOCTYPE HTML> | |
<html> | |
<head> | |
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"> | |
<style type="text/css"> | |
h2 { margin:0; padding:10px 0; font-size:14px; } | |
.mod-retweet { background:#E4EFF4; border:1px solid #A8D1E0; padding:3px 5px 5px; margin-top:5px; } | |
.mod-retweet .mod-retweet-textarea { background-color: #FFFFFF; border:1px solid #64B2D1; margin-bottom:5px; overflow:hidden; padding:2px; position:relative; zoom:1 } | |
.mod-retweet .mod-retweet-textarea textarea {padding: 0;margin: 0; border:0 none; font-size:12px; height:80px; line-height:1.5em; width:100%; display:block } | |
.mod-retweet .mod-retweet-textarea input { border:0 none; font-size:12px; height:20px; line-height:1.5em; width:100%; } |
OlderNewer