<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <title>hlcfan (Alex Shi)</title>
    <link>https://ruby-china.org/hlcfan</link>
    <description>huh</description>
    <language>en-us</language>
    <item>
      <title>AssetPipeline JS 文件可以预编译一次然后多处引用吗？</title>
      <description>&lt;p&gt;项目 JS 文件组织大概如下：&lt;/p&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;-- javascripts:
    -- controllers
        -- home_controller.js
        -- posts_controller.js
    -- modules
        -- social
        -- tracking
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;比如在 &lt;code&gt;posts_controller.js&lt;/code&gt; 和 &lt;code&gt;home_controller.js&lt;/code&gt; 里同时 &lt;code&gt;require tracking&lt;/code&gt;，会造成 &lt;code&gt;tracking.js&lt;/code&gt; 文件被编译两次。&lt;/p&gt;

&lt;p&gt;有办法可以避免这样被多次编译吗？&lt;/p&gt;</description>
      <author>hlcfan</author>
      <pubDate>Mon, 20 Feb 2017 22:21:09 +0800</pubDate>
      <link>https://ruby-china.org/topics/32346</link>
      <guid>https://ruby-china.org/topics/32346</guid>
    </item>
    <item>
      <title>做了一个 pointing poker，欢迎试用</title>
      <description>&lt;h2 id="为啥自己做"&gt;为啥自己做&lt;/h2&gt;
&lt;p&gt;主要原因还是网络问题，网上的一些 pointing poker 使用起来总不是那么流畅。最近抽时间做了一个 poker，现在功能差不多了，贴出来大家有机会可以试试，多提意见。&lt;img title=":grinning:" alt="😀" src="https://twemoji.ruby-china.com/2/svg/1f600.svg" class="twemoji"&gt; 
&lt;img src="https://l.ruby-china.com/photo/2016/83063025be7e8c1e4ef67ddcdd6bf46e.png!large" title="" alt=""&gt;&lt;/p&gt;
&lt;h2 id="技术栈"&gt;技术栈&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Rails 5&lt;/li&gt;
&lt;li&gt;ActionCable&lt;/li&gt;
&lt;li&gt;React&lt;/li&gt;
&lt;li&gt;Puma&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="链接: https://agilemana.com"&gt;链接：&lt;a href="https://agilemana.com" rel="nofollow" target="_blank"&gt;https://agilemana.com&lt;/a&gt;
&lt;/h2&gt;&lt;h2 id="Repo: https://github.com/hlcfan/pokr"&gt;Repo: &lt;a href="https://github.com/hlcfan/pokr" rel="nofollow" target="_blank"&gt;https://github.com/hlcfan/pokr&lt;/a&gt;
&lt;/h2&gt;</description>
      <author>hlcfan</author>
      <pubDate>Fri, 22 Jul 2016 14:12:38 +0800</pubDate>
      <link>https://ruby-china.org/topics/30601</link>
      <guid>https://ruby-china.org/topics/30601</guid>
    </item>
    <item>
      <title>MBP 回车键翘起来了 怎么破？</title>
      <description>&lt;p&gt;大家好，&lt;/p&gt;

&lt;p&gt;MBP 今天突然回车键突然翘起来了，有什么办法修么？没弄过，请教。&lt;/p&gt;

&lt;p&gt;&lt;img src="https://l.ruby-china.com/photo/2014/b5b8c8e2e275e0ea1d3ed22807ff5f13.png" title="" alt=""&gt;&lt;/p&gt;</description>
      <author>hlcfan</author>
      <pubDate>Thu, 11 Sep 2014 16:26:58 +0800</pubDate>
      <link>https://ruby-china.org/topics/21480</link>
      <guid>https://ruby-china.org/topics/21480</guid>
    </item>
    <item>
      <title>帖子右侧 节点下其他话题 下出现原帖</title>
      <description>&lt;p&gt;有没有发现个问题，帖子右侧&lt;strong&gt;节点下其他话题&lt;/strong&gt;下，有原帖，应该是被过滤掉的。
我看了下代码没问题。
举个栗子：
&lt;a href="http://ruby-china.org/topics/19326" rel="nofollow" target="_blank"&gt;http://ruby-china.org/topics/19326&lt;/a&gt;
&lt;a href="http://ruby-china.org/topics/19324" rel="nofollow" target="_blank"&gt;http://ruby-china.org/topics/19324&lt;/a&gt;
&lt;a href="http://ruby-china.org/topics/19327" rel="nofollow" target="_blank"&gt;http://ruby-china.org/topics/19327&lt;/a&gt;&lt;/p&gt;</description>
      <author>hlcfan</author>
      <pubDate>Sat, 17 May 2014 19:20:00 +0800</pubDate>
      <link>https://ruby-china.org/topics/19329</link>
      <guid>https://ruby-china.org/topics/19329</guid>
    </item>
    <item>
      <title>写了一个七牛单个和批量上传图片的包, 和大家分享下 ( 主要是官方的不好用</title>
      <description>&lt;p&gt;主要还是官方提供的不太好用，,,自己写了个.
&lt;a href="https://github.com/hlcfan/QiniuUploader" rel="nofollow" target="_blank" title=""&gt;https://github.com/hlcfan/QiniuUploader&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;就是封装了一下，对外提供了三个接口：&lt;/p&gt;
&lt;pre class="highlight objective_c"&gt;&lt;code&gt;&lt;span class="k"&gt;+&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;NSDictionary&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="nf"&gt;prepareUploadContent&lt;/span&gt;&lt;span class="p"&gt;:(&lt;/span&gt;&lt;span class="n"&gt;NSDictionary&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="nv"&gt;theInfo&lt;/span&gt; &lt;span class="nf"&gt;filename&lt;/span&gt;&lt;span class="p"&gt;:(&lt;/span&gt;&lt;span class="n"&gt;NSString&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="nv"&gt;filename&lt;/span&gt; &lt;span class="nf"&gt;format&lt;/span&gt;&lt;span class="p"&gt;:(&lt;/span&gt;&lt;span class="n"&gt;NSString&lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="nv"&gt;format&lt;/span&gt; &lt;span class="nf"&gt;bucket&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;NSString&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="nv"&gt;bucket&lt;/span&gt; &lt;span class="nf"&gt;imageCompress&lt;/span&gt;&lt;span class="p"&gt;:(&lt;/span&gt;&lt;span class="n"&gt;UIImage&lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;^&lt;/span&gt;&lt;span class="p"&gt;)(&lt;/span&gt;&lt;span class="n"&gt;UIImage&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="n"&gt;image&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt; &lt;span class="n"&gt;block&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;-&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;id&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="nf"&gt;initWithAccessKey&lt;/span&gt;&lt;span class="p"&gt;:(&lt;/span&gt;&lt;span class="n"&gt;NSString&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="nv"&gt;accessKey&lt;/span&gt; &lt;span class="nf"&gt;secretKey&lt;/span&gt;&lt;span class="p"&gt;:(&lt;/span&gt;&lt;span class="n"&gt;NSString&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="nv"&gt;secretKey&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;-&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;BOOL&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="nf"&gt;startUploadFiles&lt;/span&gt;&lt;span class="p"&gt;:(&lt;/span&gt;&lt;span class="n"&gt;NSArray&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="nv"&gt;uploadArray&lt;/span&gt; &lt;span class="nf"&gt;progress&lt;/span&gt;&lt;span class="p"&gt;:(&lt;/span&gt;&lt;span class="kt"&gt;void&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;^&lt;/span&gt;&lt;span class="p"&gt;)(&lt;/span&gt;&lt;span class="kt"&gt;float&lt;/span&gt; &lt;span class="n"&gt;percentage&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;&lt;span class="nv"&gt;progressBlock&lt;/span&gt; &lt;span class="nf"&gt;complete&lt;/span&gt;&lt;span class="p"&gt;:(&lt;/span&gt;&lt;span class="kt"&gt;void&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;^&lt;/span&gt;&lt;span class="p"&gt;)(&lt;/span&gt;&lt;span class="n"&gt;NSMutableDictionary&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="n"&gt;result&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt; &lt;span class="n"&gt;block&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;</description>
      <author>hlcfan</author>
      <pubDate>Mon, 20 Jan 2014 23:48:44 +0800</pubDate>
      <link>https://ruby-china.org/topics/16896</link>
      <guid>https://ruby-china.org/topics/16896</guid>
    </item>
    <item>
      <title>The Marriage of Figaro… and Rails</title>
      <description>&lt;blockquote&gt;
&lt;p&gt;In the wee hours of this morning, DHH shipped Rails 4.1.0.beta1 with support for a config/secrets.yml file, which is strikingly similar to Figaro’s config/application.yml in its function.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;a href="http://collectiveidea.com/blog/archives/2013/12/18/the-marriage-of-figaro-and-rails/" rel="nofollow" target="_blank"&gt;http://collectiveidea.com/blog/archives/2013/12/18/the-marriage-of-figaro-and-rails/&lt;/a&gt;&lt;/p&gt;</description>
      <author>hlcfan</author>
      <pubDate>Thu, 19 Dec 2013 10:51:21 +0800</pubDate>
      <link>https://ruby-china.org/topics/16304</link>
      <guid>https://ruby-china.org/topics/16304</guid>
    </item>
    <item>
      <title>MongoDB log 打印两次，而且查询耗时不同</title>
      <description>&lt;p&gt;Log:&lt;/p&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;[2013-09-18 11:57:39][DEBUG][3666] -- MONGODB (31.6ms)  posts_db['user_posts'].find({:uid=&amp;gt;1, :iid=&amp;gt;{"$in"=&amp;gt; [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]}})
[2013-09-18 11:57:39][DEBUG][3666] -- MONGODB (30.9ms) posts_db['user_posts'].find({:uid=&amp;gt;1, :iid=&amp;gt;{"$in"=&amp;gt;[1, 2, 3, 4, 5, 6, 7, 8, 9, 10]}})
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;两次查询是同一时间，但是查询耗时不一样。代码没有重复，是 log 打印的有问题吗？&lt;/p&gt;</description>
      <author>hlcfan</author>
      <pubDate>Wed, 18 Sep 2013 12:04:06 +0800</pubDate>
      <link>https://ruby-china.org/topics/14207</link>
      <guid>https://ruby-china.org/topics/14207</guid>
    </item>
    <item>
      <title>启动 Solr 后需要手动生成索引文件吗？</title>
      <description>&lt;p&gt;我按照 github sunspot 的文档安装了 solr。
在 Post 模型中加入了 searchable 块
Post Model:&lt;/p&gt;
&lt;pre class="highlight ruby"&gt;&lt;code&gt;&lt;span class="n"&gt;searchable&lt;/span&gt; &lt;span class="k"&gt;do&lt;/span&gt;
  &lt;span class="n"&gt;text&lt;/span&gt; &lt;span class="ss"&gt;:title&lt;/span&gt; &lt;span class="c1"&gt;#, :description&lt;/span&gt;
&lt;span class="k"&gt;end&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;启动 Solor，&lt;code&gt;rake sunspot:solr:start&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;为什么搜索的时候搜不到？是没有索引吗？&lt;/p&gt;</description>
      <author>hlcfan</author>
      <pubDate>Sat, 14 Sep 2013 18:45:37 +0800</pubDate>
      <link>https://ruby-china.org/topics/14120</link>
      <guid>https://ruby-china.org/topics/14120</guid>
    </item>
    <item>
      <title>各位网站部署完,编译 Assets 需要花多长时间?</title>
      <description>&lt;h3 id="各位网站部署完,编译assets需要花多长时间?"&gt;各位网站部署完，编译 assets 需要花多长时间？&lt;/h3&gt;
&lt;p&gt;我们大概需要将近 1 分钟，感觉太长了.
用的是 &lt;code&gt;yui-compressor&lt;/code&gt;和&lt;code&gt;uglify&lt;/code&gt;&lt;/p&gt;</description>
      <author>hlcfan</author>
      <pubDate>Sat, 18 May 2013 22:37:43 +0800</pubDate>
      <link>https://ruby-china.org/topics/11086</link>
      <guid>https://ruby-china.org/topics/11086</guid>
    </item>
    <item>
      <title>为什么先出样式,然后出文字?</title>
      <description>&lt;h3 id="为什么先出样式,然后出文字?"&gt;为什么先出样式，然后出文字？&lt;/h3&gt;
&lt;p&gt;我看很多 github pages 也是这样&lt;/p&gt;</description>
      <author>hlcfan</author>
      <pubDate>Sat, 11 May 2013 15:19:48 +0800</pubDate>
      <link>https://ruby-china.org/topics/10899</link>
      <guid>https://ruby-china.org/topics/10899</guid>
    </item>
    <item>
      <title>gem，initializers 加载顺序问题</title>
      <description>&lt;p&gt;RaisGuides 说 initializers 是在框架，插件，和 gems 加载完之后才加载的，那 weibo_api_key,secret 是写在 initializers 下的。这样就会导致 gems 取不到 key 和 secret，这样的问题怎么解决？&lt;/p&gt;</description>
      <author>hlcfan</author>
      <pubDate>Tue, 23 Apr 2013 11:37:29 +0800</pubDate>
      <link>https://ruby-china.org/topics/10429</link>
      <guid>https://ruby-china.org/topics/10429</guid>
    </item>
    <item>
      <title>跨域使用 getJSON 提交，如何避免恶意多次提交？</title>
      <description>&lt;h3 id="跨域使用 getJSON 提交，如何避免恶意多次提交？"&gt;跨域使用 getJSON 提交，如何避免恶意多次提交？&lt;/h3&gt;</description>
      <author>hlcfan</author>
      <pubDate>Sun, 17 Mar 2013 13:53:39 +0800</pubDate>
      <link>https://ruby-china.org/topics/9501</link>
      <guid>https://ruby-china.org/topics/9501</guid>
    </item>
    <item>
      <title>帖子没有必要分页</title>
      <description>&lt;h4 id="我觉得帖子没有必要分页."&gt;我觉得帖子没有必要分页。&lt;/h4&gt;
&lt;p&gt;原因：&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;看起来没有连贯性&lt;/li&gt;
&lt;li&gt;翻页麻烦&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;至于，流量问题，或者采用加载更多来代替分页。&lt;/strong&gt;&lt;/p&gt;</description>
      <author>hlcfan</author>
      <pubDate>Sat, 16 Mar 2013 23:38:30 +0800</pubDate>
      <link>https://ruby-china.org/topics/9488</link>
      <guid>https://ruby-china.org/topics/9488</guid>
    </item>
    <item>
      <title>如何在项目中指定另一个数据库？</title>
      <description>&lt;p&gt;如何在项目中指定另一个数据库？&lt;/p&gt;

&lt;p&gt;项目不止一个数据库，怎么指定另一个数据库？&lt;/p&gt;</description>
      <author>hlcfan</author>
      <pubDate>Tue, 16 Oct 2012 09:29:43 +0800</pubDate>
      <link>https://ruby-china.org/topics/6086</link>
      <guid>https://ruby-china.org/topics/6086</guid>
    </item>
    <item>
      <title>有什么 gem 可以裁剪图片？</title>
      <description>&lt;p&gt;我想把图片裁成一定尺寸（不是 resize），尽量使图片不变形。&lt;/p&gt;</description>
      <author>hlcfan</author>
      <pubDate>Wed, 12 Sep 2012 13:37:15 +0800</pubDate>
      <link>https://ruby-china.org/topics/5499</link>
      <guid>https://ruby-china.org/topics/5499</guid>
    </item>
    <item>
      <title>haml 中 helper_method 的参数问题</title>
      <description>&lt;pre class="highlight plaintext"&gt;&lt;code&gt;- @notifies.each do |n|
    %tr
        %td
            = getcomment n[1]       
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;n 是 Array
方法 getcomment 接到的参数并不是&lt;code&gt;n[1]&lt;/code&gt;的值，而是'n[1]'
怎让让它接到正确的值？&lt;/p&gt;</description>
      <author>hlcfan</author>
      <pubDate>Wed, 29 Aug 2012 14:56:56 +0800</pubDate>
      <link>https://ruby-china.org/topics/5226</link>
      <guid>https://ruby-china.org/topics/5226</guid>
    </item>
    <item>
      <title>[重新描述] 在 DB 挂掉的时刻,怎么保证另一个不需要挂掉 DB 的网页可以正常浏览？</title>
      <description>&lt;h4 id="描述"&gt;描述&lt;/h4&gt;
&lt;p&gt;Server:Passenger
设想下：一个有多个数据库的程序在跑的过程中，一个数据库挂掉了，挂掉的叫 DB1，那么整个 rails 程序就会出错。&lt;/p&gt;

&lt;p&gt;怎么保证在另一个不需要挂掉的数据库 DB1，的页面中可以继续浏览？&lt;/p&gt;</description>
      <author>hlcfan</author>
      <pubDate>Tue, 28 Aug 2012 09:16:13 +0800</pubDate>
      <link>https://ruby-china.org/topics/5196</link>
      <guid>https://ruby-china.org/topics/5196</guid>
    </item>
    <item>
      <title>Datamapper 怎么实现 where？</title>
      <description>&lt;p&gt;大家好
第一次用 Sinatra + Datamapper，尝试也在网上搜，没找到类似于 Ative Record 中&lt;code&gt;Model.where&lt;/code&gt;的方法。不知道怎么写，求指教。&lt;/p&gt;</description>
      <author>hlcfan</author>
      <pubDate>Mon, 27 Aug 2012 17:00:47 +0800</pubDate>
      <link>https://ruby-china.org/topics/5185</link>
      <guid>https://ruby-china.org/topics/5185</guid>
    </item>
    <item>
      <title>Bootstrap 新版是不是 navigator 变成白色了？</title>
      <description>&lt;p&gt;Bootstrap 新版是不是 navigator 变成白色了？&lt;/p&gt;</description>
      <author>hlcfan</author>
      <pubDate>Thu, 23 Aug 2012 17:20:56 +0800</pubDate>
      <link>https://ruby-china.org/topics/5109</link>
      <guid>https://ruby-china.org/topics/5109</guid>
    </item>
    <item>
      <title>我想把世界分成一小块一小块，可以什么 Map API 或服务？</title>
      <description>&lt;p&gt;我想把世界分成一小块一小块，可以什么 Map API 或服务？&lt;/p&gt;

&lt;p&gt;比如北京，分了海淀区，昌平区。每个区就是一块。&lt;/p&gt;</description>
      <author>hlcfan</author>
      <pubDate>Wed, 25 Jul 2012 14:13:02 +0800</pubDate>
      <link>https://ruby-china.org/topics/4545</link>
      <guid>https://ruby-china.org/topics/4545</guid>
    </item>
  </channel>
</rss>
