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
  • RubyMotion Workshop 之 iOS 开发实战 at October 25, 2014

    @chunlea HackShanghai 玩智能硬件吗?

  • RubyMotion Workshop 之 iOS 开发实战 at October 23, 2014

    #3 楼 @akirapanda 同求

  • Rails 重构: 利用 Service 优化 Fat Model at October 22, 2014
    # -*- encoding: utf-8 -*-
    
    module ActiveRecord
      module CustomerCache
        extend ActiveSupport::Concern
    
        included do |base|
          belongs_to_document :customer # 客人
    
          before_validation :set_customer_cache, if: :customer_cache? # 解决 belongs_to :customer 时 customer= 继承问题。
        end
    
        # 缓存客人信息
        def customer=(val)
          self.customer_id       = val.try(:id).try(:to_s) # 关联客人
          self.customer_username = val.try(:username) # 帐号
          self.customer_nickname = val.try(:nickname) # 昵称
          self.customer_name     = val.try(:name)    # 收货人
          self.customer_mobile   = val.try(:mobile)  # 手机号
          self.customer_address  = val.try(:address) # 收货地址
        end
        alias :set_customer_cache= :customer=
    
          private
    
            def set_customer_cache
              self.set_customer_cache = self.customer
            end
    
            def customer_cache?
              self.customer_id_changed? && self.respond_to?(:customer)
            end
      end
    end
    

    多处调用:

    # -*- encoding: utf-8 -*-
    
    class Order < ActiveRecord::Base
      include ::ActiveRecord::CustomerCache
      include ::ActiveRecord::StoreCache
      include ::ActiveRecord::Tracker
        extend Enumerize
    
      has_many :line_items
    
      serialize :carts, JSON
      after_initialize :set_default_carts
    
      has_many_documents :issues
    
      attr_accessible :order_no, :quantity, :price, :shipping_fee, :payment, :status, :created_on, :paid_on, :shipped_on, :signed_on, :current_user, :assigned_count, :assigned_at
    
      enumerize :status, in: { exception: -1, pending: 0, paid: 2, shipping: 3, shipped: 4, signed: 6, billed: 9, refund: 11, closed: 13, archived: 99 }, default: :pending, scope: true, predicates: { prefix: true }
    
      paginates_per 10
    
      default_scope -> { order('updated_at DESC, customer_id DESC') } 
      # .............
    
  • 国内第一家云端的日志管理软件 (uclogs.com) 招募体验用户 at October 22, 2014

    申请试用:

    联系方式 : [email protected] 需要管理的日志类型:Sidekiq,Rails 操作系统:Linux

  • [西安] 全栈工程师 (Rails/MySQL)— 全职或 soho - 更新了图片 at October 22, 2014

    家乡的公司 :plus1:

  • [杭州] 你若决意破茧成蝶,我们为你繁花似锦! at October 22, 2014

    #1 楼 @david_8 布道教育

    阿里不一直都是 PHP 和 Java 的天下吗?

  • 想用年月日 时分秒作为订单号,怎么实现 at October 15, 2014
    p SecureRandom.uuid #=> "2d931510-d99f-494a-8c67-87feb05e1594"
    
  • 存中文报错问题 at October 15, 2014

    #1 楼 @zlx_star 😓 截图不就是 MySQL 的错吗?

  • [上海][2014年10月21日] 2014 年 10 月 周中聚会 at October 15, 2014

    :plus1:

  • [西安] 招聘 Ruby on Rails 开发工程师 at October 14, 2014

    招聘文案很陕西化,看起来和 http://www.shou65.com/help/jobs 有的一拼~

  • DJI 生产的无人机,在叙利亚被击落 at October 14, 2014

    深圳大疆,在四轴飞行器领域很牛~ :plus1:

  • 友好速搭的技术栈 for Ruby off Rails at October 10, 2014

    #4 楼 @ChrisLoong http://www.chihuohezi.com 我们小伙伴做的,给点意见~

  • 友好速搭的技术栈 for Ruby off Rails at October 10, 2014

    自建店铺这个事,太小店铺没流量,太大需要对接供应链的都自己做系统,或是靠在巨人肩膀上,做全平台~

    😪

  • 友好速搭的技术栈 for Ruby off Rails at October 10, 2014

    有没有全平台对接呀~铺货到京东、天猫、一号店、亚马逊之类的?!

  • 工作在北京女孩 求 Ruby 职位 at October 10, 2014

    好姑娘,上个头像先~ 👍

  • [上海] 众牛网络, 梦网众筹,张江,求程序员 at October 10, 2014

    http://www.demohour.com 👏

  • 大家在前期设计时都使用什么工具 at October 10, 2014

    OmniGraffle 随手画画~

  • 为 Ruby 程序员准备的 Go 入门教程 at October 10, 2014

    :plus1:

  • [上海] 舒睿贝蒙 (Diningcity) 诚聘 Ruby on Rails 攻城师 & 网页设计师! at October 09, 2014

    建议不要使用 hr 邮箱,我们【收留我】的招聘邮箱是:hello[at]shou65.com 是不是更人性 👏

  • 搜狐 paas 邀请码接力了~ at September 26, 2014

    uE9hcFBvBxo6 4AH69jN2oK44 P8U46793V4jU

  • 搜狐 paas 邀请码接力了~ at September 26, 2014

    mifqLLa5Z8TQ 已用,谢谢

  • Remote 工作是怎么解决五险一金的? at September 18, 2014

    社保,关系到你的个人积分,等你们有了孩子,排队上幼儿园时就知道有什么用了~

  • 有什么网上的消息接收平台?用来搜集备份统计信息 at September 15, 2014

    http://www.yeelink.net/developer/api

  • 简单处理掉所有 Rails ActionController::RoutingError 的错误 at September 11, 2014

    #7 楼 @jasl 个人觉得是 Rack 的问题,padrino 也存在这个错误,为此我们还特意去改了 http_router

  • 现在网站使用 QQ,微博或者支付宝帐号登录,有什么特别好的解决方案吗? at September 10, 2014

    告诉你们一个秘密,腾讯的 OPENID 不可作为 UID 使用,因为每个 API_KEY 所获取的 OPENID 都不一样,

    也就是说 WEB、APP 在腾讯的系统里是 2 个应用,但要实现 SSO 时发现 UID 不唯一了~

  • rails carrierwave-qiniu at September 10, 2014

    #2 楼 @42thcoder 写在 model 里,因为不止在前台要用,其他后台场景中需要用~

  • API 添加验证机制或者隐藏联系信息 at September 09, 2014
    def email_safe
      return nil if self.email.nil?
      self.email.sub /(.*)@(.*)/ do
        $1[0..($1.size/2-1)].ljust($1.size, '*') + '@' + $2
      end
    end
    
    def mobile_safe
      return nil if self.mobile.nil?
      self.mobile.sub /(\d{3})(\d{4})(\d*)/ do
        $1+'****'+$3
      end
    end
    
  • rails carrierwave-qiniu at September 09, 2014
    • 配置 API

    • Uploader

    • 图片上传


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