<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Leeiio Chaos Made. &#187; 設計</title>
	<atom:link href="http://leeiio.me/category/design/feed/" rel="self" type="application/rss+xml" />
	<link>http://leeiio.me</link>
	<description>The site is redesigning,please be patient  :P</description>
	<lastBuildDate>Sun, 29 Jan 2012 16:40:23 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>野比のび太あなごの頭</title>
		<link>http://leeiio.me/nobi-nobita-anago/</link>
		<comments>http://leeiio.me/nobi-nobita-anago/#comments</comments>
		<pubDate>Sun, 04 Dec 2011 10:58:10 +0000</pubDate>
		<dc:creator>Leeiio</dc:creator>
				<category><![CDATA[設計]]></category>
		<category><![CDATA[Anago]]></category>
		<category><![CDATA[野比のび太]]></category>
		<category><![CDATA[野比大雄]]></category>

		<guid isPermaLink="false">http://leeiio.me/?p=2466</guid>
		<description><![CDATA[New Nobita Anago avatar, by @iiiCyan. 最近很流行的鳗鱼头像，最早先是看到了重光同学 @lucifierya 的坂田银时的鳗鱼头像。 鳗鱼作者是 @daijingogo。以及官方出品的鳗鱼头像制作器 http://anago.crap.jp/ 另外还有One Piece的鳗鱼头像 http://youkocleo.exteen.com/ Have fun!]]></description>
			<content:encoded><![CDATA[<p><img src="http://imgs.leeiio.me/blogimgs/2011/12/DXA1B.png" alt="" title="DXA1B" width="180" height="180" class="alignnone size-full wp-image-2467" /> <img src="http://imgs.leeiio.me/blogimgs/2011/12/DXA1T.png" alt="" title="DXA1T" width="180" height="180" class="alignnone size-full wp-image-2468" /><br />
<img src="http://imgs.leeiio.me/blogimgs/2011/12/DXA2T.png" alt="" title="DXA2T" width="180" height="180" class="alignnone size-full wp-image-2469" /> <img src="http://imgs.leeiio.me/blogimgs/2011/12/DXA2B.png" alt="" title="DXA2B" width="180" height="180" class="alignnone size-full wp-image-2470" /><br />
New Nobita Anago avatar, by <a href="http://twitter.com/iiiCyan" title="iiiCyan's twitter" target="_blank">@iiiCyan</a>.</p>
<p>最近很流行的鳗鱼头像，最早先是看到了重光同学 <a href="http://twitter.com/lucifierya" target="_blank">@lucifierya</a> 的坂田银时的鳗鱼头像。<img src="http://imgs.leeiio.me/blogimgs/2011/12/gintoki.png" alt="" title="gintoki" width="180" height="180" class="alignnone size-full wp-image-2482" /></p>
<p>鳗鱼作者是 <a href="http://twitter.com/daijingogo" target="_blank">@daijingogo</a>。以及官方出品的鳗鱼头像制作器 <a href="http://anago.crap.jp/" target="_blank">http://anago.crap.jp/</a></p>
<p>另外还有One Piece的鳗鱼头像 <a href="http://youkocleo.exteen.com/" target="_blank">http://youkocleo.exteen.com/</a></p>
<p>Have fun!</p>
]]></content:encoded>
			<wfw:commentRss>http://leeiio.me/nobi-nobita-anago/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>a snippet for testing whether you could visit twtter or facebook</title>
		<link>http://leeiio.me/a-snippet-for-testing-whether-could-visit-twtter-or-facebook/</link>
		<comments>http://leeiio.me/a-snippet-for-testing-whether-could-visit-twtter-or-facebook/#comments</comments>
		<pubDate>Sun, 27 Nov 2011 16:52:20 +0000</pubDate>
		<dc:creator>Leeiio</dc:creator>
				<category><![CDATA[JS/Ajax/AS/Flex]]></category>
		<category><![CDATA[Facebook]]></category>
		<category><![CDATA[Twitter]]></category>

		<guid isPermaLink="false">http://leeiio.me/?p=2429</guid>
		<description><![CDATA[Some of you guys like add &#8220;Twitter button&#8221; or &#8220;Facebook Like button&#8221; on your website. But if your visitor from china that don&#8217;t use VPN or anyother jailbreak the G-F-W tools, it will slow down the page load until the &#8230; <a href="http://leeiio.me/a-snippet-for-testing-whether-could-visit-twtter-or-facebook/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Some of you guys like add &#8220;<strong>Twitter button</strong>&#8221; or &#8220;<strong>Facebook Like button</strong>&#8221; on your website. But if your visitor from china that don&#8217;t use VPN or anyother jailbreak the G-F-W tools, it will slow down the page load until the browser&#8217;s default timeout time &#8220;60s&#8221;.<br />
So i wrote this code snippet,now you can use this code snippet to test whether they could visit the Twitter or Facebook, if could then load the &#8220;Twitter button&#8221; or &#8220;Facebook Like button&#8221; scripts.</p>
<p>Enjoy it!</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #003366; font-weight: bold;">var</span> Leeiio <span style="color: #339933;">=</span> <span style="color: #009900;">&#123;</span><span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span>
Leeiio.<span style="color: #660066;">isFucked</span><span style="color: #339933;">;</span>
&nbsp;
Leeiio.<span style="color: #660066;">fuck</span> <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
    <span style="color: #003366; font-weight: bold;">var</span> imgUrl <span style="color: #339933;">=</span> <span style="color: #3366CC;">&quot;http://twitter.com/favicon.ico?&quot;</span><span style="color: #339933;">;</span> <span style="color: #006600; font-style: italic;">//You can change it to &quot;http://www.facebook.com/favicon.ico?&quot;</span>
    imgUrl <span style="color: #339933;">+=</span> <span style="color: #003366; font-weight: bold;">new</span> Date<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">getTime</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #006600; font-style: italic;">//add Time stamp to prevent the Browser's cache</span>
    <span style="color: #003366; font-weight: bold;">function</span> removeElement<span style="color: #009900;">&#40;</span>_element<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
         <span style="color: #003366; font-weight: bold;">var</span> _parentElement <span style="color: #339933;">=</span> _element.<span style="color: #660066;">parentNode</span><span style="color: #339933;">;</span>
         <span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>_parentElement<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
                _parentElement.<span style="color: #660066;">removeChild</span><span style="color: #009900;">&#40;</span>_element<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
         <span style="color: #009900;">&#125;</span>
    <span style="color: #009900;">&#125;</span>
    <span style="color: #003366; font-weight: bold;">function</span> testImg<span style="color: #009900;">&#40;</span>isrc<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
        <span style="color: #003366; font-weight: bold;">var</span> fuckimg <span style="color: #339933;">=</span> document.<span style="color: #660066;">createElement</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'iframe'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #006600; font-style: italic;">//I used to createElement('img') but it have some problem in webkit</span>
        fuckimg.<span style="color: #660066;">src</span> <span style="color: #339933;">=</span> imgUrl<span style="color: #339933;">;</span>
        fuckimg.<span style="color: #660066;">style</span>.<span style="color: #660066;">cssText</span> <span style="color: #339933;">=</span> <span style="color: #3366CC;">&quot;display:none&quot;</span><span style="color: #339933;">;</span>
        document.<span style="color: #660066;">body</span>.<span style="color: #660066;">appendChild</span><span style="color: #009900;">&#40;</span>fuckimg<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        fuckimg.<span style="color: #660066;">timer</span> <span style="color: #339933;">=</span> setTimeout<span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
            <span style="color: #000066;">alert</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;Fuck it!(You know fuck what right?)&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            fuckimg.<span style="color: #660066;">src</span> <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">null</span><span style="color: #339933;">;</span>
            fuckimg.<span style="color: #000066;">onload</span> <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">null</span><span style="color: #339933;">;</span>
            removeElement<span style="color: #009900;">&#40;</span>fuckimg<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            Leeiio.<span style="color: #660066;">isFucked</span> <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">true</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">3290</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>   <span style="color: #006600; font-style: italic;">//set timeout to connect to twitter</span>
        fuckimg.<span style="color: #000066;">onload</span> <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">function</span> <span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
            clearTimeout<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">timer</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            <span style="color: #000066;">alert</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;Nice!You are free man!&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            fuckimg.<span style="color: #660066;">src</span> <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">null</span><span style="color: #339933;">;</span>
            fuckimg.<span style="color: #000066;">onload</span> <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">null</span><span style="color: #339933;">;</span>
            removeElement<span style="color: #009900;">&#40;</span>fuckimg<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            Leeiio.<span style="color: #660066;">isFucked</span> <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">false</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
    <span style="color: #009900;">&#125;</span>
    testImg<span style="color: #009900;">&#40;</span>imgUrl<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
Leeiio.<span style="color: #660066;">fuck</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #003366; font-weight: bold;">var</span> timeTest <span style="color: #339933;">=</span> setTimeout<span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
    <span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span>Leeiio.<span style="color: #660066;">isFucked</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
        <span style="color: #006600; font-style: italic;">//add your code here that you want to</span>
        <span style="color: #000066;">alert</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'Fuck!'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
    clearTimeout<span style="color: #009900;">&#40;</span>timeTest<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span><span style="color: #CC0000;">4000</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>See Demo here:<a href="http://leeiio.me/demo/fuck_yeah.html" target="_blank">http://leeiio.me/demo/fuck_yeah.html</a></p>
]]></content:encoded>
			<wfw:commentRss>http://leeiio.me/a-snippet-for-testing-whether-could-visit-twtter-or-facebook/feed/</wfw:commentRss>
		<slash:comments>13</slash:comments>
		</item>
		<item>
		<title>匹配一段文本中URL的正则问题</title>
		<link>http://leeiio.me/url-in-text-regexp/</link>
		<comments>http://leeiio.me/url-in-text-regexp/#comments</comments>
		<pubDate>Wed, 25 May 2011 15:42:56 +0000</pubDate>
		<dc:creator>Leeiio</dc:creator>
				<category><![CDATA[JS/Ajax/AS/Flex]]></category>

		<guid isPermaLink="false">http://leeiio.me/?p=2336</guid>
		<description><![CDATA[在项目中有个这样的设计，备注中的URL自动识别为点击的链接，对此的处理方式是用正则匹配出URL部分，然后替换成&#60;a href=URL>URL这样即可。其主要部分是正则匹配出URL部分。 假设有这么一段文本。 你好，我是一段文本。我链接到http://leeiio.me/test.html请大家多多指教。 那么我们可以这么写。 var text = &#34;你好，我是一段文本。我链接到http://leeiio.me/test.html请大家多多指教。&#34;; var regexp = /((http&#124;ftp&#124;https&#124;file):\/\/([\w\-]+\.)+[\w\-]+(\/[\w\-\.\/?\@\%\!\&#38;=\+\~\:\#\;\,]*)?)/ig; text = text.replace&#40;regexp,&#34;&#60;a href='$1'&#62;$1&#60;/a&#62;&#34;&#41;; console.log&#40;text&#41;; 但是如果URL中带有中文，那么以上的就不顶事了。 虽然我们不应该用中文作为URL的一部分，已经把中文部分encode掉，但是很多人比如粗心的写wordpressd的人，通常不指定Slug，那么很多URL自然也就带上了标题的中文了。比如： 假设有这么一段文本。 你好，我是一段文本。我链接到http://leeiio.me/这是一篇测试.html 请大家多多指教。 那么应该把正则改成这样 var text = &#34;你好，我是一段文本。我链接到http://leeiio.me/这是一篇测试.html 请大家多多指教。&#34;; var regexp = /((http&#124;ftp&#124;https&#124;file):\/\/([\w\-]+\.)+[\w\-]+(\/[\w\u4e00-\u9fa5\-\.\/?\@\%\!\&#38;=\+\~\:\#\;\,]*)?)/ig; text = text.replace&#40;regexp,&#34;&#60;a href='$1'&#62;$1&#60;/a&#62;&#34;&#41;; console.log&#40;text&#41;; 不过如果以上这段文本在&#8221;html&#8221;和&#8221;请&#8221;字中间没有空格的话，也会错误地把后面的&#8221;请大家多多指教。&#8221;识别为URL的一部分，所以说也并不是十分完美。而且如果标题是汉文呢？日文呢？就不行了，因为刚才正则中增加的\u4e00-\u9fa5只是中文的编码区间。 既然如此我们就使用更加暴力的正则吧。比如这么一段文本： &#8230; <a href="http://leeiio.me/url-in-text-regexp/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>在项目中有个这样的设计，备注中的URL自动识别为点击的链接，对此的处理方式是用正则匹配出URL部分，然后替换成&lt;a href=URL>URL</a>这样即可。其主要部分是正则匹配出URL部分。</p>
<p>假设有这么一段文本。</p>
<blockquote><p>
你好，我是一段文本。我链接到http://leeiio.me/test.html请大家多多指教。
</p></blockquote>
<p>那么我们可以这么写。</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #003366; font-weight: bold;">var</span> text <span style="color: #339933;">=</span> <span style="color: #3366CC;">&quot;你好，我是一段文本。我链接到http://leeiio.me/test.html请大家多多指教。&quot;</span><span style="color: #339933;">;</span>
<span style="color: #003366; font-weight: bold;">var</span> regexp <span style="color: #339933;">=</span> <span style="color: #009966; font-style: italic;">/((http|ftp|https|file):\/\/([\w\-]+\.)+[\w\-]+(\/[\w\-\.\/?\@\%\!\&amp;=\+\~\:\#\;\,]*)?)/ig</span><span style="color: #339933;">;</span>
text <span style="color: #339933;">=</span> text.<span style="color: #660066;">replace</span><span style="color: #009900;">&#40;</span>regexp<span style="color: #339933;">,</span><span style="color: #3366CC;">&quot;&lt;a href='$1'&gt;$1&lt;/a&gt;&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
console.<span style="color: #660066;">log</span><span style="color: #009900;">&#40;</span>text<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>但是如果URL中带有中文，那么以上的就不顶事了。<br />
<span id="more-2336"></span><br />
虽然我们不应该用中文作为URL的一部分，已经把中文部分encode掉，但是很多人比如粗心的写wordpressd的人，通常不指定Slug，那么很多URL自然也就带上了标题的中文了。比如：</p>
<p>假设有这么一段文本。</p>
<blockquote><p>
你好，我是一段文本。我链接到http://leeiio.me/这是一篇测试.html 请大家多多指教。
</p></blockquote>
<p>那么应该把正则改成这样</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #003366; font-weight: bold;">var</span> text <span style="color: #339933;">=</span> <span style="color: #3366CC;">&quot;你好，我是一段文本。我链接到http://leeiio.me/这是一篇测试.html 请大家多多指教。&quot;</span><span style="color: #339933;">;</span>
<span style="color: #003366; font-weight: bold;">var</span> regexp <span style="color: #339933;">=</span> <span style="color: #009966; font-style: italic;">/((http|ftp|https|file):\/\/([\w\-]+\.)+[\w\-]+(\/[\w\u4e00-\u9fa5\-\.\/?\@\%\!\&amp;=\+\~\:\#\;\,]*)?)/ig</span><span style="color: #339933;">;</span>
text <span style="color: #339933;">=</span> text.<span style="color: #660066;">replace</span><span style="color: #009900;">&#40;</span>regexp<span style="color: #339933;">,</span><span style="color: #3366CC;">&quot;&lt;a href='$1'&gt;$1&lt;/a&gt;&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
console.<span style="color: #660066;">log</span><span style="color: #009900;">&#40;</span>text<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>不过如果以上这段文本在&#8221;html&#8221;和&#8221;请&#8221;字中间没有空格的话，也会错误地把后面的&#8221;请大家多多指教。&#8221;识别为URL的一部分，所以说也并不是十分完美。而且如果标题是汉文呢？日文呢？就不行了，因为刚才正则中增加的\u4e00-\u9fa5只是中文的编码区间。</p>
<p>既然如此我们就使用更加暴力的正则吧。比如这么一段文本：</p>
<blockquote><p>
你好，我是一段文本。我链接到http://leeiio.me/这是一篇测试.html 请大家多多指教。<br />
こんにちは、私はテキストをしています。私はこれはテストですhttp://leeiio.me/にリンクしています.Html のは、展覧会をしてください。<br />
안녕, 난 텍스트입니다. 나는 이것은 테스트입니다 http://leeiio.me/에연결할수있습니다.HTML 을 전시주세요.
</p></blockquote>
<p>对应的正则匹配换成这种</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #003366; font-weight: bold;">var</span> text <span style="color: #339933;">=</span> <span style="color: #3366CC;">&quot;你好，我是一段文本。我链接到http://leeiio.me/这是一篇测试.html 请大家多多指教。こんにちは、私はテキストをしています。私はこれはテストですhttp://leeiio.me/にリンクしています.Html のは、展覧会をしてください。안녕, 난 텍스트입니다. 나는 이것은 테스트입니다 http://leeiio.me/에연결할수있습니다.HTML 을 전시주세요.&quot;</span><span style="color: #339933;">;</span>
<span style="color: #003366; font-weight: bold;">var</span> regexp <span style="color: #339933;">=</span> <span style="color: #009966; font-style: italic;">/((http|ftp|https|file):[^'&quot;\s]+)/ig</span><span style="color: #339933;">;</span>
text <span style="color: #339933;">=</span> text.<span style="color: #660066;">replace</span><span style="color: #009900;">&#40;</span>regexp<span style="color: #339933;">,</span><span style="color: #3366CC;">&quot;&lt;a href='$1'&gt;$1&lt;/a&gt;&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
console.<span style="color: #660066;">log</span><span style="color: #009900;">&#40;</span>text<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>最终的匹配结果是：</p>
<blockquote><p>
你好，我是一段文本。我链 接到&lt;a href=&#8217;http://leeiio.me/这是一篇测试.html&#8217;>http://leeiio.me/这是一篇测试.html< /a> 请大家多多指教。こんにちは、私はテキストをしています。私はこれはテストです&lt;a href=&#8217;http://leeiio.me/にリンクしています.Html&#8217;>http://leeiio.me/にリンクしていま す.Html</a> のは、展覧会をしてください。안녕, 난 텍스트입니다. 나는 이것은 테스트입니다 &lt;a href=&#8217;http://leeiio.me/에연결할수있습니다.HTML&#8217;>http://leeiio.me/에연결할수있습니 다.HTML</a> 을 전시주세요.
</p></blockquote>
<p>当然同上，网址和文字之间得用空格隔开，不然还是会把后面的文字部分也识别为URL的一部分。对于英文文本就显得很有用了，因为英文单词之间肯定都是会用空格隔开的麽。所以也希望大家养成好习惯，在一段文本中URL部分和文本之间用空格隔开。</p>
<p>PS:识别一个邮件地址变成<a href='mailto:email'>email</a>则可以这么干</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #003366; font-weight: bold;">var</span> text <span style="color: #339933;">=</span> <span style="color: #3366CC;">&quot;你好，我是一段文本。我的email地址：test@test.com&quot;</span><span style="color: #339933;">;</span>
<span style="color: #003366; font-weight: bold;">var</span> regexp <span style="color: #339933;">=</span> <span style="color: #009966; font-style: italic;">/[a-z0-9_\-+=.]+@[a-z0-9\-]+(\.[a-z0-9-]+)+/ig</span><span style="color: #339933;">;</span>
text <span style="color: #339933;">=</span> text.<span style="color: #660066;">replace</span><span style="color: #009900;">&#40;</span>regexp<span style="color: #339933;">,</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>h<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span><span style="color: #000066; font-weight: bold;">return</span><span style="color: #3366CC;">&quot;&lt;a href='mailto:&quot;</span><span style="color: #339933;">+</span>h<span style="color: #339933;">+</span><span style="color: #3366CC;">&quot;'&gt;&quot;</span><span style="color: #339933;">+</span>h<span style="color: #339933;">+</span><span style="color: #3366CC;">&quot;&lt;/a&gt;&quot;</span><span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
console.<span style="color: #660066;">log</span><span style="color: #009900;">&#40;</span>text<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>大家的意见以及建议呢？</p>
]]></content:encoded>
			<wfw:commentRss>http://leeiio.me/url-in-text-regexp/feed/</wfw:commentRss>
		<slash:comments>12</slash:comments>
		</item>
		<item>
		<title>The Difference Between jQuery’s .bind(), .live(), and .delegate()</title>
		<link>http://leeiio.me/the-difference-between-jquerys-bind-live-and-delegate/</link>
		<comments>http://leeiio.me/the-difference-between-jquerys-bind-live-and-delegate/#comments</comments>
		<pubDate>Mon, 16 May 2011 14:37:00 +0000</pubDate>
		<dc:creator>Leeiio</dc:creator>
				<category><![CDATA[JS/Ajax/AS/Flex]]></category>
		<category><![CDATA[bind()]]></category>
		<category><![CDATA[delegate()]]></category>
		<category><![CDATA[jQuery]]></category>

		<guid isPermaLink="false">http://leeiio.me/the-difference-between-jquery%e2%80%99s-bind-live-and-delegate/</guid>
		<description><![CDATA[西方不够好的朋友可以看这篇译文《jQuery的.bind()、.live()和.delegate()之间的区别》。这篇文章详细的比较了bind()，live()以及delegate()的区别。以及作者为什么推荐用delegate()。]]></description>
			<content:encoded><![CDATA[<p>西方不够好的朋友可以看这篇译文《<a href="http://article.yeeyan.org/view/213582/179910" title="jQuery的.bind()、.live()和.delegate()之间的区别" target="_blank">jQuery的.bind()、.live()和.delegate()之间的区别</a>》。这篇文章详细的比较了bind()，live()以及delegate()的区别。以及作者为什么推荐用delegate()。</p>
]]></content:encoded>
			<wfw:commentRss>http://leeiio.me/the-difference-between-jquerys-bind-live-and-delegate/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>2011 年 CSS 裸奔节 ！</title>
		<link>http://leeiio.me/2011-css-naked-day/</link>
		<comments>http://leeiio.me/2011-css-naked-day/#comments</comments>
		<pubDate>Fri, 08 Apr 2011 16:09:41 +0000</pubDate>
		<dc:creator>Leeiio</dc:creator>
				<category><![CDATA[(X)HTML/CSS/XML/XSL]]></category>
		<category><![CDATA[CSS 裸奔节]]></category>
		<category><![CDATA[CSS Naked Day]]></category>

		<guid isPermaLink="false">http://leeiio.me/?p=2328</guid>
		<description><![CDATA[由Dustin Diaz推动的CSS NAKED DAY今年还是没有按时举行，在其网站上也还是没有贴出任何的今年的时间，但是推动Web标准发展应该是每位业界人士的一份责任，因此世界各地的人都延续传统，和去年一样是4月9日，大家都纷纷脱去了自己网站的衣服(CSS)，裸奔。 具体细节大家可以查看我去年的文章《拥抱 CSS 裸奔节，用 JavaScript 强制脱衣》。当然方法有很多，你想怎么裸就怎么裸。]]></description>
			<content:encoded><![CDATA[<p><img src="http://imgs.leeiio.me/blogimgs/2009/04/20090409_cssnake.jpg" alt="2011 年 CSS 裸奔节" /><br />
由<a href="http://naked.dustindiaz.com/" rel="nofollow">Dustin Diaz</a>推动的CSS NAKED DAY今年还是没有按时举行，在其网站上也还是没有贴出任何的今年的时间，但是推动Web标准发展应该是每位业界人士的一份责任，因此世界各地的人都延续传统，和去年一样是4月9日，大家都纷纷脱去了自己网站的衣服(CSS)，裸奔。</p>
<p>具体细节大家可以查看我去年的文章<a href="http://leeiio.me/force-remove-css-in-css-nake-day/">《拥抱 CSS 裸奔节，用 JavaScript 强制脱衣》</a>。当然方法有很多，你想怎么裸就怎么裸。</p>
]]></content:encoded>
			<wfw:commentRss>http://leeiio.me/2011-css-naked-day/feed/</wfw:commentRss>
		<slash:comments>17</slash:comments>
		</item>
		<item>
		<title>Bookmarklet &#8220;PrintDo&#8221; &#8211; 打印你的Doit.im任务！</title>
		<link>http://leeiio.me/print-your-doitim-tasks/</link>
		<comments>http://leeiio.me/print-your-doitim-tasks/#comments</comments>
		<pubDate>Thu, 03 Mar 2011 13:47:09 +0000</pubDate>
		<dc:creator>Leeiio</dc:creator>
				<category><![CDATA[My Works]]></category>
		<category><![CDATA[混合，雜亂無章。]]></category>
		<category><![CDATA[Doit.im]]></category>
		<category><![CDATA[GTD]]></category>
		<category><![CDATA[PrintDo]]></category>

		<guid isPermaLink="false">http://leeiio.me/?p=2251</guid>
		<description><![CDATA[Doit.im是一个提供个人时间管理(GTD)的服务。如果你正在用的话，那么以下的内容可能会对你有所帮助！ 传统的个人时间管理有很多方法，比如记录在笔记本上，相信喜欢纸质的童鞋们都很乐意这么去做，以至于网上还有在售卖Todo记事本。如果你是纸质控刚接触Doit.im，你可能还比较喜欢把任务记录在纸上，于是这个应用就应运而生了。把任务打印到纸上，然后贴在你的桌子上，既方便查看又便于你的保存收集，当然，这个做法不低碳，环保主义者慎用！ 如果有什么bug，请反馈给我，谢谢！ 2011.12.02:更新支持最新版的Doit.im任务打印功能。 具体点击以下页面进行查看吧。]]></description>
			<content:encoded><![CDATA[<p><img src="http://imgs.leeiio.me/blogimgs/2011/03/20110303_printdo.png" alt="Bookmarklet "PrintDo" - 打印你的Doit.im任务！" /><br />
<a href="http://doit.im">Doit.im</a>是一个提供个人时间管理(GTD)的服务。如果你正在用的话，那么以下的内容可能会对你有所帮助！<br />
传统的个人时间管理有很多方法，比如记录在笔记本上，相信喜欢纸质的童鞋们都很乐意这么去做，以至于网上还有在售卖Todo记事本。如果你是纸质控刚接触Doit.im，你可能还比较喜欢把任务记录在纸上，于是这个应用就应运而生了。把任务打印到纸上，然后贴在你的桌子上，既方便查看又便于你的保存收集，当然，这个做法不低碳，环保主义者慎用！</p>
<p>如果有什么bug，请反馈给我，谢谢！</p>
<p>2011.12.02:更新支持最新版的Doit.im任务打印功能。<br />
<span id="more-2251"></span><br />
具体点击以下页面进行查看吧。<br />
<p class="preview left"><a href="http://lab.leeiio.me/printdo/" title="点击访问 PrintDo!">PrintDo!
<em title="Print your tasks!基于Doit.im的任务打印！">Just click it!</em></a></p><br />
<p class="clear"></p></p>
]]></content:encoded>
			<wfw:commentRss>http://leeiio.me/print-your-doitim-tasks/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>书写整洁优雅的CSS3代码</title>
		<link>http://leeiio.me/writing-clean-css3-code/</link>
		<comments>http://leeiio.me/writing-clean-css3-code/#comments</comments>
		<pubDate>Sun, 20 Feb 2011 09:29:14 +0000</pubDate>
		<dc:creator>Leeiio</dc:creator>
				<category><![CDATA[(X)HTML/CSS/XML/XSL]]></category>
		<category><![CDATA[clean-css3]]></category>
		<category><![CDATA[css3]]></category>
		<category><![CDATA[css3-order]]></category>

		<guid isPermaLink="false">http://leeiio.me/?p=2226</guid>
		<description><![CDATA[CSS3已经开始被大家广泛的运用到产品中的页面代码中去，CSS3带来的革新式的变化我在这里就不一一细说了。不过因为目前的CSS3还处在草案阶段，所以绝大部分的浏览器(除了opera应该是)都是使用的私有属性的方式来实现对CSS3的支持。比如firefox的-moz-前缀和webkit核心浏览器的-webkit-前缀等。 整洁优雅的代码能提高生产效率，特别是在团队合作中。我想很多人都习惯把css代码写成一行的形式，诸如这样： .main&#123;width:960px;margin:0 auto;&#125; .sidebar&#123;width:233px;float:left;&#125; .sidebar ul li&#123;float:left&#125; 采用这样的一行形式，能让你们整齐的排列相似父辈继承的样式，让他们很简单的能被查找到。当然为了更好的查找到代码，你们可能还需要一个注释。 /* something u want to say --------------------------------------------------*/ .main&#123;width:960px;margin:0 auto;&#125; .sidebar&#123;width:233px;float:left;&#125; .sidebar ul li&#123;float:left&#125; 然后这时候我们想给sidebar加一个5像素的圆角，于是 /* sidebar border-radius {3px} --------------------------------------------------*/ .main&#123;width:960px;margin:0 auto;&#125; .sidebar&#123;width:233px;float:left;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;&#125; .sidebar ul li&#123;float:left&#125; 这样你可能还不会觉得有什么，因为只是加了border-radius，如果我们继续加个box-shadow呢？ /* sidebar border-radius {3px} --------------------------------------------------*/ &#8230; <a href="http://leeiio.me/writing-clean-css3-code/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>CSS3已经开始被大家广泛的运用到产品中的页面代码中去，CSS3带来的革新式的变化我在这里就不一一细说了。不过因为目前的CSS3还处在草案阶段，所以绝大部分的浏览器(除了opera应该是)都是使用的私有属性的方式来实现对CSS3的支持。比如firefox的-moz-前缀和webkit核心浏览器的-webkit-前缀等。</p>
<p>整洁优雅的代码能提高生产效率，特别是在团队合作中。我想很多人都习惯把css代码写成一行的形式，诸如这样：</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;"><span style="color: #6666ff;">.main</span><span style="color: #00AA00;">&#123;</span><span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span><span style="color: #933;">960px</span><span style="color: #00AA00;">;</span>margin<span style="color: #00AA00;">:</span><span style="color: #cc66cc;">0</span> <span style="color: #993333;">auto</span><span style="color: #00AA00;">;</span><span style="color: #00AA00;">&#125;</span>
<span style="color: #6666ff;">.sidebar</span><span style="color: #00AA00;">&#123;</span><span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span><span style="color: #933;">233px</span><span style="color: #00AA00;">;</span>float<span style="color: #00AA00;">:</span><span style="color: #000000; font-weight: bold;">left</span><span style="color: #00AA00;">;</span><span style="color: #00AA00;">&#125;</span>
<span style="color: #6666ff;">.sidebar</span> ul li<span style="color: #00AA00;">&#123;</span><span style="color: #000000; font-weight: bold;">float</span><span style="color: #00AA00;">:</span><span style="color: #000000; font-weight: bold;">left</span><span style="color: #00AA00;">&#125;</span></pre></div></div>

<p>采用这样的一行形式，能让你们整齐的排列相似父辈继承的样式，让他们很简单的能被查找到。当然为了更好的查找到代码，你们可能还需要一个注释。</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;"><span style="color: #808080; font-style: italic;">/*
something u want to say --------------------------------------------------*/</span>
<span style="color: #6666ff;">.main</span><span style="color: #00AA00;">&#123;</span><span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span><span style="color: #933;">960px</span><span style="color: #00AA00;">;</span>margin<span style="color: #00AA00;">:</span><span style="color: #cc66cc;">0</span> <span style="color: #993333;">auto</span><span style="color: #00AA00;">;</span><span style="color: #00AA00;">&#125;</span>
<span style="color: #6666ff;">.sidebar</span><span style="color: #00AA00;">&#123;</span><span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span><span style="color: #933;">233px</span><span style="color: #00AA00;">;</span>float<span style="color: #00AA00;">:</span><span style="color: #000000; font-weight: bold;">left</span><span style="color: #00AA00;">;</span><span style="color: #00AA00;">&#125;</span>
<span style="color: #6666ff;">.sidebar</span> ul li<span style="color: #00AA00;">&#123;</span><span style="color: #000000; font-weight: bold;">float</span><span style="color: #00AA00;">:</span><span style="color: #000000; font-weight: bold;">left</span><span style="color: #00AA00;">&#125;</span></pre></div></div>

<p><span id="more-2226"></span><br />
然后这时候我们想给sidebar加一个5像素的圆角，于是</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;"><span style="color: #808080; font-style: italic;">/*
sidebar border-radius {3px} --------------------------------------------------*/</span>
<span style="color: #6666ff;">.main</span><span style="color: #00AA00;">&#123;</span><span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span><span style="color: #933;">960px</span><span style="color: #00AA00;">;</span>margin<span style="color: #00AA00;">:</span><span style="color: #cc66cc;">0</span> <span style="color: #993333;">auto</span><span style="color: #00AA00;">;</span><span style="color: #00AA00;">&#125;</span>
<span style="color: #6666ff;">.sidebar</span><span style="color: #00AA00;">&#123;</span><span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span><span style="color: #933;">233px</span><span style="color: #00AA00;">;</span>float<span style="color: #00AA00;">:</span><span style="color: #000000; font-weight: bold;">left</span><span style="color: #00AA00;">;</span>border-radius<span style="color: #00AA00;">:</span><span style="color: #933;">3px</span><span style="color: #00AA00;">;</span>-moz-border-radius<span style="color: #00AA00;">:</span><span style="color: #933;">3px</span><span style="color: #00AA00;">;</span>-webkit-border-radius<span style="color: #00AA00;">:</span><span style="color: #933;">3px</span><span style="color: #00AA00;">;</span><span style="color: #00AA00;">&#125;</span>
<span style="color: #6666ff;">.sidebar</span> ul li<span style="color: #00AA00;">&#123;</span><span style="color: #000000; font-weight: bold;">float</span><span style="color: #00AA00;">:</span><span style="color: #000000; font-weight: bold;">left</span><span style="color: #00AA00;">&#125;</span></pre></div></div>

<p>这样你可能还不会觉得有什么，因为只是加了border-radius，如果我们继续加个box-shadow呢？</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;"><span style="color: #808080; font-style: italic;">/*
sidebar border-radius {3px} --------------------------------------------------*/</span>
<span style="color: #6666ff;">.main</span><span style="color: #00AA00;">&#123;</span><span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span><span style="color: #933;">960px</span><span style="color: #00AA00;">;</span>margin<span style="color: #00AA00;">:</span><span style="color: #cc66cc;">0</span> <span style="color: #993333;">auto</span><span style="color: #00AA00;">;</span><span style="color: #00AA00;">&#125;</span>
<span style="color: #6666ff;">.sidebar</span><span style="color: #00AA00;">&#123;</span><span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span><span style="color: #933;">233px</span><span style="color: #00AA00;">;</span>float<span style="color: #00AA00;">:</span><span style="color: #000000; font-weight: bold;">left</span><span style="color: #00AA00;">;</span>border-radius<span style="color: #00AA00;">:</span><span style="color: #933;">3px</span><span style="color: #00AA00;">;</span>-moz-border-radius<span style="color: #00AA00;">:</span><span style="color: #933;">3px</span><span style="color: #00AA00;">;</span>-webkit-border-radius<span style="color: #00AA00;">:</span><span style="color: #933;">3px</span><span style="color: #00AA00;">;</span>box-shadow<span style="color: #00AA00;">:</span><span style="color: #933;">1px</span> <span style="color: #933;">1px</span> <span style="color: #933;">5px</span> <span style="color: #cc00cc;">#rgba</span><span style="color: #00AA00;">&#40;</span><span style="color: #cc66cc;">0</span><span style="color: #00AA00;">,</span><span style="color: #cc66cc;">0</span><span style="color: #00AA00;">,</span><span style="color: #cc66cc;">0</span><span style="color: #00AA00;">,</span><span style="color: #cc66cc;">0.1</span><span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">;</span>-moz-box-shadow<span style="color: #00AA00;">:</span><span style="color: #933;">1px</span> <span style="color: #933;">1px</span> <span style="color: #933;">5px</span> <span style="color: #cc00cc;">#rgba</span><span style="color: #00AA00;">&#40;</span><span style="color: #cc66cc;">0</span><span style="color: #00AA00;">,</span><span style="color: #cc66cc;">0</span><span style="color: #00AA00;">,</span><span style="color: #cc66cc;">0</span><span style="color: #00AA00;">,</span><span style="color: #cc66cc;">0.1</span><span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">;</span>-webkit-box-shadow<span style="color: #00AA00;">:</span><span style="color: #933;">1px</span> <span style="color: #933;">1px</span> <span style="color: #933;">5px</span> <span style="color: #cc00cc;">#rgba</span><span style="color: #00AA00;">&#40;</span><span style="color: #cc66cc;">0</span><span style="color: #00AA00;">,</span><span style="color: #cc66cc;">0</span><span style="color: #00AA00;">,</span><span style="color: #cc66cc;">0</span><span style="color: #00AA00;">,</span><span style="color: #cc66cc;">0.1</span><span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">;</span><span style="color: #00AA00;">&#125;</span>
<span style="color: #6666ff;">.sidebar</span> ul li<span style="color: #00AA00;">&#123;</span><span style="color: #000000; font-weight: bold;">float</span><span style="color: #00AA00;">:</span><span style="color: #000000; font-weight: bold;">left</span><span style="color: #00AA00;">&#125;</span></pre></div></div>

<p>是不是看起来挺崩溃的，这不是坑爹么&#8230;sidebar的样式看起来糊成一团了，这些css3代码和普通的css代码混在一起十分难受&#8230;</p>
<p>于是这样同样有代码洁癖的<a rel="external nofolow" href="http://inspectelement.com/articles/writing-clean-css3-code/">老外童鞋</a>给出了一种他的解决方案，请看</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;"><span style="color: #808080; font-style: italic;">/*
sidebar border-radius {3px} --------------------------------------------------*/</span>
<span style="color: #6666ff;">.main</span><span style="color: #00AA00;">&#123;</span><span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span><span style="color: #933;">960px</span><span style="color: #00AA00;">;</span>margin<span style="color: #00AA00;">:</span><span style="color: #cc66cc;">0</span> <span style="color: #993333;">auto</span><span style="color: #00AA00;">;</span><span style="color: #00AA00;">&#125;</span>
<span style="color: #6666ff;">.sidebar</span><span style="color: #00AA00;">&#123;</span><span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span><span style="color: #933;">233px</span><span style="color: #00AA00;">;</span>float<span style="color: #00AA00;">:</span><span style="color: #000000; font-weight: bold;">left</span><span style="color: #00AA00;">;</span>
	border-radius<span style="color: #00AA00;">:</span><span style="color: #933;">3px</span><span style="color: #00AA00;">;</span>
	-moz-border-radius<span style="color: #00AA00;">:</span><span style="color: #933;">3px</span><span style="color: #00AA00;">;</span>
	-webkit-border-radius<span style="color: #00AA00;">:</span><span style="color: #933;">3px</span><span style="color: #00AA00;">;</span>
	box-shadow<span style="color: #00AA00;">:</span><span style="color: #933;">1px</span> <span style="color: #933;">1px</span> <span style="color: #933;">5px</span> <span style="color: #cc00cc;">#rgba</span><span style="color: #00AA00;">&#40;</span><span style="color: #cc66cc;">0</span><span style="color: #00AA00;">,</span><span style="color: #cc66cc;">0</span><span style="color: #00AA00;">,</span><span style="color: #cc66cc;">0</span><span style="color: #00AA00;">,</span><span style="color: #cc66cc;">0.1</span><span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">;</span>
	-moz-box-shadow<span style="color: #00AA00;">:</span><span style="color: #933;">1px</span> <span style="color: #933;">1px</span> <span style="color: #933;">5px</span> <span style="color: #cc00cc;">#rgba</span><span style="color: #00AA00;">&#40;</span><span style="color: #cc66cc;">0</span><span style="color: #00AA00;">,</span><span style="color: #cc66cc;">0</span><span style="color: #00AA00;">,</span><span style="color: #cc66cc;">0</span><span style="color: #00AA00;">,</span><span style="color: #cc66cc;">0.1</span><span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">;</span>
	-webkit-box-shadow<span style="color: #00AA00;">:</span><span style="color: #933;">1px</span> <span style="color: #933;">1px</span> <span style="color: #933;">5px</span> <span style="color: #cc00cc;">#rgba</span><span style="color: #00AA00;">&#40;</span><span style="color: #cc66cc;">0</span><span style="color: #00AA00;">,</span><span style="color: #cc66cc;">0</span><span style="color: #00AA00;">,</span><span style="color: #cc66cc;">0</span><span style="color: #00AA00;">,</span><span style="color: #cc66cc;">0.1</span><span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
<span style="color: #6666ff;">.sidebar</span> ul li<span style="color: #00AA00;">&#123;</span><span style="color: #000000; font-weight: bold;">float</span><span style="color: #00AA00;">:</span><span style="color: #000000; font-weight: bold;">left</span><span style="color: #00AA00;">&#125;</span></pre></div></div>

<p>这样来区分开css3代码是不是整洁多了！</p>
<p>引申话题，该同学blog底部还就css3的样式顺序发表了观点，到底是私有属性-moz-border-radius放前面还是标准的border-radius放前面，这里有一篇来自CSS3-TRICKS的<a href="http://css-tricks.com/ordering-css3-properties/">《Ordering CSS3 Properties》</a>阐述了为什么私有属性要放在标准的前面，把标准的放在最底下。</p>
<p>那么最终的代码就是这个样子的</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;"><span style="color: #808080; font-style: italic;">/*
sidebar border-radius {3px} --------------------------------------------------*/</span>
<span style="color: #6666ff;">.main</span><span style="color: #00AA00;">&#123;</span><span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span><span style="color: #933;">960px</span><span style="color: #00AA00;">;</span>margin<span style="color: #00AA00;">:</span><span style="color: #cc66cc;">0</span> <span style="color: #993333;">auto</span><span style="color: #00AA00;">;</span><span style="color: #00AA00;">&#125;</span>
<span style="color: #6666ff;">.sidebar</span><span style="color: #00AA00;">&#123;</span><span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span><span style="color: #933;">233px</span><span style="color: #00AA00;">;</span>float<span style="color: #00AA00;">:</span><span style="color: #000000; font-weight: bold;">left</span><span style="color: #00AA00;">;</span>
	-moz-border-radius<span style="color: #00AA00;">:</span><span style="color: #933;">3px</span><span style="color: #00AA00;">;</span>
	-webkit-border-radius<span style="color: #00AA00;">:</span><span style="color: #933;">3px</span><span style="color: #00AA00;">;</span>
	border-radius<span style="color: #00AA00;">:</span><span style="color: #933;">3px</span><span style="color: #00AA00;">;</span>
	-moz-box-shadow<span style="color: #00AA00;">:</span><span style="color: #933;">1px</span> <span style="color: #933;">1px</span> <span style="color: #933;">5px</span> <span style="color: #cc00cc;">#rgba</span><span style="color: #00AA00;">&#40;</span><span style="color: #cc66cc;">0</span><span style="color: #00AA00;">,</span><span style="color: #cc66cc;">0</span><span style="color: #00AA00;">,</span><span style="color: #cc66cc;">0</span><span style="color: #00AA00;">,</span><span style="color: #cc66cc;">0.1</span><span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">;</span>
	-webkit-box-shadow<span style="color: #00AA00;">:</span><span style="color: #933;">1px</span> <span style="color: #933;">1px</span> <span style="color: #933;">5px</span> <span style="color: #cc00cc;">#rgba</span><span style="color: #00AA00;">&#40;</span><span style="color: #cc66cc;">0</span><span style="color: #00AA00;">,</span><span style="color: #cc66cc;">0</span><span style="color: #00AA00;">,</span><span style="color: #cc66cc;">0</span><span style="color: #00AA00;">,</span><span style="color: #cc66cc;">0.1</span><span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">;</span>
	box-shadow<span style="color: #00AA00;">:</span><span style="color: #933;">1px</span> <span style="color: #933;">1px</span> <span style="color: #933;">5px</span> <span style="color: #cc00cc;">#rgba</span><span style="color: #00AA00;">&#40;</span><span style="color: #cc66cc;">0</span><span style="color: #00AA00;">,</span><span style="color: #cc66cc;">0</span><span style="color: #00AA00;">,</span><span style="color: #cc66cc;">0</span><span style="color: #00AA00;">,</span><span style="color: #cc66cc;">0.1</span><span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
<span style="color: #6666ff;">.sidebar</span> ul li<span style="color: #00AA00;">&#123;</span><span style="color: #000000; font-weight: bold;">float</span><span style="color: #00AA00;">:</span><span style="color: #000000; font-weight: bold;">left</span><span style="color: #00AA00;">&#125;</span></pre></div></div>

<p>不知道大家有没有什么不同的代码书写风格，希望能在评论中得到不同的见地。</p>
<p>PS:为什么我不喜欢把每个样式都单独分成一行？因为&#8230;我觉得这样的代码可读性真是太差了，试想，一个类样式占了10多行&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://leeiio.me/writing-clean-css3-code/feed/</wfw:commentRss>
		<slash:comments>38</slash:comments>
		</item>
		<item>
		<title>Mac版Doit.im发布啦！(2011-01-08更新)</title>
		<link>http://leeiio.me/mac-doit-im/</link>
		<comments>http://leeiio.me/mac-doit-im/#comments</comments>
		<pubDate>Thu, 30 Dec 2010 09:50:36 +0000</pubDate>
		<dc:creator>Leeiio</dc:creator>
				<category><![CDATA[Mac二三事]]></category>
		<category><![CDATA[My Works]]></category>
		<category><![CDATA[Doit.im]]></category>

		<guid isPermaLink="false">http://leeiio.me/?p=2195</guid>
		<description><![CDATA[呃，标题党了一下，这个并不是官方发布，这个版本是基于官方的linux版本进行修改的，纯属个人爱好业余时间进行修改。使用之前你可能需要有一个Doit.im的帐号。暂时没有登出账户功能，如果想切换账户，请右键应用程序 &#8211; 显示包内容 &#8211; Contents &#8211; Resources，然后删除doit.db文件即可。个人能力有限，可能会有不少bug，敬请见谅。目前没有自动更新功能，因为没有官方通知接口，所以请关注本博客的更新动态。 Doit.im是一款GTD软件，它支持多平台运作，不论您在web、iPhone、Android、Windows客户端、或iPad，都能使用Doit.im管理您的待办任务。 目前功能： 添加/编辑/删除任务 添加重复任务/转发任务/提醒任务 添加联系人 添加情境/项目 双击任务列表的单条任务可以查看任务详细信息 可以对任务列表的任务进行拖拽操作 10分钟自动同步任务到服务器 &#8230; 更多更强大功能可以尝试使用Web版Doit.im 2010.12.30:发布Mac版Doit.im alpha版。 中文版下载(115网盘) Download English Version(115 rapidshare Fileape FileDude MediaFire) 2011.01.08: 1.增加空任务箱子的说明提示 2.修正愚蠢的导致联系人界面显示错误的bug 3.增加任务到期及过期任务在列表上的提示信息 4.账户设置下拉选项中增加反馈链接 5.增加时间视图下添加任务高亮任务所在箱子的动态效果 6.调整快速 添加输入框到任务列表顶部 7.修复用户-时区造成的任务显示问题 8.其他一些bug修正以及改进 9&#8230;.. 1.Instruction &#8230; <a href="http://leeiio.me/mac-doit-im/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><img src="http://imgs.leeiio.me/blogimgs/2010/12/20101230_macdoitim.jpg" alt="Mac版Doit.im" /><br />
呃，标题党了一下，这个并不是官方发布，这个版本是基于官方的linux版本进行修改的，纯属个人爱好业余时间进行修改。使用之前你可能需要有一个<a href="http://www.doit.im" rel="nofollow">Doit.im</a>的帐号。暂时没有登出账户功能，如果想切换账户，请右键应用程序 &#8211; 显示包内容 &#8211; Contents &#8211; Resources，然后删除doit.db文件即可。个人能力有限，可能会有不少bug，敬请见谅。目前没有自动更新功能，因为没有官方通知接口，所以请关注本博客的更新动态。<br />
<span id="more-2195"></span></p>
<p><a href="http://www.doit.im" rel="nofollow">Doit.im</a>是一款GTD软件，它支持多平台运作，不论您在web、iPhone、Android、Windows客户端、或iPad，都能使用Doit.im管理您的待办任务。</p>
<p>目前功能：<br />
添加/编辑/删除任务<br />
添加重复任务/转发任务/提醒任务<br />
添加联系人<br />
添加情境/项目<br />
双击任务列表的单条任务可以查看任务详细信息<br />
可以对任务列表的任务进行拖拽操作<br />
10分钟自动同步任务到服务器<br />
&#8230;<br />
更多更强大功能可以尝试使用<a href="https://i.doit.im" rel="nofollow">Web版Doit.im</a></p>
<p>2010.12.30:发布Mac版Doit.im alpha版。 <del datetime="2011-01-08T14:25:32+00:00">中文版下载(<a href="http://u.115.com/file/f61f33b0b9" title="中文版下载" rel="nofollow">115网盘</a>) Download English Version(<a href="http://u.115.com/file/f6735f745d" title="Download English Version" rel="nofollow">115</a> <a href="http://rapidshare.com/files/439939295/Doiten.zip" title="Download English Version" rel="nofollow">rapidshare</a> <a href="http://fileape.com/dl/AJnthbaZdbhndIGD" title="Download English Version" rel="nofollow">Fileape</a> <a href="http://www.filedude.com/download/l9GGqsl5xC3dda5f365c" title="Download English Version" rel="nofollow">FileDude</a> <a href="http://www.mediafire.com/?47l9w7eecoilvwf" title="Download English Version" rel="nofollow">MediaFire</a>)</del></p>
<p>2011.01.08:<br />
1.增加空任务箱子的说明提示<br />
2.修正愚蠢的导致联系人界面显示错误的bug<br />
3.增加任务到期及过期任务在列表上的提示信息<br />
4.账户设置下拉选项中增加反馈链接<br />
5.增加时间视图下添加任务高亮任务所在箱子的动态效果<br />
6.调整快速 添加输入框到任务列表顶部<br />
7.修复用户-时区造成的任务显示问题<br />
8.其他一些bug修正以及改进<br />
9&#8230;..</p>
<p>1.Instruction showed when the box&#8217;s blank;<br />
2.The stupid bug which causes error on Contact page fixed;<br />
3.Due day,days overdue and days left showed on task bar;<br />
4.Feedback link added;<br />
5.Highlight effect showed on the box where task is added;<br />
6.Quick-add column adjusted to the top of task list;<br />
7.Other bugs fixed and performance improved.<br />
8.Fix &#8211; Timezone task show problem<br />
9&#8230;..<br />
中文版下载(<a href="http://u.115.com/file/f69c70b19d" title="中文版下载" rel="nofollow">115网盘</a>) Download English Version(<a href="http://u.115.com/file/f6a4b70fdf" title="Download English Version" rel="nofollow">115</a> <a href="http://www.filedude.com/download/CgWndREhHj8db92acebf" title="Download English Version" rel="nofollow">FileDude</a> )</p>
<p>声明：此版本并非官方版本，官方原生Mac版将于1月份左右发布，这个版本纯粹的个人兴趣项目，基于官方的Linux版本修改。<a href="https://twitter.com/heymi/">@heymi</a>界面设计，我<a href="https://twitter.com/leeiio">@leeiio</a>样式和脚本修改以及移植。</p>
]]></content:encoded>
			<wfw:commentRss>http://leeiio.me/mac-doit-im/feed/</wfw:commentRss>
		<slash:comments>28</slash:comments>
		</item>
		<item>
		<title>Read it later exporter &#8211; 导出你的Read it later的记录</title>
		<link>http://leeiio.me/read-it-later-exporter/</link>
		<comments>http://leeiio.me/read-it-later-exporter/#comments</comments>
		<pubDate>Thu, 25 Nov 2010 15:37:23 +0000</pubDate>
		<dc:creator>Leeiio</dc:creator>
				<category><![CDATA[My Works]]></category>
		<category><![CDATA[Read it later exporter]]></category>
		<category><![CDATA[RILExporter]]></category>

		<guid isPermaLink="false">http://leeiio.me/?p=2167</guid>
		<description><![CDATA[事情的起因是Read it later(http://readitlaterlist.com/)伤了我的心，丢了我的不少数据。这个以前我极力向朋友推荐的信息时代的减压工具之一，因为我收录的网址太多了，然后很早以前的网址都丢失了。我记得最早版本的Read it later是和firefox本地书签关联的，除了服务器上的副本本地的书签里还有一个目录专门收藏着。作为云时代提供的云服务，用户的数据是十分重要的，虽说Read it later是免费服务，但是用户的数据都不能保障的话这是绝对不行的。 现在用的服务是pinboard.in，页面十分简洁，但功能十分强大，且十分使用。除了保存你的URL，还在服务器上Archive你的URL页面的副本，就算该URL失效了还是可以正常浏览到该页面。更重要的是还支持搜索的时候搜索被Archive的页面上的文本，可谓十分强大，且支持自动保存你的tweets为书签。而且支持Read it later功能，更多功能可以看这里。价格也不贵，$25即可拥有这一切。(听着像给人家打广告&#8230;) 同类服务还有 http://historio.us/ 下面才进入本文正题&#8230; 用了pinboard.in后，以前记录在Read it later的记录就需要迁移过来，而他们官方没有直接提供导出的功能，但是提供了API，于是动手折腾了一个，在@cyril_liu童鞋的后端支持下，就有了Read it later exporter。导出为书签文件后，你想往拿导入都可以，可以导入pinboard.in当然也可以导入回你的浏览器书签。 最后的PS:消失了挺长一段时间了，你知道的，我现在正在做一个很棒的产品，而且加上我比较懒，所以更新缓慢，其实很多都在草稿箱一直都没有发出去，罪过罪过。博客写不动了都，还是写微博舒畅，可以follow我的twitter:@leeiio 或者腾讯微博神马的，ID都是这个。话说，今天饭否开饭了&#8230;]]></description>
			<content:encoded><![CDATA[<p><img src="http://imgs.leeiio.me/blogimgs/2010/11/20101125_ril.jpg" alt="Read it later exporter - 导出你的Read it later的记录" /><br />
事情的起因是Read it later(http://readitlaterlist.com/)伤了我的心，丢了我的不少数据。这个以前我极力向朋友推荐的信息时代的减压工具之一，因为我收录的网址太多了，然后很早以前的网址都丢失了。我记得最早版本的Read it later是和firefox本地书签关联的，除了服务器上的副本本地的书签里还有一个目录专门收藏着。作为云时代提供的云服务，用户的数据是十分重要的，虽说Read it later是免费服务，但是用户的数据都不能保障的话这是绝对不行的。<br />
<span id="more-2167"></span><br />
现在用的服务是<a href="http://pinboard.in/" rel="nofollow">pinboard.in</a>，页面十分简洁，但功能十分强大，且十分使用。除了保存你的URL，还在服务器上Archive你的URL页面的副本，就算该URL失效了还是可以正常浏览到该页面。更重要的是还支持搜索的时候搜索被Archive的页面上的文本，可谓十分强大，且支持自动保存你的tweets为书签。而且支持Read it later功能，更多功能可以看<a href="http://pinboard.in/about/" rel="nofollow">这里</a>。价格也不贵，$25即可拥有这一切。(听着像给人家打广告&#8230;) 同类服务还有 <a href="http://historio.us/" rel="nofollow">http://historio.us/</a></p>
<p>下面才进入本文正题&#8230;</p>
<p>用了pinboard.in后，以前记录在Read it later的记录就需要迁移过来，而他们官方没有直接提供导出的功能，但是提供了API，于是动手折腾了一个，在<a href="https://twitter.com/cyril_liu/">@cyril_liu</a>童鞋的后端支持下，就有了Read it later exporter。导出为书签文件后，你想往拿导入都可以，可以导入pinboard.in当然也可以导入回你的浏览器书签。</p>
<p><p class="preview left"><a href="http://rilexporter.appspot.com/" title="点击访问 Read it later exporter!">Read it later exporter
<em title="Read it later exporter">Just click it!</em></a></p><br />
<p class="clear"></p></p>
<p>最后的PS:消失了挺长一段时间了，你知道的，我现在正在做一个很棒的产品，而且加上我比较懒，所以更新缓慢，其实很多都在草稿箱一直都没有发出去，罪过罪过。博客写不动了都，还是写微博舒畅，可以follow我的twitter:@leeiio 或者腾讯微博神马的，ID都是这个。话说，今天饭否开饭了&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://leeiio.me/read-it-later-exporter/feed/</wfw:commentRss>
		<slash:comments>12</slash:comments>
		</item>
		<item>
		<title>同步你的 Mercurial(Hg) 和 Git 版本库</title>
		<link>http://leeiio.me/synchronizing-a-mercurial-repository-with-git/</link>
		<comments>http://leeiio.me/synchronizing-a-mercurial-repository-with-git/#comments</comments>
		<pubDate>Wed, 08 Sep 2010 13:59:41 +0000</pubDate>
		<dc:creator>Leeiio</dc:creator>
				<category><![CDATA[設計資源]]></category>
		<category><![CDATA[Git]]></category>
		<category><![CDATA[Hg]]></category>
		<category><![CDATA[Hg-Git]]></category>
		<category><![CDATA[Mercurial]]></category>

		<guid isPermaLink="false">http://leeiio.me/?p=2141</guid>
		<description><![CDATA[我的Vim的配置文件之前都是托管在Bitbucket的，因为公司用的也是Hg，所以相对对于Hg使用更熟练一点。虽然Hg和Git都是分布式版本管理工具，但是Hg在使用上以及学习上确实简单不少，很容易上手了。但是还是有很多人是喜欢用Git的，所以我必须要把我的Vim的配置同时用Git来进行版本管理，然后push到著名的Github网站，这样Git使用者也可以很方便的watch以及pull我的最新配置(虽然目前还没有什么人watch&#8230;)。 之前的做法比较傻，为了让Git和Hg管理同一个目录，通常操作完Hg的push，然后再用Git进行commit然后push，虽然也是能达到版本库同步的目的，但是很繁琐，因为要分别用Hg和Git进行commit和push操作，有时候还会面临merge问题，实在不是一个好方法。 那肯定是有更好的方法咯？当然！有一个Hg的插件叫做Hg-Git正好满足了这样的需求。 什么是Hg-Git Hg-Git是Mercurial(Hg)的扩展插件，为Hg增加了从Git服务器pull和push到Git服务器的功能。这意味着你可以从Git的服务器上pull代码然后转变成Hg版本库来进行管理，同时意味着你可以同时把你的Hg版本库push到Git服务器。 安装Hg-Git 简单方式 在你的命令行终端里运行easy_install hg-git，然后查看你的~/.hgrc文件里是否有如下几行代码 &#91;extensions&#93; hgext.bookmarks = hggit = esay_install 是python 包管理工具，它的作用类似于Php中的pear，或者Ruby中的gem，或者Perl中的cpan，或者haskell 中的cabal。 手动方式 从Hg-Git托管在Github的代码库http://github.com/schacon/hg-git/zipball/master里下载然后放置到某个目录。当然前提是你安装了0.4.0或者更新版本的dulwich。你可以使用easy_install &#8216;dulwich>=0.4.0&#8242; 命令进行安装如果你安装了setuptools。接着打开你的~/.hgrc文件，复制并编辑如下配置 &#91;extensions&#93; hgext.bookmarks = hggit = &#91;path-to&#93;/hg-git/hggit 这样就安装好了Hg-Git扩展，这里的配置中bookmarks的配置并不是必须的，但是当在push的时候它会被转化成Git的heads。 用法 如果你想要用Hg clone一個Git版本库，只需使用hg clone [url]便可，例如 $ hg clone git+ssh://git@github.com:Leeiio/Vim.git push的命令也很简单 $ &#8230; <a href="http://leeiio.me/synchronizing-a-mercurial-repository-with-git/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><img src="http://imgs.leeiio.me/blogimgs/2010/09/20100908_hg_git_sync.jpg" alt="同步你的 Mercurial(Hg) 和 Git 版本库" /><br />
我的Vim的配置文件之前都是托管在Bitbucket的，因为公司用的也是Hg，所以相对对于Hg使用更熟练一点。虽然Hg和Git都是分布式版本管理工具，但是Hg在使用上以及学习上确实简单不少，很容易上手了。但是还是有很多人是喜欢用Git的，所以我必须要把我的Vim的配置同时用Git来进行版本管理，然后push到著名的Github网站，这样Git使用者也可以很方便的watch以及pull我的最新配置(虽然目前还没有什么人watch&#8230;)。</p>
<p>之前的做法比较傻，为了让Git和Hg管理同一个目录，通常操作完Hg的push，然后再用Git进行commit然后push，虽然也是能达到版本库同步的目的，但是很繁琐，因为要分别用Hg和Git进行commit和push操作，有时候还会面临merge问题，实在不是一个好方法。<br />
<span id="more-2141"></span><br />
那肯定是有更好的方法咯？当然！有一个Hg的插件叫做<a href="http://hg-git.github.com/" rel="nofollow">Hg-Git</a>正好满足了这样的需求。</p>
<h2 class="part-title">什么是Hg-Git</h2>
<p>Hg-Git是Mercurial(Hg)的扩展插件，为Hg增加了从Git服务器pull和push到Git服务器的功能。这意味着你可以从Git的服务器上pull代码然后转变成Hg版本库来进行管理，同时意味着你可以同时把你的Hg版本库push到Git服务器。</p>
<h2 class="part-title">安装Hg-Git</h2>
<h4>简单方式</h4>
<p>在你的命令行终端里运行easy_install hg-git，然后查看你的~/.hgrc文件里是否有如下几行代码</p>

<div class="wp_syntax"><div class="code"><pre class="ini" style="font-family:monospace;"><span style="color: #000066; font-weight:bold;"><span style="">&#91;</span>extensions<span style="">&#93;</span></span>
hgext.bookmarks <span style="color: #000066; font-weight:bold;">=</span>
<span style="color: #000099;">hggit</span> <span style="color: #000066; font-weight:bold;">=</span></pre></div></div>

<p>esay_install 是python 包管理工具，它的作用类似于Php中的pear，或者Ruby中的gem，或者Perl中的cpan，或者haskell 中的cabal。</p>
<h4>手动方式</h4>
<p>从Hg-Git托管在Github的代码库http://github.com/schacon/hg-git/zipball/master里下载然后放置到某个目录。当然前提是你安装了0.4.0或者更新版本的dulwich。你可以使用easy_install &#8216;dulwich>=0.4.0&#8242; 命令进行安装如果你安装了setuptools。接着打开你的~/.hgrc文件，复制并编辑如下配置</p>

<div class="wp_syntax"><div class="code"><pre class="ini" style="font-family:monospace;"><span style="color: #000066; font-weight:bold;"><span style="">&#91;</span>extensions<span style="">&#93;</span></span>
hgext.bookmarks <span style="color: #000066; font-weight:bold;">=</span>
<span style="color: #000099;">hggit</span> <span style="color: #000066; font-weight:bold;">=</span><span style="color: #660066;"> <span style="color: #000066; font-weight:bold;"><span style="">&#91;</span>path-to<span style="">&#93;</span></span>/hg-git/hggit</span></pre></div></div>

<p>这样就安装好了Hg-Git扩展，这里的配置中bookmarks的配置并不是必须的，但是当在push的时候它会被转化成Git的heads。</p>
<h2 class="part-title">用法</h2>
<p>如果你想要用Hg clone一個Git版本库，只需使用hg clone [url]便可，例如</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ hg clone <span style="color: #c20cb9; font-weight: bold;">git</span>+<span style="color: #c20cb9; font-weight: bold;">ssh</span>:<span style="color: #000000; font-weight: bold;">//</span><span style="color: #c20cb9; font-weight: bold;">git</span><span style="color: #000000; font-weight: bold;">@</span>github.com:Leeiio<span style="color: #000000; font-weight: bold;">/</span>Vim.git</pre></div></div>

<p>push的命令也很简单</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ hg push <span style="color: #c20cb9; font-weight: bold;">git</span>+<span style="color: #c20cb9; font-weight: bold;">ssh</span>:<span style="color: #000000; font-weight: bold;">//</span><span style="color: #c20cb9; font-weight: bold;">git</span><span style="color: #000000; font-weight: bold;">@</span>github.com:Leeiio<span style="color: #000000; font-weight: bold;">/</span>Vim.git</pre></div></div>

<p>如果不想每次输入这么长的git服务器地址，你可以打开.hg/hgrc文件，编辑如下</p>

<div class="wp_syntax"><div class="code"><pre class="ini" style="font-family:monospace;"><span style="color: #000066; font-weight:bold;"><span style="">&#91;</span>paths<span style="">&#93;</span></span>
<span style="color: #000099;">default</span> <span style="color: #000066; font-weight:bold;">=</span><span style="color: #660066;"> https://leeiio@bitbucket.org/leeiio/vim</span>
<span style="color: #000099;">git</span> <span style="color: #000066; font-weight:bold;">=</span><span style="color: #660066;"> git+ssh://git@github.com:Leeiio/Leeiio.git</span></pre></div></div>

<p>这样便可以直接使用如下命令来进行push操作了</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ hg push <span style="color: #c20cb9; font-weight: bold;">git</span></pre></div></div>

<p>更多使用方法参见 <a href="http://github.com/schacon/hg-git" rel="nofollow">http://github.com/schacon/hg-git</a></p>
<h2 class="part-title">同步目前已存在的Hg版本库到Git</h2>
<p>从bitbucket服务器clone一份Hg的版本到本地做示范用，如果你本地已经存在一份需要被转换以及同步的Hg版本库就略过此步骤，只要cd要你的Hg管理的项目目录即可。</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ hg clone https:<span style="color: #000000; font-weight: bold;">//</span>leeiio<span style="color: #000000; font-weight: bold;">@</span>bitbucket.org<span style="color: #000000; font-weight: bold;">/</span>leeiio<span style="color: #000000; font-weight: bold;">/</span><span style="color: #c20cb9; font-weight: bold;">vim</span> vim-test
requesting all changes
adding changesets
adding manifests
adding <span style="color: #c20cb9; font-weight: bold;">file</span> changes
added <span style="color: #000000;">23</span> changesets with <span style="color: #000000;">418</span> changes to <span style="color: #000000;">239</span> files
updating to branch default
<span style="color: #000000;">239</span> files updated, <span style="color: #000000;">0</span> files merged, <span style="color: #000000;">0</span> files removed, <span style="color: #000000;">0</span> files unresolved
$ <span style="color: #7a0874; font-weight: bold;">cd</span> vim-test<span style="color: #000000; font-weight: bold;">/</span></pre></div></div>

<p>创建一个bookmark，然后push到Git服务器</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ hg bookmark <span style="color: #660033;">-r</span> default master
$ hg push <span style="color: #c20cb9; font-weight: bold;">git</span>+<span style="color: #c20cb9; font-weight: bold;">ssh</span>:<span style="color: #000000; font-weight: bold;">//</span><span style="color: #c20cb9; font-weight: bold;">git</span><span style="color: #000000; font-weight: bold;">@</span>github.com:Leeiio<span style="color: #000000; font-weight: bold;">/</span>vim-test.git
pushing to <span style="color: #c20cb9; font-weight: bold;">git</span>+<span style="color: #c20cb9; font-weight: bold;">ssh</span>:<span style="color: #000000; font-weight: bold;">//</span><span style="color: #c20cb9; font-weight: bold;">git</span><span style="color: #000000; font-weight: bold;">@</span>github.com:Leeiio<span style="color: #000000; font-weight: bold;">/</span>vim-test.git
importing Hg objects into Git
creating and sending data
<span style="color: #c20cb9; font-weight: bold;">git</span>::refs<span style="color: #000000; font-weight: bold;">/</span>heads<span style="color: #000000; font-weight: bold;">/</span>master =<span style="color: #000000; font-weight: bold;">&gt;</span> GIT:092e7cf3</pre></div></div>

<p>如果你想从Git服务器上pull最近的更新的话也可以直接是用Hg的pull命令</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ hg pull <span style="color: #c20cb9; font-weight: bold;">git</span>+<span style="color: #c20cb9; font-weight: bold;">ssh</span>:<span style="color: #000000; font-weight: bold;">//</span><span style="color: #c20cb9; font-weight: bold;">git</span><span style="color: #000000; font-weight: bold;">@</span>github.com:Leeiio<span style="color: #000000; font-weight: bold;">/</span>vim-test.git
pulling from <span style="color: #c20cb9; font-weight: bold;">git</span>+<span style="color: #c20cb9; font-weight: bold;">ssh</span>:<span style="color: #000000; font-weight: bold;">//</span><span style="color: #c20cb9; font-weight: bold;">git</span><span style="color: #000000; font-weight: bold;">@</span>github.com:Leeiio<span style="color: #000000; font-weight: bold;">/</span>vim-test.git
importing Hg objects into Git
Total <span style="color: #000000;">0</span> <span style="color: #7a0874; font-weight: bold;">&#40;</span>delta <span style="color: #000000;">0</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>, reused <span style="color: #000000;">0</span> <span style="color: #7a0874; font-weight: bold;">&#40;</span>delta <span style="color: #000000;">0</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>
importing Git objects into Hg
<span style="color: #7a0874; font-weight: bold;">&#40;</span>run <span style="color: #ff0000;">'hg update'</span> to get a working copy<span style="color: #7a0874; font-weight: bold;">&#41;</span></pre></div></div>

<p>是不是超级简单且强大的一个玩意？如果你也有这样的需求，那么就下载Hg-Git试试吧！</p>
]]></content:encoded>
			<wfw:commentRss>http://leeiio.me/synchronizing-a-mercurial-repository-with-git/feed/</wfw:commentRss>
		<slash:comments>35</slash:comments>
		</item>
	</channel>
</rss>

