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
#!/bin/sh | |
#****************************************************************# | |
# ScriptName: build-wd-server.sh | |
# Author: hua.qiuh | |
# Create Date: 2011-12-02 | |
# Modify Author: | |
# Modify Date: 2011-12-02 | |
# Function: | |
#***************************************************************# |
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
class String | |
def utf8! | |
%w(ascii-8bit utf-8 ucs-bom shift-jis gb18030 gbk gb2312 cp936).any? do |c| | |
begin | |
if self.respond_to? :encode | |
self.encode!('utf-8', c).force_encoding('utf-8') | |
else | |
require 'iconv' | |
text = Iconv.new('UTF-8', c).iconv(self) |
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
/** | |
* The first commented line is your dabblet’s title | |
*/ | |
background: #f06; | |
background: linear-gradient(45deg, #f06, yellow); | |
min-height: 100%; |
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
/** | |
* CSS3 progress bar | |
* desgin: http://dribbble.com/shots/522214-Progress-Bar | |
*/ | |
body { | |
background-image: repeating-linear-gradient(0, #3C3540 0, #3C3540 50%, #38313B 50%, #38313B 100%); | |
background-size: 3px 1px; | |
} | |
.prog-bar { |
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
/** | |
* push button example | |
*/ | |
body { | |
background-color: #0AE; | |
background-image: linear-gradient(45deg, rgba(255, 255, 255, .2) 50%, transparent 50%, transparent); | |
background-size: 50px 50px | |
} | |
.btn { |
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
... | |
<div id="qunit-fixture"> | |
<a href="#functional-link">#nogo</a> | |
<a href="http://alibaba.com">grunt</a> | |
<a href="http://china.alibaba.com">grunt</a> | |
<a href="http://style.china.alibaba.com">grunt</a> | |
<a href="http://q.pnq.cc">qhwa</a> | |
</div> | |
.... |
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
// file: test/grunt-demo_test.js | |
module('jQuery#ali-link', { | |
setup: function() { | |
this.elems = $('#qunit-fixture').children(); | |
} | |
}); | |
test('is chainable', 1, function() { | |
strictEqual(this.elems.alilink(), this.elems, 'should be chaninable'); | |
}); | |
test('can select', function() { |
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
// file: test/grunt-demo_test.js | |
module('jQuery#ali-link', { | |
setup: function() { | |
this.elems = $('#qunit-fixture').children(); | |
} | |
}); | |
test('is chainable', 1, function() { | |
strictEqual(this.elems.alilink(), this.elems, 'should be chaninable'); | |
}); | |
test('can select', function() { |
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
// file: src/grunt-demo-1.js | |
(function($) { | |
var ALI_LINK_REG = /^http:\/\/(.+\.)?alibaba\.com/; | |
// Collection method. | |
$.fn.alilink = function() { | |
return this.each(function() { | |
var self = $(this); | |
if( isAliLink(this) ){ | |
self.addClass('ali-link'); | |
} else { |
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
<!-- | |
这是一个来自真实项目的view模板, | |
在这里我做了一些简化后,使得阅读更加容易一些。 | |
实际环境中大约是2倍行数。 | |
程序执行时没有错误,一切正常。 | |
美中不足的是,当用户没有登录时,也会显示一个 | |
<span class="message-count"></span> 标签 | |
给用户造成有消息的错觉 |
OlderNewer