Other 基本的html页面

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">

<head><title>Basic Web Page</title>

<link rel="stylesheet" href="folder/file.css" type="text/css" media="all" />
<style type="text/css" media="all">@import url("folder/file.css");</style>

<meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />
<meta name="MSSmartTagsPreventParsing" content="TRUE" />
<meta http-equiv="expires" content="-1" />
<meta http-equiv= "pragma" content="no-cache" />
<meta name="robots" content="all" />
<meta name="author" content="" />
<meta name="description" content="Basic starting point for an html page." />

</head>

<body>




</body>

</html>

Other 用于处理事件委托的JQuery函数

jQuery.delegate = function(rules) {
  return function(e) {
    var target = $(e.target);
    for (var selector in rules)
      if (target.is(selector)) return rules[selector].apply(this, $.makeArray(arguments));
  }
}

Other 标签云

import List
genTags tags =  (unwords.map (\(x, y) -> "<font size=" ++ show (min (1 + y*5 `div` mx) 5) ++ "/>" ++ x ++ "</font>")) ws
                where   mx = (maximum.map snd) ws
                        ws = (map (\x->(head x, length x)).group.sort.words.unwords) tags

Other 如何使用find和grep在一系列文件中搜索字符串

find . -exec grep "www.athabasca" '{}' \; -print

Other IE6中的最小高度

#min-height_in_ie6 {
min-height:XXXpx;
height:auto !important;
height:XXXpx;
}

Other ajax的回应

	$response = new AjaxResponse();
	$response->addText( $wgOut->getHTML() );
	$response->setCacheDuration( false ); //don't cache, because of tokens etc

Other Vim排序线

:!sort

Other javascript获取url参数gup

var gup = function( name ) {
    var results = (new RegExp("[\\?&]"+name+"=([^&#]*)")).exec(window.location.href);
    if ( results == null ) {return ""}
    else {return results[1]}
};

Other toQueryString

var toQueryString = function(queryObj) {
    var params=[];
    for (var property in queryObj){
        params.push(property+'='+queryObj[property]);
    };
    return params.join('&');
};

Other jsonHandler

var jsonHandler = makeClass({
    initialize: function(o) {
        // window.funcArray=[];
        this.funcI=0;
        this.o = extendObj({
            callbackKey:'_callback',
            funcPrefix:'jsonHandle'
        },o||{});
    },
    json : function(url,callbackFunc) {
        this.funcI++;
        var name = this.o.funcPrefix+this.funcI;
        window[name]=callbackFunc;
        appendScript(url+'&'+this.o.callbackKey+'='+name);
    }
});