Ruby China
  • Topics
  • 招聘
  • Wiki
  • 酷站
  • Gems
  • Sign Up
  • Sign In
Howl王
@mimosa
VIP
NO. 5 / 2011-10-28

Autodesk
上海
39 Topics / 570 Replies
46 Followers
19 Following
42 Favorites
┬─┬ノ❨°_°ノ❩ ..persecution mania
GitHub Public Repos
  • ansj_seg 6

  • docker-tengine 3

  • grape-erb 2

    Use erb in grape

  • shrine-tus-demo 1

    Demo integrating tus with Shrine

  • ChatGPT-Next-Web 1

    A well-designed cross-platform ChatGPT UI (Web / PWA / Linux / Win / MacOS). 一键拥有你自己的跨平台 ChatGPT 应用。

  • rest_cli 1

  • codeowners-checker 0

    Check .github/CODEOWNERS consistency

  • gatsby-starter-portfol... 0

    Playful and Colorful One-Page portfolio featuring Parallax effects and animations. Especially des...

  • logstop 0

    Keep personally identifiable information (PII) out of your logs

  • readme-code-testing 0

    Helping test "any" code in readme with GitHub Action. All you need is unit testing synchronized e...

More on GitHub
  • Overview
  • Topics
  • Replies
  • Favorites
  • Following
  • Followers
  • [上海][2014年2月23日] 2014 年 2 月 周末聚会 at February 17, 2014

    赶得上的话也去凑下热闹↖(^ω^)↗

  • [奖品图曝光] UPYUN 送上情人节三件套,祝大家码上有爱情 at February 11, 2014

    来晚了~

  • 令人苦恼的性能问题 at February 02, 2014

    我们也使用 Padrino ,同样是 garbage_collector 。

  • yield 肿么翻译 at January 23, 2014

    输出

  • 有木有同学使用过 carrierwave + grape 构造文件上传 api 的 at January 23, 2014
    # -*- encoding: utf-8 -*-
    require 'securerandom' unless defined?(::SecureRandom)
    require 'mime/types' unless defined?(::MIME::Types)
    
    module Helpers
      module File
    
        # 根据 RFC 2397 约定,将文件转字符
        def file_encode(file_path)
          return nil unless File.file?(file_path)
    
             file = File.open(file_path, 'rb')
             type = MIME::Types.type_for( File.basename(file_path) ).first.to_s
          content = Base64.encode64( file.read )
    
          return "data:#{type};base64,#{content}"
        end
    
        # 还原,文件信息
        def file_for(file_enc, attr_name)
          file_info = file_enc.match(/data:(.*);base64,([.\w\s\/\/+]*)/)
          if file_info && file_info.size == 3
            # 文件信息
            type      = file_info[1]
            content   = file_info[2]
            # 找扩展名
            mime_type = MIME::Types[file_info[1]].first
            extname   = mime_type.extensions.first
            # 文件名
            filename  = SecureRandom.hex(10) + ".#{extname}"
    
            return { 
              filename: filename, 
                  type: type, 
                  name: attr_name, 
              tempfile: file_restore(filename, content), 
                  head: "Content-Disposition: form-data; name=\"#{attr_name}\"; filename=\"#{filename}\"\r\nContent-Type: #{type}\r\n"
            } 
          end
          return nil
        end
    
        # 还原,临时文件
        def file_restore(filename, content)
          temp_file = Tempfile.new(filename, binmode: true)
          temp_file.write( Base64.decode64(content) )
          temp_file.close
    
          return temp_file
        end
      end
    end
    
  • 库存的数据库设计? at January 14, 2014

    product 是产品(静态)属性:款号、材质、品牌。。。

    item 是(可售)商品,包含了:颜色、尺码、SKU 编码、库存、销售价

    在 销售 过程中,唯一频繁变动的就是 stock

  • 年底了来曝下加薪和年终奖呗 at January 11, 2014

    #5 楼 @huacnlee 阿里是 4 月,发~

  • [远程] 创业团队信 + 招开发了! at January 05, 2014

    有前途,很多电商也需要~

  • 活着的意义 at December 09, 2013

    轻松的话题总能激起感慨欲^ω^

  • 现在还有可以用的短信通道吗? at December 09, 2013

    #7 楼 @winnie 我们一直用,做短信通知,目前到达率很低π_π

  • 管理系统用户和子用户的设计 at December 08, 2013
    # -*- encoding: utf-8 -*-
    
    class User
      include Mongoid::Document
      include Store
    
      store_in collection: 'users'
    
      # Referenced
      belongs_to :ownable,   polymorphic: true, index: true # 店长
      has_many   :shops,     foreign_key: 'nick' # 店铺
      has_many   :employees, foreign_key: 'seller_nick' # 店铺
    
    # -*- encoding: utf-8 -*-
    
    class Employee # 伙计
      include Mongoid::Document
      # Referenced
      belongs_to :account
      belongs_to :employee, class_name: 'Account', foreign_key: 'employee_id'
      belongs_to :seller,   class_name: 'User',    foreign_key: 'seller_nick'
    
      attr_accessor :email
    
      # Fields
      field :employee_id,   type: String
      field :employee_name, type: String
      field :seller_nick,   type: String
      field :role,          type: String
      field :_id,           type: String, default: -> { "#{seller_nick}:#{employee_name}" }
    
      # Validations
      validates_presence_of :seller_nick, :role
    

    角色:

    def title
        case role
          when 'admin'
           '店长'
          when 'op'
           '运营'
          when 'cs'
           '客服'
        end
      end
    
  • GeoKit 后台获取 Google Map 数据遭遇 Geokit::TooManyQueriesError at November 15, 2013

    确实是记录 IP 的,我现在的方案是放在前端,通过用户的 IP 不停的请求~

  • mongoid 模糊匹配 at October 21, 2013

    User. where(nickname: /#{"ta"}/).first

  • [上海] 实习&全职 出门问问团队 (Google 大牛创业团队) 校招进行中,各路大牛期待你的加入 at October 19, 2013

    #39 楼 @larina_gu 谢谢,挺期待的~

  • [上海][2013年10月15日] Ruby Tuesday 活动召集 (周二) at October 15, 2013

    如果有玩 3DS 的就是我啦~

  • [上海] 实习&全职 出门问问团队 (Google 大牛创业团队) 校招进行中,各路大牛期待你的加入 at October 15, 2013

    @larina_gu 能给个语意果的邀请码不?[email protected]

  • [上海][2013年10月15日] Ruby Tuesday 活动召集 (周二) at October 15, 2013

    今天有雨~

  • [已送出] 有要书的吗?你出邮费就好 at October 08, 2013

    #9 楼 @yfractal 给你支付宝转了二十,够不?

  • [已送出] 有要书的吗?你出邮费就好 at October 03, 2013

    #2 楼 @yfractal 谢谢,支付宝帐号给我,邮资打给你:)

  • [已送出] 有要书的吗?你出邮费就好 at October 03, 2013

    @yfractal 没人愿意占这个便宜,偶来,支付宝帐号给偶;

    杭州滨江区长江南路 336 号(白马湖生态创意城)3 幢 503.

  • [杭州] 30k/月,找 Ruby freelancer,共同完成初创项目。 at August 19, 2013

    #19 楼 @tigerinfosys 对的白马湖生态城办公 #20 楼 @yedingding 有机会的,最近缺人手,忙了点~ #21 楼 @xstmjh #23 楼 @karmue 不是工资,只是请人临时帮着做,所以给得高~ #22 楼 @johnnyhg #24 楼 @puake 项目没啥技术门槛,全靠运营,做自助旅行的~

  • [杭州] 30k/月,找 Ruby freelancer,共同完成初创项目。 at August 18, 2013

    #10 楼 @zhuf 有空过来坐坐,聊聊~

  • [杭州] 30k/月,找 Ruby freelancer,共同完成初创项目。 at August 18, 2013

    #8 楼 @zhuf 有兴趣没?

  • [杭州] 30k/月,找 Ruby freelancer,共同完成初创项目。 at August 18, 2013

    #1 楼 @howiehu 对的~唯一硬性要求。

  • 国内程序员与国外程序员最大的差别是什么? at August 14, 2013

    #10 楼 @fredwu 所以觉得自己牛逼哄哄的人多…… 深深的有体会~

    PS:国内的老板基本不信科学,告你,不管用什么办法你的让我在 7 月 25 号上线,不行你们++班~

  • Sidekiq 的任务计划,仅支持精确定时?! at July 26, 2013

    #13 楼 @aetherus 可以动态: Sidekiq.reload_schedule! if Sidekiq::Scheduler.dynamic

  • Prev
  • 1
  • 2
  • …
  • 9
  • 10
  • 11
  • 12
  • 13
  • …
  • 18
  • 19
  • Next
关于 / RubyConf / Ruby 镜像 / RubyGems 镜像 / 活跃会员 / 组织 / API / 贡献者
由众多爱好者共同维护的 Ruby 中文社区,本站使用 Homeland 构建,并采用 Docker 部署。
服务器由 赞助 CDN 由 赞助
iOS 客户端 / Android 客户端 简体中文 / English