Ruby China
  • Topics
  • 招聘
  • Wiki
  • 酷站
  • Gems
  • Sign Up
  • Sign In
李华顺
@huacnlee
Admin
NO. 2 / 2011-10-28

[email protected]
长桥证券 (Longbridge)
成都
502 Topics / 9058 Replies
959 Followers
53 Following
105 Favorites
Reward
GitHub Public Repos
  • autocorrect 1412

    A linter and formatter to help you to improve copywriting, correct spaces, words, and punctuation...

  • rails-settings-cached 1104

    Global settings for your Rails application.

  • rucaptcha 697

    Captcha Gem for Rails, which generates captcha image by Rust.

  • zed-theme-macos-classic 97

    A macOS native style theme for Zed, let it same like native app in macOS.

  • vscode-macos-classic.t... 22

    macOS Classic theme for Visual Studio Code

  • zed-extension-action 19

    GitHub Action for automatically bump Zed Extensions version after a release.

  • autocorrect-action 11

    GitHub action for use AutoCorrect as lint

  • zed-autocorrect 6

    AutoCorrect for Zed

  • gpui-workspace 4

    Dock layout UI component for GPUI, that extracted from Zed project.

  • zed-lalrpop 3

    LALRPOP parser grammar support for Zed.

More on GitHub
  • Overview
  • Topics
  • Replies
  • Favorites
  • Following
  • Followers
  • Ruby China 最近经常 503,你们遇到过没? at July 15, 2014

    10 小时前我 stop 过一次,Puma restart 对 Gem 更新似乎不起作用

  • 想知道童鞋们一般做个小博客要花多久? at July 14, 2014

    楼主在下一盘很大的棋! 👍 👍

  • ruby.taobao.org 源今天出现错误,求解决 at July 14, 2014

    @beyondyuqifeng 这个 Bug 已经修正,现在同步不会导致 404 了

  • 关于 mongoid 控制台问题错误显示问题。 at July 11, 2014

    配置文件不对

  • app/views/layouts/application.html.erb 报错 at July 10, 2014

    请不要重复发帖,之前设置 NoPoint 是因为你描述不清楚

  • ruby.taobao.org 源今天出现错误,求解决 at July 10, 2014

    现在是有这么个 Bug, 同步过程偶尔会遇到,过一会儿等同步完成就可以了。

  • Phoenix vs Rails 性能测试 at July 10, 2014

    还有文档:http://elixir-lang.org/docs/plug/ 也是巨像,YARD 风格

  • Install Ruby The "Postmodern" Way at July 10, 2014

    #28 楼 @quakewang #26 楼 @hooopo Cron RVM 就是坑,是有方法可以弄过,只是老碰上

  • rake assets:precompile --trace 报错 Command failed with status at July 10, 2014

    还真看不出问题,错误信息里面原因没说明白

    另外楼主 512M 还装 64 位系统?

  • Phoenix vs Rails 性能测试 at July 10, 2014

    Elixir 许多设计和 Ruby 巨像,尤其是那个 Unit Test 的打印信息

    defprotocol Blank do
      def blank?(data)
    end
    
    defimpl Blank, for: Integer do
      def blank?(_), do: false
    end
    
    defimpl Blank, for: List do
      def blank?([]), do: true
      def blank?(_), do: false
    end
    
    defimpl Blank, for: Map do
      def blank?(map) do
        map_size(map) == 0
      end
    end
    
    defimpl Blank, for: Atom do
      def blank?(false), do: true
      def blank?(nil), do: true
      def blank?(_), do: false
    end
    
    defimpl Blank, for: BitString do
      def blank?(str) do
        String.strip(str) == ""
      end
    end
    
    defimpl Blank, for: Tuple do
      def blank?(obj) do
        obj == {}
      end
    end
    
    defmodule BlankTest do
      use ExUnit.Case
      import Blank
    
      test "Integer" do
        assert blank?(0) == false
        assert blank?(1) == false
      end
    
      test "Atom" do
        assert blank?(true) == false
        assert blank?(false) == true
        assert blank?(nil) == true
      end
    
      test "List" do
        assert blank?([]) == true
        assert blank?([1]) == false
      end
    
      test "String" do
        assert blank?("") == true
        assert blank?("1") == false
      end
    
      test "Map" do
        assert blank?(%{}) == true
        assert blank?(%{a: 1}) == false
      end
    
      test "Tuple" do
        assert blank?({}) == true
        assert blank?({1,2,3}) == false
      end
    end
    
  • app/views/layouts/application.html.erb 报错 at July 09, 2014

    贴一下你的 config/environments/development.rb, static_pages.css.scss 的代码

  • Phoenix vs Rails 性能测试 at July 09, 2014

    Elixir 的语法看起来还很不错嘛,试试看

    http://elixir-lang.org/getting_started/2.html

    iex> "hellö #{:world}"
    "hellö world"
    
  • .bashrc、.bash_profile 和.zshrc at July 09, 2014

    zsh 里面可以 source 一下 .bashrc

  • property :name, Object,保存什么类型的数据到数据库呢 at July 09, 2014

    #3 楼 @Peter 那个我不知道 DataMapper 为何要哪样做,另外 pack 其实很快的

  • property :name, Object,保存什么类型的数据到数据库呢 at July 08, 2014
    irb> a = { title: 1, name: 'foo' }
    irb> b = [ Marshal.dump(a) ].pack("m")
     => "BAh7BzoKdGl0bGVpBjoJbmFtZUkiCGZvbwY6BkVU\n"
    irb> Marshal.load(b.unpack("m").first)
     => {:title=>1, :name=>"foo"}
    

    关于 pack("m") http://www.ruby-doc.org/core-2.1.2/Array.html#pack-method

    base64 encoded string (see RFC 2045, count is width) (if count is 0, no line feed are added, see RFC 4648)

    看起来等于 Base64.encode64

    irb> require "base64"
    irb> c = Base64.encode64(Marshal.dump(a))
     => "BAh7BzoKdGl0bGVpBjoJbmFtZUkiCGZvbwY6BkVU\n" 
    irb> c == b
     => true
    
  • property :name, Object,保存什么类型的数据到数据库呢 at July 08, 2014

    http://rubydoc.info/github/datamapper/dm-core/master/DataMapper/Property/Object

  • Rails edge 终于加入了 live streaming.. at July 08, 2014

    #7 楼 @loveltyoic 我们现在用的 Faye,WebSocket 的,Ruby EventMachine 跑的

  • MongoDB 那些坑 at July 08, 2014

    #58 楼 @Rei 又好像不是,除了 @vincent 其他帐号在我们的库里面都没有。只是 @vincent 那个数据很奇怪,和我们的数据有些相似

  • MongoDB 那些坑 at July 08, 2014

    #58 楼 @Rei 那个数据,看下来像是我们的

  • 帮忙在社区里找一个人 (她是一名 HR) at July 05, 2014

    在一起

  • rails 无限级分类实现 ok,请教一个小问题 at July 05, 2014

    具体实现原理请看 #1 楼 的两个链接

  • 对于 sonrter 童鞋 “晚上加班不算加班?” 帖子的团 800 官方声明 at July 03, 2014

    #17 楼 @springwq 那个不是官方账号

  • [杭州][2014年7月2日] 似乎好久没有 RubyTuesday 了,大家一起聚聚? at July 02, 2014

  • [杭州][2014年7月2日] 似乎好久没有 RubyTuesday 了,大家一起聚聚? at July 02, 2014

    https://github.com/huacnlee/thrift_example

  • [杭州][2014年7月2日] 似乎好久没有 RubyTuesday 了,大家一起聚聚? at July 02, 2014

    今天接待的电话 150-8861-5310

  • [杭州][2014年7月2日] 似乎好久没有 RubyTuesday 了,大家一起聚聚? at July 02, 2014

    #25 楼 @JoostShao 我来讲我们用的 Thrift

  • mysql2 报错 Unsupported statement: BEGIN at July 01, 2014

    可能是京东云不支持 MySQL Transaction 的 BEGIN 语法,可以尝试换成这样:

    config/initializers/activerecord_patch.rb

    ActiveRecord::ConnectionAdapters::AbstractMysqlAdapter.class_eval do
      def begin_db_transaction
        execute "SET AUTOCOMMIT=0"
      rescue
      end
    
      def commit_db_transaction #:nodoc:
        execute "COMMIT"
        execute "SET AUTOCOMMIT=1"
      rescue
        # Transactions aren't supported
      end
    
      def rollback_db_transaction #:nodoc:
        execute "ROLLBACK"
        execute "SET AUTOCOMMIT=1"
      rescue
        # Transactions aren't supported
      end
    end
    
  • Prev
  • 1
  • 2
  • …
  • 105
  • 106
  • 107
  • 108
  • 109
  • …
  • 264
  • 265
  • Next
关于 / RubyConf / Ruby 镜像 / RubyGems 镜像 / 活跃会员 / 组织 / API / 贡献者
由众多爱好者共同维护的 Ruby 中文社区,本站使用 Homeland 构建,并采用 Docker 部署。
服务器由 赞助 CDN 由 赞助
iOS 客户端 / Android 客户端 简体中文 / English