<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>徐代龙的技术专栏</title>
    <description>blog &amp; blog theme🤘</description>
    <link>https://643435675.github.io/</link>
    <atom:link href="https://643435675.github.io/feed.xml" rel="self" type="application/rss+xml"/>
    <pubDate>Fri, 08 Dec 2017 08:28:37 +0000</pubDate>
    <lastBuildDate>Fri, 08 Dec 2017 08:28:37 +0000</lastBuildDate>
    <generator>Jekyll v3.6.2</generator>
    
      <item>
        <title>这是徐代龙进行的第二篇文章</title>
        <description>&lt;ul id=&quot;markdown-toc&quot;&gt;
  &lt;li&gt;&lt;a href=&quot;#目的&quot; id=&quot;markdown-toc-目的&quot;&gt;目的：&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id=&quot;目的&quot;&gt;目的：&lt;/h2&gt;

写这篇文章的目的主要是为了测试在本地进行md文件的编写是否能使用hexo进行html生成，然后上传到github上，通过访问https://day21.top 这个网站查看能否看到最新的文章

</description>
        <pubDate>Thu, 07 Dec 2017 00:00:00 +0000</pubDate>
        <link>https://643435675.github.io/2017/12/07/test-my-webapp/</link>
        <guid isPermaLink="true">https://643435675.github.io/2017/12/07/test-my-webapp/</guid>
        
        <category>hexo</category>
        
        <category>JavaScript</category>
        
        
        <category>SnakeSon</category>
        
      </item>
    
      <item>
        <title>这是徐代龙进行的第二篇文章</title>
        <description>&lt;ul id=&quot;markdown-toc&quot;&gt;
  &lt;li&gt;&lt;a href=&quot;#目的&quot; id=&quot;markdown-toc-目的&quot;&gt;目的：&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id=&quot;目的&quot;&gt;目的：&lt;/h2&gt;

写这篇文章的目的主要是为了测试在本地进行md文件的编写是否能使用hexo进行html生成，然后上传到github上，通过访问https://day21.top 这个网站查看能否看到最新的文章

</description>
        <pubDate>Thu, 07 Dec 2017 00:00:00 +0000</pubDate>
        <link>https://643435675.github.io/2017/12/07/git-push-github/</link>
        <guid isPermaLink="true">https://643435675.github.io/2017/12/07/git-push-github/</guid>
        
        <category>hexo</category>
        
        <category>JavaScript</category>
        
        
        <category>SnakeSon</category>
        
      </item>
    
      <item>
        <title>这是我自己来测试的md页面</title>
        <description>
关于写倒计时大家可能都都比较熟悉，使用 setTimeout 或 setInterval 就可以搞定。几秒钟或者几分钟的倒计时这样写没有问题，但是如果是长时间的倒计时，这样写就会不准确。如果用户修改了他的设备时间，这样的倒计时就没有意义了。今天就说说写一个精确的倒计时的方法。

&lt;img src=&quot;https://img.alicdn.com/tfs/TB18QnlOpXXXXcVXpXXXXXXXXXX-388-256.png&quot; alt=&quot;&quot; /&gt;

</description>
        <pubDate>Mon, 04 Dec 2017 00:00:00 +0000</pubDate>
        <link>https://643435675.github.io/2017/12/04/test-my-webapp/</link>
        <guid isPermaLink="true">https://643435675.github.io/2017/12/04/test-my-webapp/</guid>
        
        <category>countdown</category>
        
        <category>JavaScript</category>
        
        
        <category>JavaScript</category>
        
      </item>
    
      <item>
        <title>前端如何写一个精确的倒计时</title>
        <description>
关于写倒计时大家可能都都比较熟悉，使用 setTimeout 或 setInterval 就可以搞定。几秒钟或者几分钟的倒计时这样写没有问题，但是如果是长时间的倒计时，这样写就会不准确。如果用户修改了他的设备时间，这样的倒计时就没有意义了。今天就说说写一个精确的倒计时的方法。

&lt;img src=&quot;https://img.alicdn.com/tfs/TB18QnlOpXXXXcVXpXXXXXXXXXX-388-256.png&quot; alt=&quot;&quot; /&gt;

</description>
        <pubDate>Fri, 25 Nov 2016 00:00:00 +0000</pubDate>
        <link>https://643435675.github.io/2016/11/25/how-to-write-a-count-down/</link>
        <guid isPermaLink="true">https://643435675.github.io/2016/11/25/how-to-write-a-count-down/</guid>
        
        <category>countdown</category>
        
        <category>JavaScript</category>
        
        
        <category>JavaScript</category>
        
      </item>
    
      <item>
        <title>使用 JavaScript 创建并下载文件</title>
        <description>&lt;ul id=&quot;markdown-toc&quot;&gt;
  &lt;li&gt;&lt;a href=&quot;#先上代码&quot; id=&quot;markdown-toc-先上代码&quot;&gt;先上代码&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

本文将介绍如何使用 JavaScript 创建文件，并自动/手动将文件下载。这在导出原始数据时会比较方便。

&lt;h2 id=&quot;先上代码&quot;&gt;先上代码&lt;/h2&gt;

&lt;div class=&quot;language-js highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;cm&quot;&gt;/**
 * 创建并下载文件
 * @param  {String} fileName 文件名
 * @param  {String} content  文件内容
 */&lt;/span&gt;
&lt;span class=&quot;kd&quot;&gt;function&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;createAndDownloadFile&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;fileName&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;content&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;kd&quot;&gt;var&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;aTag&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;document&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;createElement&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;'a'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
    &lt;span class=&quot;kd&quot;&gt;var&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;blob&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;Blob&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;([&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;content&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]);&lt;/span&gt;
    &lt;span class=&quot;nx&quot;&gt;aTag&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;download&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;fileName&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;nx&quot;&gt;aTag&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;href&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;URL&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;createObjectURL&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;blob&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
    &lt;span class=&quot;nx&quot;&gt;aTag&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;click&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;();&lt;/span&gt;
    &lt;span class=&quot;nx&quot;&gt;URL&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;revokeObjectURL&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;blob&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

很简单对吧，直接调用这个方法，传入文件名和文件内容，程序新建 a 标签，新建 Blob 对象，将文件名赋给 a 标签，同时将 Blob 对象作为 Url 也赋给 a 标签，模拟点击事件，自动下载成功，最后再回收内存。下面我们来看看具体是怎么操作的。

</description>
        <pubDate>Tue, 22 Nov 2016 00:00:00 +0000</pubDate>
        <link>https://643435675.github.io/2016/11/22/js-create-file-and-download/</link>
        <guid isPermaLink="true">https://643435675.github.io/2016/11/22/js-create-file-and-download/</guid>
        
        <category>文件</category>
        
        <category>下载</category>
        
        <category>JavaScript</category>
        
        
        <category>JavaScript</category>
        
      </item>
    
      <item>
        <title>Fisher–Yates shuffle 洗牌算法</title>
        <description>
简单来说 Fisher–Yates shuffle 算法是一个用来将一个有限集合生成一个随机排列的算法（数组随机排序）。这个算法生成的随机排列是等概率的。同时这个算法非常高效。

本文主要介绍这个算法的来源、演变、原理。并举出一个例子为大家清晰的描述每次迭代过程。最后使用 JavaScript 代码将算法实现。

&lt;img src=&quot;https://upload.wikimedia.org/wikipedia/commons/thumb/7/7c/Riffle_shuffle.jpg/320px-Riffle_shuffle.jpg&quot; alt=&quot;&quot; /&gt;

</description>
        <pubDate>Sun, 16 Oct 2016 00:00:00 +0000</pubDate>
        <link>https://643435675.github.io/2016/10/16/shuffle-algorithm/</link>
        <guid isPermaLink="true">https://643435675.github.io/2016/10/16/shuffle-algorithm/</guid>
        
        <category>算法</category>
        
        <category>shuffle</category>
        
        <category>乱序</category>
        
        <category>洗牌</category>
        
        
        <category>JavaScript</category>
        
      </item>
    
      <item>
        <title>Git 如何 clone 非 master 分支的代码</title>
        <description>&lt;ul id=&quot;markdown-toc&quot;&gt;
  &lt;li&gt;&lt;a href=&quot;#问题描述&quot; id=&quot;markdown-toc-问题描述&quot;&gt;问题描述&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id=&quot;问题描述&quot;&gt;问题描述&lt;/h2&gt;

我们每次使用命令

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;git clone git@gitlab.xxx.com:xxxxx.git
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

默认 clone 的是这个仓库的 master 分支。如果最新的代码不在 master 分支上，该如何拿到呢？如下图所示，最新的代码可能在&lt;code class=&quot;highlighter-rouge&quot;&gt;daily/1.4.1&lt;/code&gt;分支上，我们希望拿到这个分支上的代码。

</description>
        <pubDate>Thu, 07 Jul 2016 00:00:00 +0000</pubDate>
        <link>https://643435675.github.io/2016/07/07/git-clone-not-master-branch/</link>
        <guid isPermaLink="true">https://643435675.github.io/2016/07/07/git-clone-not-master-branch/</guid>
        
        <category>Git</category>
        
        <category>GitHub</category>
        
        <category>分支</category>
        
        
        <category>GitHub</category>
        
      </item>
    
      <item>
        <title>如何使用 babel</title>
        <description>
&lt;a href=&quot;https://babeljs.io/&quot;&gt;Babel&lt;/a&gt; 用于将 ES6 的代码转化为 ES5，使得 ES6 可以在目前的浏览器环境下使用。学习使用 babel 是为了使用 ES2015 做准备。本文将介绍如何使用 babel，以及一些相关的配置。

</description>
        <pubDate>Tue, 14 Jun 2016 00:00:00 +0000</pubDate>
        <link>https://643435675.github.io/2016/06/14/how-to-use-babel/</link>
        <guid isPermaLink="true">https://643435675.github.io/2016/06/14/how-to-use-babel/</guid>
        
        <category>ES2015</category>
        
        <category>ES6</category>
        
        <category>ES5</category>
        
        <category>babel</category>
        
        
        <category>JavaScript</category>
        
      </item>
    
      <item>
        <title>JavaScript 语言精粹笔记3-方法、毒瘤等</title>
        <description>
记录一下阅读蝴蝶书的笔记，本篇为书中最后一部分：方法、代码风格、优美的特性、毒瘤、糟粕等。

</description>
        <pubDate>Fri, 10 Jun 2016 00:00:00 +0000</pubDate>
        <link>https://643435675.github.io/2016/06/10/JavaScript-good-parts-note3/</link>
        <guid isPermaLink="true">https://643435675.github.io/2016/06/10/JavaScript-good-parts-note3/</guid>
        
        <category>函数</category>
        
        <category>JavaScript</category>
        
        
        <category>JavaScript</category>
        
      </item>
    
      <item>
        <title>JavaScript 语言精粹笔记2-继承、数组、正则表达式</title>
        <description>
记录一下阅读蝴蝶书的笔记，本篇为书中以下章节的笔记：继承、数组和正则表达式。

</description>
        <pubDate>Wed, 08 Jun 2016 00:00:00 +0000</pubDate>
        <link>https://643435675.github.io/2016/06/08/JavaScript-good-parts-note2/</link>
        <guid isPermaLink="true">https://643435675.github.io/2016/06/08/JavaScript-good-parts-note2/</guid>
        
        <category>继承</category>
        
        <category>对象</category>
        
        <category>原型</category>
        
        <category>Array</category>
        
        <category>正则</category>
        
        
        <category>JavaScript</category>
        
      </item>
    
  </channel>
</rss>
