<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <title>hardywu</title>
    <link>https://ruby-china.org/hardywu</link>
    <description></description>
    <language>en-us</language>
    <item>
      <title>minitest 怎么测试 sidetiq job</title>
      <description>&lt;p&gt;如题。sidetiq 每天固定时间段的邮件任务，请问要怎么用 minitest 来测试？&lt;/p&gt;</description>
      <author>hardywu</author>
      <pubDate>Sun, 02 Nov 2014 16:49:49 +0800</pubDate>
      <link>https://ruby-china.org/topics/22411</link>
      <guid>https://ruby-china.org/topics/22411</guid>
    </item>
    <item>
      <title>請問有外包經驗的，這項目要求文檔到底要多具體啊？</title>
      <description>&lt;p&gt;貌似那些做外包的都要非常詳細的需求文檔。這都是要多詳細才行啊。是不是要精細到每一個用戶點擊？&lt;/p&gt;</description>
      <author>hardywu</author>
      <pubDate>Fri, 24 Oct 2014 12:16:15 +0800</pubDate>
      <link>https://ruby-china.org/topics/22240</link>
      <guid>https://ruby-china.org/topics/22240</guid>
    </item>
    <item>
      <title>温州的创业公司怎么招人？</title>
      <description>&lt;p&gt;温州的一个朋友创业，急需一个 mobile 开发人员加入团队。请问温州的朋友，有什么靠谱的招人办法么？
目前正尝试招聘网站上发招聘，但温州这种小地方感觉这办法没什么戏。 &lt;/p&gt;</description>
      <author>hardywu</author>
      <pubDate>Sat, 04 Oct 2014 14:12:23 +0800</pubDate>
      <link>https://ruby-china.org/topics/21844</link>
      <guid>https://ruby-china.org/topics/21844</guid>
    </item>
    <item>
      <title>Mac 下 ElasticSearch 非常方便的 Preference Panel</title>
      <description>&lt;p&gt;&lt;a href="https://github.com/n2bh/ElasticSearch-PrefPane" rel="nofollow" target="_blank"&gt;https://github.com/n2bh/ElasticSearch-PrefPane&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;ElasticSearch Preference Pane for Mac OS X&lt;/p&gt;

&lt;p&gt;A simple System Preferences pane for starting and stopping the ElasticSearch daemon.&lt;/p&gt;
&lt;h2 id="Configuration"&gt;Configuration&lt;/h2&gt;
&lt;p&gt;By default, the settings provided will get you up and running if you installed ElasticSearch using Homebrew. However, if necessary, you can simply change the location of the ElasticSearch binary as well as the location for the PID file and any arguments you want passed to the ElasticSearch daemon.&lt;/p&gt;</description>
      <author>hardywu</author>
      <pubDate>Sat, 23 Aug 2014 03:56:37 +0800</pubDate>
      <link>https://ruby-china.org/topics/21189</link>
      <guid>https://ruby-china.org/topics/21189</guid>
    </item>
    <item>
      <title>关于 tokens, 10 件你必须知道的事</title>
      <description>&lt;p&gt;分享下 rest api 设计必读
&lt;a href="https://auth0.com/blog/2014/01/27/ten-things-you-should-know-about-tokens-and-cookies/#token-storage" rel="nofollow" target="_blank"&gt;https://auth0.com/blog/2014/01/27/ten-things-you-should-know-about-tokens-and-cookies/#token-storage&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;摘翻第一件事：&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Tokens need to be stored somewhere (local/session storage or cookies)
Tokens 需要保存在某处 (local/session storage or cookies)&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;In the context of tokens being used on single page applications, some people have brought up the issue about refreshing the browser, and what happens with the token. The answer is simple: you have to store the token somewhere: in session storage, local storage or a client side cookie. Most session storage polyfills fallback to cookies when the browser doesn't support it.&lt;/p&gt;

&lt;p&gt;在单页应用中，有人会问如果用户刷新页面怎么办，总要保存 tokens 吧。答案很简单：保存 token 在某些地方 session storage, local storage 或者 a client side cookie. 如果浏览器不支持，大部分 session storage polyfills 会回拨到 cookies.&lt;/p&gt;

&lt;p&gt;If you are wondering "but if I store the token in the cookie I'm back to square one". Not really, in this case you are using cookies as a storage mechanism, not as an authentication mechanism (i.e. the cookie won't be used by the web framework to authenticate a user, hence no XSRF attack)&lt;/p&gt;

&lt;p&gt;你可能会好奇“如果我保存 token 到 cookie, 我不是回到最开始了么”。在利用 cookies 做存储机制（不是验证 j 机制）的情况下，其实不会。（因为 cookie 不会被 web framework 拿来验证用户，所以便没有 XSRF 攻击）&lt;/p&gt;

&lt;p&gt;剩下的懒得翻译了，反正论坛里没人看不懂英文。&lt;/p&gt;</description>
      <author>hardywu</author>
      <pubDate>Fri, 22 Aug 2014 13:10:42 +0800</pubDate>
      <link>https://ruby-china.org/topics/21178</link>
      <guid>https://ruby-china.org/topics/21178</guid>
    </item>
    <item>
      <title>继 Lotus 之后，又来一个新轮子 Roda</title>
      <description>&lt;p&gt;Roda - routing based web framework
&lt;a href="http://roda.jeremyevans.net/index.html" rel="nofollow" target="_blank"&gt;http://roda.jeremyevans.net/index.html&lt;/a&gt;&lt;/p&gt;</description>
      <author>hardywu</author>
      <pubDate>Sat, 09 Aug 2014 13:46:54 +0800</pubDate>
      <link>https://ruby-china.org/topics/20928</link>
      <guid>https://ruby-china.org/topics/20928</guid>
    </item>
    <item>
      <title>假如我们要造一个除 Rails 外的新 ruby web framework，你会如何设计？</title>
      <description>&lt;p&gt;最近新出来一个 Lotus framework，但感觉和 rails 是同类作品。换汤不换药。
就如 hacknews 上有人说的，micro services 才是趋势。要面向未来重新设计一个框架的话，我认为应该从一开始就把前后端分离考虑在里面。如果让各位来设计的话，会如何做？&lt;/p&gt;</description>
      <author>hardywu</author>
      <pubDate>Tue, 01 Jul 2014 02:17:44 +0800</pubDate>
      <link>https://ruby-china.org/topics/20248</link>
      <guid>https://ruby-china.org/topics/20248</guid>
    </item>
    <item>
      <title>angular 在 rails 下必须用 minify safe 的写法。</title>
      <description>&lt;p&gt;被坑到了。
源代码如下&lt;/p&gt;
&lt;pre class="highlight coffeescript"&gt;&lt;code&gt;&lt;span class="nb"&gt;window&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="na"&gt;Scixiv&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="na"&gt;config&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;$httpProvider&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;
  &lt;span class="nx"&gt;authToken&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;$&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"meta[name=&lt;/span&gt;&lt;span class="se"&gt;\"&lt;/span&gt;&lt;span class="s"&gt;csrf-token&lt;/span&gt;&lt;span class="se"&gt;\"&lt;/span&gt;&lt;span class="s"&gt;]"&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="na"&gt;attr&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"content"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
  &lt;span class="nx"&gt;$httpProvider&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="na"&gt;defaults&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="na"&gt;headers&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="na"&gt;common&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s"&gt;"X-CSRF-TOKEN"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;authToken&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;在 development 下没问题，放 production 被 minify 之后就出问题。正确写法&lt;/p&gt;
&lt;pre class="highlight coffeescript"&gt;&lt;code&gt;&lt;span class="nb"&gt;window&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="na"&gt;Scixiv&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="na"&gt;config&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s"&gt;'$httpProvider'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;$httpProvider&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;
  &lt;span class="nx"&gt;authToken&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;$&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"meta[name=&lt;/span&gt;&lt;span class="se"&gt;\"&lt;/span&gt;&lt;span class="s"&gt;csrf-token&lt;/span&gt;&lt;span class="se"&gt;\"&lt;/span&gt;&lt;span class="s"&gt;]"&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="na"&gt;attr&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"content"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
  &lt;span class="nx"&gt;$httpProvider&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="na"&gt;defaults&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="na"&gt;headers&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="na"&gt;common&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s"&gt;"X-CSRF-TOKEN"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;authToken&lt;/span&gt;
&lt;span class="p"&gt;]&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;</description>
      <author>hardywu</author>
      <pubDate>Tue, 20 May 2014 10:32:29 +0800</pubDate>
      <link>https://ruby-china.org/topics/19405</link>
      <guid>https://ruby-china.org/topics/19405</guid>
    </item>
    <item>
      <title>ruby-china 的 css 无法载入</title>
      <description>&lt;p&gt;safari 报错
[Error] Failed to load resource: A server with the specified hostname could not be found. 
//l.ruby-china.com/assets/front-1a909fc4f255c12c1b613b3fe373e527.css &lt;/p&gt;

&lt;p&gt;chrome 情况类似。&lt;/p&gt;</description>
      <author>hardywu</author>
      <pubDate>Mon, 19 May 2014 01:49:31 +0800</pubDate>
      <link>https://ruby-china.org/topics/19363</link>
      <guid>https://ruby-china.org/topics/19363</guid>
    </item>
    <item>
      <title>scixiv 上线测试，开坑心得。 (找推广和前端伙伴)</title>
      <description>&lt;p&gt;关于 scixiv 详细的信息可以查看 &lt;a href="http://ruby-china.org/topics/15200" rel="nofollow" target="_blank"&gt;http://ruby-china.org/topics/15200&lt;/a&gt; 和 &lt;a href="http://gurudigger.com/products/36619/" rel="nofollow" target="_blank"&gt;http://gurudigger.com/products/36619/&lt;/a&gt; 。&lt;/p&gt;

&lt;p&gt;今天把 scixiv.com 的测试版 deploy 上线，算是迈出了一小步。从有这个想法并运行 &lt;code&gt;rails new scixiv&lt;/code&gt; 开始到现在差不多已有半年。期间甚至曾尝试过外包来减轻压力，结果赔了钱财还浪费了时间。还好咬牙自己坚持下来，写完了整个最初 MVP 的后端。前端目前和 cassiuschen 合作一起在写，勉强赶在这个周末结束前完成 MVP。作为我第一个正式 rails 项目，又是各种赶工。bugs 多肯定是避免不了的（测试代码没写完），争取日后不断改进。&lt;/p&gt;

&lt;p&gt;期间还领悟到一个心得：写后端的时候就应该专心弄后端，别理会前端的代码有多丑。顿时后端代码速度暴增。而且其实也不会影响前端代码，反正一开始的前端代码终究都是要经历各种折腾的。&lt;/p&gt;

&lt;p&gt;现在 app 的 models 数量从几个涨到快 20 个，越写越发现要完成所预期的功能，有 N 多的坑要填，工作量的预期不断被刷新。然后一看 discourse, 83 个 model。...... 再一想到推广的工作，遍开始头疼。&lt;/p&gt;

&lt;p&gt;在全是程序员的论坛里，能找到有推广经验的朋友么？&lt;/p&gt;</description>
      <author>hardywu</author>
      <pubDate>Mon, 17 Mar 2014 07:17:15 +0800</pubDate>
      <link>https://ruby-china.org/topics/17927</link>
      <guid>https://ruby-china.org/topics/17927</guid>
    </item>
    <item>
      <title>polymorphic 关联的 model, 在 form 中如何写成 select tag</title>
      <description>&lt;p&gt;如题&lt;/p&gt;
&lt;pre class="highlight ruby"&gt;&lt;code&gt;&lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="n"&gt;apple&lt;/span&gt;  &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="no"&gt;ActiveRecord&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="no"&gt;Base&lt;/span&gt;
  &lt;span class="n"&gt;belongs_to&lt;/span&gt; &lt;span class="ss"&gt;:dinner&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="ss"&gt;as: :fruit&lt;/span&gt;
&lt;span class="k"&gt;end&lt;/span&gt;

&lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="n"&gt;peach&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="no"&gt;ActiveRecord&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="no"&gt;Base&lt;/span&gt;
  &lt;span class="n"&gt;belongs_to&lt;/span&gt; &lt;span class="ss"&gt;:dinner&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="ss"&gt;as: :fruit&lt;/span&gt;
&lt;span class="k"&gt;end&lt;/span&gt;

&lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="n"&gt;dinner&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="no"&gt;ActiveRecord&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="no"&gt;Base&lt;/span&gt;
  &lt;span class="n"&gt;has_many&lt;/span&gt; &lt;span class="ss"&gt;:fruits&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="ss"&gt;polymorphic: &lt;/span&gt;&lt;span class="kp"&gt;true&lt;/span&gt;
  &lt;span class="n"&gt;accepts_nested_attributes_for&lt;/span&gt; &lt;span class="ss"&gt;:fruits&lt;/span&gt;
&lt;span class="k"&gt;end&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;如果我想 create 一个 dinner record, 希望能有一个&lt;/p&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;= form_for @dinner do |f|
  = f.field_for :fruit do |p|
    = p.text_field :fruit_id
    = p.text_field :fruit_type

  = f.submit
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;总不能让用户填写 id 和 class 名，有什么最好的办法把上面的两个 text_field 换成一个 select tag?&lt;/p&gt;</description>
      <author>hardywu</author>
      <pubDate>Wed, 19 Feb 2014 07:04:08 +0800</pubDate>
      <link>https://ruby-china.org/topics/17343</link>
      <guid>https://ruby-china.org/topics/17343</guid>
    </item>
    <item>
      <title>怎么获取 url 链接的 html 内容来更新表单</title>
      <description>&lt;p&gt;想给网站的收藏文章功能添加自动抓取的功能。已有的表单&lt;/p&gt;
&lt;pre class="highlight slim"&gt;&lt;code&gt;&lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="n"&gt;form_for&lt;/span&gt; &lt;span class="vi"&gt;@article&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="ss"&gt;remote: &lt;/span&gt;&lt;span class="kp"&gt;false&lt;/span&gt; &lt;span class="k"&gt;do&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt;&lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="o"&gt;|&lt;/span&gt;
  &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;text_field&lt;/span&gt; &lt;span class="ss"&gt;:title&lt;/span&gt;
  &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;url_field&lt;/span&gt; &lt;span class="ss"&gt;:external_url&lt;/span&gt;
  &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;text_area&lt;/span&gt; &lt;span class="ss"&gt;:content&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="ss"&gt;as: :text&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="ss"&gt;:rows&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="s2"&gt;"20"&lt;/span&gt;

  &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;submit&lt;/span&gt; &lt;span class="s2"&gt;"submit"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;虽然可以在脚本中用 open-uri 和 nokogiri 来抓取 external_url 链接的文章 title 和 content，但没法在表单上做到动态更新 title 和 content。 &lt;/p&gt;

&lt;p&gt;有哪位高手可以分享下经验么？ &lt;/p&gt;</description>
      <author>hardywu</author>
      <pubDate>Tue, 04 Feb 2014 04:27:39 +0800</pubDate>
      <link>https://ruby-china.org/topics/17074</link>
      <guid>https://ruby-china.org/topics/17074</guid>
    </item>
    <item>
      <title>mongoid 为什么设置 polymorphic ID 不是 ObjectID？</title>
      <description>&lt;p&gt;感觉很奇怪的设计。这不符合习惯吧。&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/mongoid/mongoid/pull/3386" rel="nofollow" target="_blank"&gt;https://github.com/mongoid/mongoid/pull/3386&lt;/a&gt;&lt;/p&gt;</description>
      <author>hardywu</author>
      <pubDate>Sat, 21 Dec 2013 14:10:16 +0800</pubDate>
      <link>https://ruby-china.org/topics/16355</link>
      <guid>https://ruby-china.org/topics/16355</guid>
    </item>
    <item>
      <title>ruby-china 的测试代码中用的 Factory 语法是哪里定义的？</title>
      <description>&lt;h2 id="Update: It is merely that  the new FactoryGirl is incompatible with the old syntax."&gt;Update: It is merely that  the new FactoryGirl is incompatible with the old syntax.&lt;/h2&gt;
&lt;p&gt;发现测试中有很多这类代码，能请问下这是哪里定义的么？&lt;/p&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;let(:site_node) { Factory :site_node }
&lt;/code&gt;&lt;/pre&gt;</description>
      <author>hardywu</author>
      <pubDate>Tue, 17 Dec 2013 23:55:01 +0800</pubDate>
      <link>https://ruby-china.org/topics/16260</link>
      <guid>https://ruby-china.org/topics/16260</guid>
    </item>
    <item>
      <title>simple_form is not worth the trouble. </title>
      <description>&lt;p&gt;从 stackexchange 上看到的一个回复 by Andrew Hacking，随手分享下：&lt;/p&gt;

&lt;p&gt;In my own experience with Bootstrap and simple_form / form_builder approach is that simple_form is not worth the 
trouble. There are just too many things that simple form has no answer for layout and control wise, some key black spots being classes on wrapper tags, selects with html attributes, or doing something simple like bootstrap button groups that mimic toggle/radio buttons. The i18n support in simple_form has also been a challenge, requiring a lot of duplication.&lt;/p&gt;

&lt;p&gt;Also consider if server side rendering is the right approach for a modern application. I am transitioning from traditional rails/server-side rendering to a SPA (Single Page Application) model. To do this I'm using backbone.js and marionette with eco templates and coffeescript.&lt;/p&gt;

&lt;p&gt;Architecturally the simple_form / rails form builder approach seems kind of flawed and within it has a lot of convoluted code for essentially building a html string fragment.&lt;/p&gt;

&lt;p&gt;Well I say that is what view templates are for!&lt;/p&gt;

&lt;p&gt;At the end of the day a view is composed from many different sub-view templates (eg partials), and I think it should go right down to control/field components. In contrast, the builder approach is always caught out with lack of support for different jquery components and is not really agile enough to keep pace.&lt;/p&gt;

&lt;p&gt;I'd suggest using parameterised view templates/partials that codify the markup you want for each type of control/component or view construct in your app and simply compose them to get the layout you want. If you're doing this server side, you could wrap up all the render partial calls with some helpers for syntactical sweetness. If you're doing it client side with say eco templates, check the main page, you will see an example of defining and calling form building templates there.&lt;/p&gt;

&lt;p&gt;Don't lock yourself into the capabilities of a form builder, use the boostrap documentation examples as the starting point for your templates and simply call them!&lt;/p&gt;</description>
      <author>hardywu</author>
      <pubDate>Mon, 18 Nov 2013 09:16:08 +0800</pubDate>
      <link>https://ruby-china.org/topics/15609</link>
      <guid>https://ruby-china.org/topics/15609</guid>
    </item>
    <item>
      <title>[已解决] mongoid 的短板？无法实现 accepts_nested_attributes_for 的 find_or_create 方式</title>
      <description>&lt;p&gt;&lt;strong&gt;update&lt;/strong&gt;
完美解决 
&lt;a href="http://wuinm.com/notes/2014/01/24/selective-save-or-update-for-nested-attribute-updating-in-rails.html" rel="nofollow" target="_blank"&gt;http://wuinm.com/notes/2014/01/24/selective-save-or-update-for-nested-attribute-updating-in-rails.html&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;= = = = = = = == == = =&lt;/p&gt;

&lt;p&gt;类似的问题
&lt;a href="http://stackoverflow.com/questions/3579924/accepts-nested-attributes-for-with-find-or-create" rel="nofollow" target="_blank"&gt;http://stackoverflow.com/questions/3579924/accepts-nested-attributes-for-with-find-or-create&lt;/a&gt;&lt;/p&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;accepts_nested_attributes_for : aliases
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;怎么样实现创建 aliases 的时候是 find_or_create 模式，从而确保不重复创建。stackoverflow 只给出了单个的形式，而且在 mongoid 下没法实现。&lt;/p&gt;</description>
      <author>hardywu</author>
      <pubDate>Fri, 15 Nov 2013 08:55:22 +0800</pubDate>
      <link>https://ruby-china.org/topics/15553</link>
      <guid>https://ruby-china.org/topics/15553</guid>
    </item>
    <item>
      <title>[远程] 创业团队招合作人</title>
      <description>&lt;h2 id="介绍："&gt;介绍：&lt;/h2&gt;
&lt;p&gt;金融创业团队。我们团队非常小规模，(population = 2)。目前投资收益率在年化 25% 左右，正在温州发展线下投资人。说难听点就是私募，已经在盈利了。&lt;/p&gt;

&lt;p&gt;这次招聘是因为对将来的发展策略做了调整，想转型引入互联网基因。起因大家都懂的 (余额宝)。我们的思路也很简单，就是利用支付宝，让客户充值购买刀币（暂名) 或者点数。并且应许用户之间在网站内交易刀币，以此来搭建电商平台。刀币按批发售，每批周期三个月，到期自动结算，按照 103% 的比例退回用户银行账户。所以理论上，这个平台对商家的交易手续费是 -3% (注意负号）。比较注意的是虽然我们的刀币是按期结算，不能即使提现，但本身周期非常短，才三个月，所以相信商家还是能接受的。&lt;/p&gt;
&lt;h2 id="优势："&gt;优势：&lt;/h2&gt;
&lt;p&gt;103% 的三个月到期结算比例，高于国内任何一家理财机构，余额宝一年也就这个数左右。所以我们对产品的吸引力还是有信心的。因为我们会一直有盈利，所以死不掉。负手续费对销售数字类产品的商家很有帮助，放心开卖￥0.99 的文章和音乐吧。&lt;/p&gt;

&lt;p&gt;So, 我们目前需要一个全职 rails 开发员。&lt;/p&gt;
&lt;h2 id="要求："&gt;要求：&lt;/h2&gt;
&lt;ol&gt;
&lt;li&gt;博士后学位（开玩笑的，其实没学历也行）&lt;/li&gt;
&lt;li&gt;爱折腾，喜欢 linux/unix。&lt;/li&gt;
&lt;li&gt;web 开发经验，（没有 rails 经验的也不会来这个论坛） &lt;/li&gt;
&lt;li&gt;我们用 mongodb&lt;/li&gt;
&lt;li&gt;我们使用 git. 代码管理在 Bitbucket&lt;/li&gt;
&lt;li&gt;了解 memcached/redis 等缓存工具 的 加分&lt;/li&gt;
&lt;li&gt;AngularJs 熟悉的加分&lt;/li&gt;
&lt;li&gt;Android 或 iOS 开发 熟悉的 加分&lt;/li&gt;
&lt;li&gt;英文听说读写加分 (业务没必要限制在国内嘛）&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;以上都是废话，其实上就想要找个学习能力强，有代码洁癖的合作人。能随着业务增加，不断学习提高的才是我们需要的合作人。我们有一半 (1) 的成员是在用 rails，可惜都不是很专业。&lt;/p&gt;
&lt;h2 id="待遇："&gt;待遇：&lt;/h2&gt;
&lt;p&gt;RMB4000+/月（根据水平可以增加，但最少这个数） + 期权。按照合作人水平或者后期的提升给于期权。&lt;/p&gt;
&lt;h2 id="工作模式："&gt;工作模式：&lt;/h2&gt;
&lt;p&gt;远程办公。参考 
&lt;a href="http://37signals.com/remote/" rel="nofollow" target="_blank"&gt;http://37signals.com/remote/&lt;/a&gt;
和 &lt;a href="/yedingding" class="user-mention" title="@yedingding"&gt;&lt;i&gt;@&lt;/i&gt;yedingding&lt;/a&gt; 的
&lt;a href="http://ruby-china.org/topics/12738" rel="nofollow" target="_blank"&gt;http://ruby-china.org/topics/12738&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;浙江或者上海的合作人，我们可以亲自跑去聊聊。尤其上海的同学比较有福，因为将来公司会迁至上海。&lt;/p&gt;
&lt;h2 id="联系方式"&gt;联系方式&lt;/h2&gt;
&lt;p&gt;邮件：hardy0wu@gmail.com
电话：86-187-5708-4569    或者 1-612-205-4615&lt;/p&gt;</description>
      <author>hardywu</author>
      <pubDate>Fri, 08 Nov 2013 01:13:41 +0800</pubDate>
      <link>https://ruby-china.org/topics/15384</link>
      <guid>https://ruby-china.org/topics/15384</guid>
    </item>
    <item>
      <title>一个自由期刊平台: scixiv.com</title>
      <description>&lt;p&gt;** UPDATE 03/09 **
功能写完，开始写测试代码。&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;begin update&lt;/strong&gt;
网站的 MVP 版现在基本可以使用了，缺前端的人手。。求人参与。求提建议。
&lt;strong&gt;end update&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;谢谢各位的留言。我注册了域名，放了个 starter page。业余时间慢慢做。&lt;/p&gt;

&lt;p&gt;&lt;a href="http://www.scixiv.com" rel="nofollow" target="_blank" title=""&gt;www.scixiv.com&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;begin update&lt;/strong&gt;
根据&lt;a href="/Rei" class="user-mention" title="@Rei"&gt;&lt;i&gt;@&lt;/i&gt;Rei&lt;/a&gt; 的提问完善下这个想法。&lt;/p&gt;

&lt;p&gt;这个想法的初衷是因为长期泡互联网，希望有工具能改变网民间低效的讨论模式，并帮助作者提高文章的爆光度。&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;目标用户是谁&lt;br&gt;
覆盖面主要是网上的博客作者，和只能 feedly 这类工具阅读的读者。基本上喜欢逛论坛，看博客，关注新闻的人都算是希望覆盖的用户。&lt;/li&gt;
&lt;li&gt;同类产品有什么&lt;br&gt;
用类产品有一个。&lt;a href="http://arxiv.org/" rel="nofollow" target="_blank" title=""&gt;arxiv&lt;/a&gt;. 但这只针对理工科的研究员发论文备案之用。其他专业类的期刊就太多了，但只针对院校学生和可以工作者，收费高昂。  &lt;strong&gt;update&lt;/strong&gt;  或者比较接近的&lt;a href="www.plos.org/%E2%80%8E" title=""&gt;plos&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;团队有几个人&lt;br&gt;
很不幸，团队就我一人。&lt;/li&gt;
&lt;li&gt;如何运营和推广&lt;br&gt;
希望从作者邀稿开始。对高质量的文章向作者发出邀请，做文章收录并提供类似 DOI 的数字对象识别号。&lt;/li&gt;
&lt;li&gt;版权如何处理&lt;br&gt;
互联网博客本身就不注重版权。具体版权协议有用户建立的期刊委员会决定。CC3，GNU，或者 保留所有权益。&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;end update&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;让用户自己建委员会，发布期刊，收集网络各处文章，整理成册。各位觉得靠谱么？&lt;/p&gt;

&lt;p&gt;尤其想听听刚刚关闭了 writings.io 的 &lt;a href="/Rei" class="user-mention" title="@Rei"&gt;&lt;i&gt;@&lt;/i&gt;Rei&lt;/a&gt;  的看法。&lt;/p&gt;</description>
      <author>hardywu</author>
      <pubDate>Fri, 01 Nov 2013 09:21:11 +0800</pubDate>
      <link>https://ruby-china.org/topics/15200</link>
      <guid>https://ruby-china.org/topics/15200</guid>
    </item>
    <item>
      <title>一起床刚开网页就抢到了 nexus 5</title>
      <description>&lt;p&gt;发帖庆祝下。&lt;/p&gt;</description>
      <author>hardywu</author>
      <pubDate>Fri, 01 Nov 2013 04:00:15 +0800</pubDate>
      <link>https://ruby-china.org/topics/15199</link>
      <guid>https://ruby-china.org/topics/15199</guid>
    </item>
    <item>
      <title>这次升级 Mavericks 的体验就是 “屎” 啊</title>
      <description>&lt;p&gt;软件卡顿，Mail.app 打不开。烦&lt;/p&gt;</description>
      <author>hardywu</author>
      <pubDate>Sun, 27 Oct 2013 07:06:03 +0800</pubDate>
      <link>https://ruby-china.org/topics/15061</link>
      <guid>https://ruby-china.org/topics/15061</guid>
    </item>
  </channel>
</rss>
