Ruby China
  • Topics
  • 招聘
  • Wiki
  • 酷站
  • Gems
  • Sign Up
  • Sign In
@rubyu2
Member
NO. 5489 / 2013-01-27

[email protected]
杭州
28 Topics / 292 Replies
11 Followers
25 Following
49 Favorites
GitHub Public Repos
  • stable-bloom-filter 42

    A Rust-implementation of a stable Bloom filter for filtering duplicates out of data streams.

  • ether-router 13

    Just Truffle2.0 of ether-router

  • leetcode-rust 9

    leetcode-rust

  • lightning 6

    Lightning Network's Bidirectional Payment Channels on CKB

  • solidity-assembly-prac... 1

  • comet 0

    An efficient money market protocol for Ethereum and compatible chains (aka Compound III, Compound...

  • u2.github.io 0

    u2.github.io

  • ckb-compose-example 0

    Example codes shows how to use deleagte lock to do on-chain composing and vice-versa

  • did-contracts 0

    This is the repository for contract scripts and development documents of DID.

  • MediaCrawler 0

    小红书笔记 | 评论爬虫、抖音视频 | 评论爬虫、快手视频 | 评论爬虫、B 站视频 | 评论爬虫、微博帖子 | 评论爬虫

More on GitHub
  • Overview
  • Topics
  • Replies
  • Favorites
  • Following
  • Followers
  • Redis 3.0 released at April 02, 2015

    也是刚刚看到这个消息。👍

  • 【愚人节开发者专享】Coding WebIDE 上线,开启云端开发模式! at April 01, 2015

    不错!

  • 当我们在谈论类的时候我们在谈论什么 at March 31, 2015

    在《松本行弘的程序世界》里有这样一句话:

    结构化编程基本上实现了控制流程的结构化。但是程序流程虽然结构化了,要处理的数据却并没有被结构化。面向对象的设计方法是在结构化编程对控制流程实现了结构化后,又加上了对数据的结构化。

    “类”就是一个结构体,包括流程和数据。

    类是对象的模板,相当于对象的雏形。

    我觉得OrderChargeLogic设计成一个 module 可能会更合理些。

  • 关于 Ruby 2.2 at March 31, 2015

    https://github.com/rack/rack/pull/737

  • Spyglass 代码阅读 at March 27, 2015

    #1 楼 @xiajian https://pragprog.com/titles/jsunix/source_code 这里有😄

  • Service Object: What? Why? and How? at March 23, 2015

    #12 楼 @hooopo 👍“实用主义”才是第一原则。

  • Service Object: What? Why? and How? at March 23, 2015

    #9 楼 @flowerwrong 都是 extract method 的方法,但 concern 有一点局限性: Service Object 更适合组织多个 model 之间的交互。 Concern 需要 ActiveSupport::Concern 才能玩的转,而 Service Object 就是普通 Object。

    很赞成这种理解,简单明了。而且大多数情况下,mvc 已经完全足够用。即便有重复的代码,想要重用,搞一个 service 层也不一定是“划算”的。

    比如我们项目中,在 grape 的 api 里有大量代码逻辑其实和 controller 重复的,但是因为 grape 语法里 present,error,以及 params 的验证等 dsl 语法很多。将这部分代码抽出到 model 或者重新建一个 service 都是非常繁杂的过程,而且会生产很多 ugly 的代码,api 的改动和升级也会造成很多麻烦,反而会增加很大的阅读和维护难度。

  • Rails 开发:那些年,我们一起踩过的坑 (剧终) at March 22, 2015

    Rails 里的 concern 也只是一种多重继承的 mixin 的实现方式,自己也可以实现,更多的只是为了代码的复用,并没有实现“加一层”的概念。不过如果项目真的复杂,构建一个 service 层也不是很难。

    第一宗罪:增加集成客户端组件的复杂度

    theme 升级的时候太痛苦了!

  • 2015年3月29日 Rubyist 上海 2015 Q1 聚会 at March 21, 2015

    希望后面能看到视频。

  • Grape 片段缓存 at March 21, 2015

    今天又改了改,参考了下其他的 grape http cache gem,加上了缓存的配置,而不是直接调用 Rails.cache 了。

  • UCloud API 开发大赛在 RubyChina 的特别抽奖送书活动,截止日期 3 月 24 日 at March 20, 2015

    44

  • 阿里云 Rails 项目调整 RDS MySQL 编码为 utf8mb4 的详细步骤 at March 18, 2015

    这是我们的,忘记原文在哪里了。

    desc "Database related tasks"
    namespace :database do
      desc "Convert to utf8mb4"
      task convert_to_utf8mb4: :environment do
        connection = ActiveRecord::Base.connection
        database = connection.current_database
    
        connection.execute "ALTER DATABASE #{database} CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci;"
        puts "Converted #{database} character set"
    
        # Change all tables
        connection.tables.each do |table|
          connection.columns(table).each do |column|
            if column.sql_type == "varchar(255)"
              puts "#{column.name} is varchar(255)"
              # Check for 255 indexed columns
              connection.indexes(table).each do |index|
                if index.columns.include?(column.name)
                  puts "#{column.name} has index, altering length..."
                  connection.execute "ALTER TABLE #{table} CHANGE `#{column.name}` `#{column.name}` varchar(191);"
                  puts "...done!"
                end
              end
            end
          end
    
          puts "Converting #{table}..."
          connection.execute "ALTER TABLE #{table} CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;"
          puts "...#{table} converted!"
    
          connection.columns(table).each do |column|
            if column.type == :string || column.type == :text
              puts "Converting #{column.name}..."
              connection.execute "ALTER TABLE #{table} CHANGE `#{column.name}` `#{column.name}` #{column.sql_type} CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;"
              puts "...#{column.name} done!"
            end
          end
    
          puts "Repairing #{table}..."
          connection.execute "REPAIR TABLE #{table};"
          puts "...#{table} repaired!"
          puts "Optimizing #{table}..."
          connection.execute "OPTIMIZE TABLE #{table};"
          puts "...#{table} optimized!"
        end
      end
    end
    
  • 基于 Angular, Flask 以及 socket.io 写了个 Redis 的 Web 监控工具 at March 13, 2015

    👍

  • [北京 | 互联网 | 出境游] 大鱼诚招 Ruby 攻城狮 at March 12, 2015

    环境好棒!

  • 说说 Rails 的套娃缓存机制 at March 09, 2015

    #68 楼 @linjunzhugg rails 渲染页面慢只是因为几个 help 方法,如果 view 是纯 html 并且没有其他的 ruby 代码,加上片段缓存和不加效果是差不多的。

  • [杭州] 阿里巴巴招两名 Ruby 工程师 at March 02, 2015

    能实现复杂的前端功能 😢

  • Ruby 导出 CSV 文件中文乱码,纠结了好久好久 at February 06, 2015

    #16 楼 @Lucifer 这个应该是管用的,我们之前也是这样,要在头里加编码信息。

  • 搬家一大批书半卖半送,最高 3 折,地点回龙观,可能需要自取 at February 06, 2015

    楼主涉猎好广泛。。

  • [上海] 薄荷诚邀 Ruby 好手 (新传图片,薄荷 girl 向你招手,是否考虑换个不一样的环境呢) at January 31, 2015

    好多妹子!

  • [译] Ruby concurrency explained at January 30, 2015

    挺不错的文章。

  • 容错和速错 at January 24, 2015

    :plus1:

  • why drop caches in linux at January 22, 2015

    #1 楼 @linuxgit 是的。 Linux is borrowing unused memory for disk caching. Disk cache can always be given back to applications immediately! You are not low on ram! 其实就三句话。

  • 高手对决 -- 博客服务器被黑的故事 at January 21, 2015

    先赞后看。

  • [译] Five Ruby Methods You Should Be Using at January 17, 2015

    👍 <=>是 ruby 方法里最神奇的方法之一,很多类关于比较的方法,都会调用这个方法,通过重写这个方法来实现自定义排序和比较。

  • Redis MySQL 混用的最佳实践 at January 14, 2015

    #15 楼 @vincent :plus1:

  • 类似 Ruby Grape 项目的 Elixir RESTFul 框架 Maru at January 10, 2015

    :plus1:

  • Ruby 2.2 中实验性的采用 Vfork at January 10, 2015

    However vfork(2) is still not well understood and a potentially harmful system call. We would like to experiment to find out how much benefit can be gained by gathering performance data and use cases.

  • Ruby 2.2 中实验性的采用 Vfork at January 10, 2015

    #6 楼 @lyfi2003 @huacnlee 确切的说直到父进程和子进程其中之一,需要对共享内存的数据修改时才会进行内存复制。这也是 cow 的优点,将内存复制推迟。

  • Ruby 2.2 新方法一览 at December 30, 2014

    #1 楼 @googya 是的

  • 我兑现了一个月前的承诺 at December 29, 2014

    赞🔥

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