<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <title>niedhui</title>
    <link>https://ruby-china.org/niedhui</link>
    <description></description>
    <language>en-us</language>
    <item>
      <title>[上海] 筹道股权招 Ruby 工程师</title>
      <description>&lt;h2 id="精简版"&gt;精简版&lt;/h2&gt;
&lt;p&gt;各位新年快乐，上海张江，股权众筹，A 轮，招 Ruby 工程师&lt;/p&gt;
&lt;h2 id="公司介绍"&gt;公司介绍&lt;/h2&gt;
&lt;p&gt;众牛（上海）股权众筹服务有限公司是立足于上海自贸区的新形态互联网金融公司，由互联网老兵创立，已获得 A 轮投资，布局互联网金融的众筹。我们试图在坚硬的银行、VC 融资体系外撕开一个新口子，打造专业的众筹融资服务。&lt;/p&gt;

&lt;p&gt;&lt;a href="http://www.choudao.com" rel="nofollow" target="_blank" title=""&gt;筹道股权&lt;/a&gt; 是专注于精品项目的股权融资平台。注册于上海自贸区，是中国证券业协会首批认证会员之一，也是上海唯一入围该名单的股权融资平台，荣获 2015 年福布斯“互联网金融 50 强”称号。&lt;/p&gt;
&lt;h2 id="职位要求"&gt;职位要求&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;熟悉 Ruby on Rails 或其它 Web 框架&lt;/li&gt;
&lt;li&gt;熟悉面向对象编程，理解常用设计模式&lt;/li&gt;
&lt;li&gt;熟悉 CoffeeScript, Sass, Bootstrap, 能写前端页面&lt;/li&gt;
&lt;li&gt;熟悉 Linux / Unix 操作系统，&lt;/li&gt;
&lt;li&gt;理解数据库基本知识，除了 CRUD 至少还要了解事务，锁，JOIN 等。&lt;/li&gt;
&lt;li&gt;有意转 Ruby 的也可，但要基本功扎实&lt;/li&gt;
&lt;li&gt;能高效的阅读相关文档 ( Ruby API, Rails Guide) 或源码&lt;/li&gt;
&lt;li&gt;全职，不考虑 Remote&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="待遇"&gt;待遇&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;不打卡，自由调控上班时间 9 点~10 点上班，6 点~7 点下班&lt;/li&gt;
&lt;li&gt;初级 7K～12k，高级 15K+&lt;/li&gt;
&lt;li&gt;五险一金，交通补贴，工作餐补贴，免费班车&lt;/li&gt;
&lt;li&gt;MBP + 显示器&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="技术关键字"&gt;技术关键字&lt;/h2&gt;
&lt;p&gt;Rails, Bourbon, Bootstrap, Trailblazer, ReactJS, MySQL, Capistrano, Chef, Seafile, GitLab&lt;/p&gt;
&lt;h2 id="公司创始人简介"&gt;公司创始人简介&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;管晓红 首席执行官，联合创始人
法国新媒体硕士，清华大学 EMBA 工商管理硕士，15 年传统媒体、新媒体及互联网业务运营经历，先后担任 SMG 百视通副总裁、盛大网络集团等上市企业高管职位。&lt;/li&gt;
&lt;li&gt;曹晓钢
14 年互联网创业经验。国内最早期程序员，满江红开放技术研究组织创始人，曾任《Dr. Dobb’s Journal》中文版编委。&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="团队及相关报道"&gt;团队及相关报道&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="https://mp.weixin.qq.com/s?__biz=MzA5ODA5OTU4MA==&amp;amp;mid=402483366&amp;amp;idx=3&amp;amp;sn=39e46b867af73483178ae33ff5b4b1b9" rel="nofollow" target="_blank" title=""&gt;四明山荒野健行记&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://mp.weixin.qq.com/s?__biz=MzA5ODA5OTU4MA==&amp;amp;mid=402483366&amp;amp;idx=1&amp;amp;sn=5e144f34a22da51c4e3de0f81febfce8" rel="nofollow" target="_blank" title=""&gt;筹道股权高端投资人交流晚宴&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://mp.weixin.qq.com/s?__biz=MzA5ODA5OTU4MA==&amp;amp;mid=402483366&amp;amp;idx=2&amp;amp;sn=b3803484f2ba4d5d348eb70bcca246d3" rel="nofollow" target="_blank" title=""&gt;筹道“高品”峰会深圳站首秀&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://roll.sohu.com/20151203/n429528665.shtml" rel="nofollow" target="_blank" title=""&gt;筹道股权互联网投融资峰会&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://help.3g.163.com/0406/15/1030/11/B7624BMV0406002E.html" rel="nofollow" target="_blank" title=""&gt;首个海外股权众筹项目破冰&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="工作地点"&gt;工作地点&lt;/h2&gt;
&lt;p&gt;上海浦东新区张衡路 666 弄，上班可坐地铁二号线至张江高科站，然后免费班车到公司&lt;/p&gt;
&lt;h2 id="联系方式"&gt;联系方式&lt;/h2&gt;
&lt;p&gt;简历发至：niedh@choudao.com&lt;/p&gt;</description>
      <author>niedhui</author>
      <pubDate>Sun, 14 Feb 2016 11:05:40 +0800</pubDate>
      <link>https://ruby-china.org/topics/28976</link>
      <guid>https://ruby-china.org/topics/28976</guid>
    </item>
    <item>
      <title>[上海] 筹道股权招 Ruby 工程师</title>
      <description>&lt;h2 id="关于我们"&gt;关于我们&lt;/h2&gt;
&lt;p&gt;&lt;a href="http://www.choudao.com" rel="nofollow" target="_blank" title=""&gt;筹道股权&lt;/a&gt; 是专注于精品项目的股权融资平台。注册于上海自贸区，是中国证券业协会首批认证会员之一，也是上海唯一入围该名单的股权融资平台，荣获 2015 年福布斯“互联网金融 50 强”称号。&lt;/p&gt;
&lt;h2 id="职位要求"&gt;职位要求&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Ruby 工程师&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;熟悉 Ruby on Rails 或其它 Web 框架&lt;/li&gt;
&lt;li&gt;熟悉面向对象编程，理解常用设计模式&lt;/li&gt;
&lt;li&gt;熟悉 CoffeeScript, Sass, Bootstrap, 能写前端页面&lt;/li&gt;
&lt;li&gt;熟悉 Linux / Unix 操作系统，理解数据库基本知识&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;福利与待遇&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;不打卡，自由调控上班时间 9 点~10 点上班，6 点~7 点下班&lt;/li&gt;
&lt;li&gt;初级 7K～12k，高级 15K+&lt;/li&gt;
&lt;li&gt;五险一金，交通补贴，工作餐补贴，免费班车&lt;/li&gt;
&lt;li&gt;MBP + 显示器&lt;/li&gt;
&lt;li&gt;跨行业知识学习&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="工作地点"&gt;工作地点&lt;/h2&gt;
&lt;p&gt;上海浦东新区张衡路 666 弄，上班可坐地铁二号线至张江高科站，然后免费班车到公司，下班就反过来
欢迎有兴趣的同学过来坐坐，聊聊&lt;/p&gt;
&lt;h2 id="联系方式"&gt;联系方式&lt;/h2&gt;
&lt;p&gt;简历发至：niedh@choudao.com&lt;/p&gt;
&lt;h2 id="看图了解工作氛围"&gt;看图了解工作氛围&lt;/h2&gt;
&lt;p&gt;&lt;img src="https://l.ruby-china.com/photo/2015/48087a2b8a69c2aaf7911db734234125.jpg" title="" alt=""&gt;&lt;/p&gt;

&lt;p&gt;&lt;img src="https://l.ruby-china.com/photo/2015/84553f403a6e5625e486a1b2f272f105.jpg" title="" alt=""&gt;&lt;/p&gt;

&lt;p&gt;&lt;img src="https://l.ruby-china.com/photo/2015/a8a6466cd120d476faca3b580a350067.jpg" title="" alt=""&gt;&lt;/p&gt;</description>
      <author>niedhui</author>
      <pubDate>Mon, 12 Oct 2015 14:55:26 +0800</pubDate>
      <link>https://ruby-china.org/topics/27642</link>
      <guid>https://ruby-china.org/topics/27642</guid>
    </item>
    <item>
      <title> [上海] 筹道股权 招 Ruby, Android, iOS 工程师</title>
      <description>&lt;h2 id="公司介绍"&gt;公司介绍&lt;/h2&gt;
&lt;p&gt;&lt;a href="http://www.choudao.com" rel="nofollow" target="_blank" title=""&gt;筹道股权&lt;/a&gt; 是专注于精品项目的股权融资平台。注册于上海自贸区，是中国证券业协会首批认证会员之一，也是上海唯一入围该名单的股权融资平台，荣获 2015 年福布斯“互联网金融 50 强”称号。成立至今，平台已帮助创新创业企业融资近 80 亿元，认证投资人近 3 万，位居全国第一梯队。&lt;/p&gt;
&lt;h2 id="软件工程师"&gt;软件工程师&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Ruby 职位要求&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;熟悉 Ruby on Rails 或其它 Web 框架&lt;/li&gt;
&lt;li&gt;熟悉面向对象编程，理解常用设计模式&lt;/li&gt;
&lt;li&gt;熟悉 CoffeeScript, Sass, Bootstrap, 能写前端页面&lt;/li&gt;
&lt;li&gt;熟悉 Linux / Unix 操作系统，理解 SQL 及 NoSQL&lt;/li&gt;
&lt;li&gt;对写漂亮的代码有追求&lt;/li&gt;
&lt;li&gt;快速成长，适应创业团队的工作氛围&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Android 职位要求&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;具有 Android 主流手机机型适配经验，了解 Android 系统框架原理和底层库&lt;/li&gt;
&lt;li&gt;熟悉 Hybrid 开发&lt;/li&gt;
&lt;li&gt;能独立完成 App 的开发&lt;/li&gt;
&lt;li&gt;与设计师沟通设计 UI 及交互&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;iOS 职位要求&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;具有 2 年以上的 Objective-C / Swift 和 Cocoa Touch 开发经验，并有已发布的 APP&lt;/li&gt;
&lt;li&gt;熟练掌握 Objective-C 语言及思想，熟悉 Objective-C 内存管理机制&lt;/li&gt;
&lt;li&gt;能熟练使用 UIKit 及相关控件，能按项目需求对基础控件进行重写与封装&lt;/li&gt;
&lt;li&gt;熟悉 Hybrid 开发&lt;/li&gt;
&lt;li&gt;与设计师沟通设计 UI 及交互&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;加分项&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;从事过金融行业相关的开发&lt;/li&gt;
&lt;li&gt;Ruby 工程师开发过供 iOS, Android 使用的 API；前端功力深厚；能折腾服务器&lt;/li&gt;
&lt;li&gt;iOS、Android 工程师集成过第三方支付，或具有后端开发经验&lt;/li&gt;
&lt;li&gt;爱折腾&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;待遇&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;15K～20k，能力好可界限突破&lt;/li&gt;
&lt;li&gt;五险一金&lt;/li&gt;
&lt;li&gt;MBP + 显示器&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="UI设计师"&gt;UI 设计师&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;职责&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;负责互联网金融类网站、活动专题的视觉设计与优化，并为公司新产品与新功能提供创意及设计方案；&lt;/li&gt;
&lt;li&gt;与产品及研发团队高效协同工作，参与产品概念至创意讨论，以及在实施的全过程中，提供专业的视觉交互设计意见；&lt;/li&gt;
&lt;li&gt;能独立完成产品最终视觉效果设计，banner 创意设计，产品 Logo 及系统 Icon 组的创作与绘制等；&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;岗位要求&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;1 年以上网站设计经验，拥有丰富的设计理论知识，对 GUI 设计流行趋势有着敏锐的洞察力；&lt;/li&gt;
&lt;li&gt;靠谱的审美能力和国际化的视野，熟悉用户体验，优秀的创新意识与娴熟的设计技巧；&lt;/li&gt;
&lt;li&gt;精通 Photoshop、Flash、illustrator 等设计工具，备独立负责产品视觉设计的能力；&lt;/li&gt;
&lt;li&gt;具备丰富的 WEB 产品设计经验，有项目的经验，有较强的绘画功底，有电商网站、移动端设计经验者优先；&lt;/li&gt;
&lt;li&gt;思维活跃，善于创新，善于团队合作及沟通。&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="工作地点"&gt;工作地点&lt;/h2&gt;
&lt;p&gt;上海浦东新区张衡路 666 弄，上班可坐地铁二号线至张江高科站，然后免费班车到公司，下班就反过来&lt;/p&gt;
&lt;h2 id="联系方式"&gt;联系方式&lt;/h2&gt;
&lt;p&gt;简历发至：niedh@qingju.com&lt;/p&gt;</description>
      <author>niedhui</author>
      <pubDate>Wed, 26 Aug 2015 15:46:05 +0800</pubDate>
      <link>https://ruby-china.org/topics/27090</link>
      <guid>https://ruby-china.org/topics/27090</guid>
    </item>
    <item>
      <title>order 方法会导致 SQL Injection 吗？</title>
      <description>&lt;p&gt;正常是这样的，&lt;/p&gt;
&lt;pre class="highlight ruby"&gt;&lt;code&gt;&lt;span class="n"&gt;order_str&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;'id desc'&lt;/span&gt;
&lt;span class="no"&gt;Post&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;order&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;order_str&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;但是 order_str 可能是用户输入的，假如&lt;/p&gt;
&lt;pre class="highlight ruby"&gt;&lt;code&gt;&lt;span class="n"&gt;order_str&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;'id desc; DELETE from USERS ;'&lt;/span&gt;
&lt;span class="no"&gt;Post&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;order&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;order_str&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;后台看到&lt;/p&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;  Post Load (0.5ms) SELECT `posts`.* FROM `posts` ORDER BY id desc; DELETE from USERS 
Mysql2::Error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;SQL 语句是出来的，但攻击就失败了，是 AR 做了防护吗？我是可以给 order_str 加个 whitelist 的，但有点好奇这里为什么会攻击失败。。求指点&lt;/p&gt;

&lt;p&gt;参考：
&lt;a href="http://rails-sqli.org/" rel="nofollow" target="_blank" title=""&gt;rails-sqli&lt;/a&gt;&lt;/p&gt;</description>
      <author>niedhui</author>
      <pubDate>Mon, 20 Jan 2014 11:42:32 +0800</pubDate>
      <link>https://ruby-china.org/topics/16882</link>
      <guid>https://ruby-china.org/topics/16882</guid>
    </item>
    <item>
      <title>五角场附近有同学可借摸下 HHKB 吗？</title>
      <description>&lt;p&gt;同事用过我的 DASKeyboard 后，想买个好键盘，看中了 HHKB, 买之前想先摸下，五角场周围有能借摸的同学吗：）&lt;/p&gt;</description>
      <author>niedhui</author>
      <pubDate>Wed, 21 Aug 2013 09:48:05 +0800</pubDate>
      <link>https://ruby-china.org/topics/13481</link>
      <guid>https://ruby-china.org/topics/13481</guid>
    </item>
    <item>
      <title>大家一般怎么组织 api 的类结构</title>
      <description>&lt;p&gt;api 会分版本，有时候还会带自己的 namespace&lt;/p&gt;

&lt;p&gt;app/controllers/api/v1/xxxxx.rb
app/controllers/api/v2/yyyy.rb
app/controllers/app_name1/api/v1/zzz.rb
app/controllers/app_name2/api/v1/aaa.rb&lt;/p&gt;

&lt;p&gt;这样写 controller 的时候就要写成&lt;/p&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;module AppName1
  module Api
    module V1
      class Zzz &amp;lt; ApiController
      end
    end
  end
end
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;感觉这样写有点啰嗦啊&lt;/p&gt;</description>
      <author>niedhui</author>
      <pubDate>Fri, 09 Nov 2012 15:24:43 +0800</pubDate>
      <link>https://ruby-china.org/topics/6640</link>
      <guid>https://ruby-china.org/topics/6640</guid>
    </item>
    <item>
      <title>关于 begin expression end 这种用法</title>
      <description>&lt;p&gt;看到 shopqi 的代码里面很多这种用法&lt;/p&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;begin 'from pay gateway'
  begin '支付宝'
    def notify
    end
  end

  begin '财付通'
  end
end
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;基础没打好啊，只知道 begin;rescue;end 这种用法。不晓得像 shopqi 这种用法是为了代码组织的好一点？就像&lt;/p&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;#### 以下是支付宝相关代码
def notify
end

#### 以下是财付通相关代码
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;还是有其他功能
&lt;a href="/saberma" class="user-mention" title="@saberma"&gt;&lt;i&gt;@&lt;/i&gt;saberma&lt;/a&gt;  &lt;/p&gt;</description>
      <author>niedhui</author>
      <pubDate>Thu, 10 May 2012 15:11:08 +0800</pubDate>
      <link>https://ruby-china.org/topics/3195</link>
      <guid>https://ruby-china.org/topics/3195</guid>
    </item>
    <item>
      <title>想买个升降的电脑桌，求推荐</title>
      <description>&lt;p&gt;为了身体健康，想买个可升降的电脑桌，或者是高一点的桌子。
现在办公室的桌子有点矮，各位有推荐不？
几百块的预算吧  &lt;/p&gt;</description>
      <author>niedhui</author>
      <pubDate>Thu, 26 Apr 2012 14:31:42 +0800</pubDate>
      <link>https://ruby-china.org/topics/2905</link>
      <guid>https://ruby-china.org/topics/2905</guid>
    </item>
    <item>
      <title>求解 define_method 中变量的作用域</title>
      <description>&lt;p&gt;代码如下&lt;/p&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;module M
  def define_keys(*keys)
    define_method :hello do 
       keys += [:hello,:bye]
    end
  end
end

class A
  extend M
  define_keys :nihao
end

a = A.new
p a.hello
#output [:nihao, :hello, :bye]
p a.hello
#output [:nihao, :hello, :bye, :hello, :bye]
p a.hello
#output  [:nihao, :hello, :bye, :hello, :bye, :hello, :bye]
b = A.new
p b.hello
#output  [:nihao, :hello, :bye, :hello, :bye, :hello, :bye, :hello, :bye]



&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;一开始以为每次的结果都应该一样的，不太懂啊  &lt;/p&gt;</description>
      <author>niedhui</author>
      <pubDate>Tue, 24 Apr 2012 10:12:23 +0800</pubDate>
      <link>https://ruby-china.org/topics/2850</link>
      <guid>https://ruby-china.org/topics/2850</guid>
    </item>
    <item>
      <title>针对大量数据跑任务</title>
      <description>&lt;p&gt;我们现在有一千万条左右的数据，需要针对其中的每一条进行操作
大体的逻辑是这样，很简单&lt;/p&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;lot_of_rows.each do |row|
  # Resque.enqueue(job, row)  
end


&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;一开始数据量很小，不用 resque, 一个 each 就行了。后来数据量大了，上了 resque, 
也从原来的一个 each 分成了很多小的 each，逻辑大体变成这样（当然，日期是计算的，不是写死的：） ）：&lt;/p&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;XX.where(created_at: Time.local(2012, 1)..Time.local(2012,2).each do ||
end

XX.where(created_at: Time.local(2012, 2)..Time.local(2012,3).each do ||
end 


&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;像这种情况各位有没有什么更好的方法呢。处理大数据一点经验也没啊  &lt;/p&gt;</description>
      <author>niedhui</author>
      <pubDate>Tue, 17 Apr 2012 22:42:24 +0800</pubDate>
      <link>https://ruby-china.org/topics/2670</link>
      <guid>https://ruby-china.org/topics/2670</guid>
    </item>
    <item>
      <title>把 mbp 以旧换新了</title>
      <description>&lt;p&gt;10 年买的高配 13 寸 mbp，年前年后修了四次，最近一次去的时候表示了下不满，Apple care 同意给换个新的，今天打来电话确认给换的是新款的低配，同事都说我这 Apple care 买的值了，哈哈哈  &lt;/p&gt;</description>
      <author>niedhui</author>
      <pubDate>Thu, 12 Apr 2012 11:55:30 +0800</pubDate>
      <link>https://ruby-china.org/topics/2543</link>
      <guid>https://ruby-china.org/topics/2543</guid>
    </item>
    <item>
      <title>[求推荐] 写 open api 的工具</title>
      <description>&lt;p&gt;各位有没有什么好用的 open api 工具啊
不是程序的 API 文档
而是对外开放的 API 文档
如 twitter, foursquare 的 open api 文档等
现在我们是把 open api 写在 wiki 里面，发现重复工作多，而具组织也不太顺。。  &lt;/p&gt;</description>
      <author>niedhui</author>
      <pubDate>Thu, 29 Mar 2012 09:43:27 +0800</pubDate>
      <link>https://ruby-china.org/topics/2228</link>
      <guid>https://ruby-china.org/topics/2228</guid>
    </item>
    <item>
      <title>carrierwave custom name</title>
      <description>&lt;p&gt;我们现在在用 carrierwave 来处理图片上传，想像 ruby-china 这样处理文件名，&lt;/p&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;def filename
  if super.present?
    ext = File.extname(original_filename)
    fname = Digest::MD5.hexdigest(self.read)
    @name ||= "#{fname}#{ext}" 
  end
end
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;这部分代码我是写在一个 BaseUploader 里面的，这样所有的图片处理都用这个逻辑了。
但是我们有用到&lt;/p&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;version :thumb do
  process :resize_to_fill =&amp;gt; [48,48]
end
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;这样的问题是
假如有一个图片的原始内容的 md5 是 111111111111，resize 后的内容的 md5 是 22222222,
会导致:
model.avatar.url   ===&amp;gt;   /xxx/xxxx/111111111111.jpg
model.avatar.thumb.url     =====&amp;gt; /xxx/xxxx/thumb_111111111111.jpg
而实际上:
model.avatar.url   ===&amp;gt;   /xxx/xxxx/111111111111.jpg
model.avatar.thumb.url     =====&amp;gt; /xxx/xxxx/thumb_22222222.jpg&lt;/p&gt;

&lt;p&gt;有什么办法解决，难道要在 model 加变量来处理？  &lt;/p&gt;</description>
      <author>niedhui</author>
      <pubDate>Tue, 17 Jan 2012 10:11:49 +0800</pubDate>
      <link>https://ruby-china.org/topics/880</link>
      <guid>https://ruby-china.org/topics/880</guid>
    </item>
    <item>
      <title>有人用 Emacs 做 Rails 开发吗？</title>
      <description>&lt;p&gt;最近想了解下 emacs，看完了官方的教程之后，想试着用来写代码试，各位有什么好的资源吗？比如定制一类的。像 project drawer, theme,nav 等  &lt;/p&gt;</description>
      <author>niedhui</author>
      <pubDate>Tue, 27 Dec 2011 16:16:58 +0800</pubDate>
      <link>https://ruby-china.org/topics/611</link>
      <guid>https://ruby-china.org/topics/611</guid>
    </item>
    <item>
      <title>Mongoid &amp; Kaminari  query in view</title>
      <description>&lt;p&gt;现在用 Mongoid 2.3.4 ,Kaminari 做分页
一般场景：
controller &lt;/p&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;def index
  @products = Products.all.page(params[:page])
end
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;view&lt;/p&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;- @products.each do |product|
  = product.name

= paginate @products
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;这样的话，实际的查询是在&lt;a href="/products.each" class="user-mention" title="@products.each"&gt;&lt;i&gt;@&lt;/i&gt;products.each&lt;/a&gt;这里执行的，这个算 Query in view 不？&lt;/p&gt;

&lt;p&gt;如果换成
controller&lt;/p&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;def index
  @criteria = Products.all.page(params[:page])
  @products = @criteria.execute
end
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;view&lt;/p&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;- @products.each
  - xxxxx
= paginate @criteria
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;速度会快一些，但觉得比较蹩脚，每个用到分页的地方都要这样了。。
各位有什么建议不&lt;/p&gt;</description>
      <author>niedhui</author>
      <pubDate>Mon, 05 Dec 2011 21:25:37 +0800</pubDate>
      <link>https://ruby-china.org/topics/367</link>
      <guid>https://ruby-china.org/topics/367</guid>
    </item>
    <item>
      <title>不小心买了个日版的键盘。。。</title>
      <description>&lt;p&gt;以前买的苹果 G6 键盘坏掉了，想买个 G5 看看手感，今天收到一看，是个日版的，整个键位都是错乱的了。。。。。。去淘宝页上一看，卖家是有说明，唉  &lt;/p&gt;</description>
      <author>niedhui</author>
      <pubDate>Mon, 05 Dec 2011 14:27:55 +0800</pubDate>
      <link>https://ruby-china.org/topics/358</link>
      <guid>https://ruby-china.org/topics/358</guid>
    </item>
    <item>
      <title>关于 ruby-china 代码中的 callback</title>
      <description>&lt;p&gt;fork 了 ruby-china 的代码，学习下。
有个编程习惯的问题，代码中的很多 callback 都是这样写的：&lt;/p&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;after_create :update_parent_topic
def update_parent_topic
end

after_create :send_mail_notify
def send_mail_notify
end

before_save :extract_mentioned_users
def extract_mentioned_users
end
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;一般如果 callback 的代码只用一次，我就会直接写成&lt;/p&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;after_create do

end
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;如果 callback 的代码会用到多次，就写成&lt;/p&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;after_update :update_topic_updated_at
after_destroy :update_topic_updated_a
before_save :extract_mentioned_userst
# 省掉其他的callback声明
private
def update_topic_updated_at
end
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;各位呢？  &lt;/p&gt;</description>
      <author>niedhui</author>
      <pubDate>Sun, 27 Nov 2011 23:57:50 +0800</pubDate>
      <link>https://ruby-china.org/topics/215</link>
      <guid>https://ruby-china.org/topics/215</guid>
    </item>
  </channel>
</rss>
