<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <title>tim_lang (Tim Lang)</title>
    <link>https://ruby-china.org/tim_lang</link>
    <description></description>
    <language>en-us</language>
    <item>
      <title>现在还推荐使用 Turbolinks + Native 来做 iOS app 吗</title>
      <description>&lt;p&gt;主要团队人比较少，目前没专职的 iOS 工程师。&lt;/p&gt;

&lt;p&gt;ruby-china 的 iOS 版也是一波三折，最新版正是 turbolinks+native，不知道现在还推荐这个吗。&lt;/p&gt;</description>
      <author>tim_lang</author>
      <pubDate>Wed, 12 Sep 2018 10:01:46 +0800</pubDate>
      <link>https://ruby-china.org/topics/37474</link>
      <guid>https://ruby-china.org/topics/37474</guid>
    </item>
    <item>
      <title>为什么百度搜 rails5 特性会出现其他人搜索邓紫棋</title>
      <description>&lt;p&gt;开始百思不得其解，然后点进邓紫棋的百度百科想一探究竟，然后明白了：“邓紫棋（Gloria Tang Tsz-Kei），又名 G.E.M.”&lt;/p&gt;</description>
      <author>tim_lang</author>
      <pubDate>Mon, 20 Mar 2017 11:49:49 +0800</pubDate>
      <link>https://ruby-china.org/topics/32582</link>
      <guid>https://ruby-china.org/topics/32582</guid>
    </item>
    <item>
      <title>阿里的 NPM 源老出些奇怪问题</title>
      <description>&lt;p&gt;我发现自从用了阿里的 npm 源后就经常出些奇怪的问题。&lt;/p&gt;

&lt;p&gt;比如 webpack 的 chunkhash 不一致，导致多台服务器的编译结果不一样，换成 npm 官方的源后无此问题。&lt;/p&gt;

&lt;p&gt;还有之前就下了个 phoneix_china 的源码，又发现 simditor 也有问题，重新换 npm 官方源下载后就好了。&lt;/p&gt;

&lt;p&gt;难道是我使用不当？&lt;img title=":scream_cat:" alt="🙀" src="https://twemoji.ruby-china.com/2/svg/1f640.svg" class="twemoji"&gt; &lt;/p&gt;</description>
      <author>tim_lang</author>
      <pubDate>Wed, 12 Oct 2016 11:51:21 +0800</pubDate>
      <link>https://ruby-china.org/topics/31295</link>
      <guid>https://ruby-china.org/topics/31295</guid>
    </item>
    <item>
      <title>挽救你的 Git 仓库</title>
      <description>&lt;p&gt;事情是这样的，新来的前端小妹对 git 不熟悉，然后使用了 git add 提交了当前目录下 vagrant 的 box，大概有 1G 多。&lt;/p&gt;

&lt;p&gt;于是噩梦来了，rails 部署大家都知道的，都是要先从 git 仓库更新代码的。即使删除了 1G 多的 box，这个记录还是会存在 git 的 history 里面的，也就是说每个服务器发布时候必须要先更新 1G 多的 history。&lt;/p&gt;

&lt;p&gt;google 后发现其实发现早是很好解决的：&lt;/p&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git &lt;span class="nb"&gt;rm&lt;/span&gt; &lt;span class="nt"&gt;--cached&lt;/span&gt; giant_file

git commit &lt;span class="nt"&gt;--amend&lt;/span&gt; &lt;span class="nt"&gt;-CHEAD&lt;/span&gt;

git push
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;如果不幸这条大文件的提交在你的历史 commits 中的话也没关系，有人做了个工具来解决这个事情：&lt;a href="https://github.com/rtyley/bfg-repo-cleaner" rel="nofollow" target="_blank"&gt;https://github.com/rtyley/bfg-repo-cleaner&lt;/a&gt;&lt;/p&gt;</description>
      <author>tim_lang</author>
      <pubDate>Mon, 25 Jul 2016 15:19:19 +0800</pubDate>
      <link>https://ruby-china.org/topics/30615</link>
      <guid>https://ruby-china.org/topics/30615</guid>
    </item>
    <item>
      <title>点赞变成了一个大大的爱心真的好吗</title>
      <description>&lt;p&gt;好奇怪的感觉啊，总感觉哪里不太对。。&lt;/p&gt;</description>
      <author>tim_lang</author>
      <pubDate>Tue, 21 Jun 2016 12:10:59 +0800</pubDate>
      <link>https://ruby-china.org/topics/30334</link>
      <guid>https://ruby-china.org/topics/30334</guid>
    </item>
    <item>
      <title>有没有汉语注音的 gem</title>
      <description>&lt;p&gt;找了半天没找到汉语注音的 gem，好像台湾地区都是用注音的。汉语拼音似乎不太用，而且和大陆用的拼音有些差别。&lt;/p&gt;</description>
      <author>tim_lang</author>
      <pubDate>Tue, 21 Apr 2015 11:32:39 +0800</pubDate>
      <link>https://ruby-china.org/topics/25226</link>
      <guid>https://ruby-china.org/topics/25226</guid>
    </item>
    <item>
      <title>sanitize 的一个问题怎么破</title>
      <description>&lt;pre class="highlight ruby"&gt;&lt;code&gt;&lt;span class="no"&gt;ActionController&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="no"&gt;Base&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;helpers&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;sanitize&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"&amp;lt;span&amp;gt;dsdsdsd&amp;lt;/span&amp;gt;ddsdsdsd  1 &amp;gt; 2 "&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="c1"&gt;#return &amp;lt;span&amp;gt;dsdsdsd&amp;lt;/span&amp;gt;ddsdsdsd  1 &amp;amp;gt; 2&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;但是&lt;/p&gt;
&lt;pre class="highlight ruby"&gt;&lt;code&gt;&lt;span class="no"&gt;ActionController&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="no"&gt;Base&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;helpers&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;sanitize&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"&amp;lt;span&amp;gt;dsdsdsd&amp;lt;/span&amp;gt;ddsdsdsd  1 &amp;lt; 2 "&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="c1"&gt;#return  "&amp;lt;span&amp;gt;dsdsdsd&amp;lt;/span&amp;gt;ddsdsdsd  1 " &lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;后面的 &amp;lt; 2 就没了，也就是没能转换成 &amp;amp;l t; 2&lt;/p&gt;

&lt;p&gt;测试了下 angularjs 里面的 ng-sanitize 和 rails 的 sanitize helper 行为一样。&lt;/p&gt;

&lt;p&gt;现在的问题是已经不可能改数据库中的原数据了，比如 保存进数据库时就将&amp;lt;&amp;gt;"等符号给 escape 掉。
如何使得 santize 得到预期的结果，而不丢字符串。&lt;/p&gt;</description>
      <author>tim_lang</author>
      <pubDate>Fri, 13 Mar 2015 16:00:42 +0800</pubDate>
      <link>https://ruby-china.org/topics/24636</link>
      <guid>https://ruby-china.org/topics/24636</guid>
    </item>
    <item>
      <title>想抓取某台湾网站的数据，但是提交查询的时候是按 big5 来对 url 进行编码的</title>
      <description>&lt;p&gt;例如：中国，
escape 后是%A4%A4%26%2322269%3B 而不是
encodeURIComponent('中国') =&amp;gt; '%E4%B8%AD%E5%9B%BD',
如何处理。&lt;/p&gt;</description>
      <author>tim_lang</author>
      <pubDate>Fri, 13 Feb 2015 16:01:56 +0800</pubDate>
      <link>https://ruby-china.org/topics/24254</link>
      <guid>https://ruby-china.org/topics/24254</guid>
    </item>
    <item>
      <title>今天多看的 Ruby 元编程 2 元</title>
      <description>&lt;p&gt;还没买的可以入啊。&lt;/p&gt;</description>
      <author>tim_lang</author>
      <pubDate>Fri, 12 Dec 2014 10:52:52 +0800</pubDate>
      <link>https://ruby-china.org/topics/23151</link>
      <guid>https://ruby-china.org/topics/23151</guid>
    </item>
    <item>
      <title>mongodb 导出导入数据不一致</title>
      <description>&lt;p&gt;在数据库 A 用 show dbs 发现是 25.3G 的数据，然后用 mongodump dump 出来。&lt;/p&gt;

&lt;p&gt;到数据库 B 用 mongorestore 导入进去，再使用 show dbs 发现只有 23.5G。&lt;/p&gt;

&lt;p&gt;也不知道数据有没有丢，查看了下数据的总数是对的，求解。&lt;/p&gt;</description>
      <author>tim_lang</author>
      <pubDate>Mon, 05 May 2014 13:42:31 +0800</pubDate>
      <link>https://ruby-china.org/topics/19023</link>
      <guid>https://ruby-china.org/topics/19023</guid>
    </item>
    <item>
      <title>问个用正则分组的问题</title>
      <description>&lt;p&gt;比如我想已 1-9 以内的数字加。来分组，可以这样：&lt;/p&gt;
&lt;pre class="highlight ruby"&gt;&lt;code&gt;&lt;span class="s2"&gt;"xxxxx1.--------- 2.---------- 3.----------"&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;split&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sr"&gt;/(?=\d+\..+)/&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="c1"&gt;#["xxxxx", "1.--------- ", "2.---------- ", "3.----------"]&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;问题来了，如果以罗马数字来分组的话怎么匹配。1=I, 2=II, 3=III&lt;/p&gt;
&lt;pre class="highlight ruby"&gt;&lt;code&gt;&lt;span class="s2"&gt;"aaaaa I.-------- II.-------- III.---------"&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;split&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sr"&gt;/(?=(?:III)|(?:II)|(?:I)\.)/&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="c1"&gt;#["aaaaa ", "I.-------- ", "I", "I.-------- ", "I", "I", "I.---------"]&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;</description>
      <author>tim_lang</author>
      <pubDate>Thu, 16 Jan 2014 15:06:39 +0800</pubDate>
      <link>https://ruby-china.org/topics/16833</link>
      <guid>https://ruby-china.org/topics/16833</guid>
    </item>
    <item>
      <title>这算中奖了吗</title>
      <description>&lt;p&gt;&lt;img src="//l.ruby-china.com/photo/4138781920df4a49cae7a50f500f2c82.png" title="" alt=""&gt;&lt;/p&gt;

&lt;p&gt;哪位童鞋也遇到过啊，自己的库不能访问了，已发邮件给 support 了。。&lt;/p&gt;</description>
      <author>tim_lang</author>
      <pubDate>Thu, 15 Aug 2013 15:43:12 +0800</pubDate>
      <link>https://ruby-china.org/topics/13348</link>
      <guid>https://ruby-china.org/topics/13348</guid>
    </item>
    <item>
      <title>如何抓自己代码发起的 http 请求</title>
      <description>&lt;p&gt;我在代码中调试 http 访问第三方接口，&lt;/p&gt;

&lt;p&gt;我用的是 Charles，选了 mac proxy。但是抓不到 http 的请求信息，请问如何解决。&lt;/p&gt;</description>
      <author>tim_lang</author>
      <pubDate>Fri, 05 Jul 2013 14:56:58 +0800</pubDate>
      <link>https://ruby-china.org/topics/12273</link>
      <guid>https://ruby-china.org/topics/12273</guid>
    </item>
    <item>
      <title>看看多少人能翻译出来</title>
      <description>&lt;p&gt;Mental machines and Physical machines&lt;/p&gt;</description>
      <author>tim_lang</author>
      <pubDate>Wed, 03 Jul 2013 21:16:54 +0800</pubDate>
      <link>https://ruby-china.org/topics/12221</link>
      <guid>https://ruby-china.org/topics/12221</guid>
    </item>
  </channel>
</rss>
