Ruby China
  • Topics
  • 招聘
  • Wiki
  • 酷站
  • Gems
  • Sign Up
  • Sign In
许辉辉
@xhh
VIP
NO. 2923 / 2012-07-18

[email protected]
连云港
2 Topics / 10 Replies
0 Followers
0 Following
1 Favorites
keep it simple, sweet!
GitHub Public Repos
  • hello_purerl 3

    A demo project showing how to integrate PureScript (via purerl) into an Elixir (Phoenix) project.

  • mistreevous 0

    A tool to build and execute behaviour trees in JavaScript and TypeScript

  • BehaviorTree.CPP 0

    Behavior Trees Library in C++. Batteries included.

  • gleam 0

    ⭐️ A friendly language for building type-safe, scalable systems!

  • esgleam 0

    `esbuild` for Gleam (no NodeJS/Deno needed)

  • lustre-labs.github.io 0

  • mygame 0

    Trying to use Kaboom.js in Gleam.

  • snag 0

    ⛵ A boilerplate-free ad-hoc error type

  • lustre 0

    A playground for building creative web apps – powered by Gleam.

  • hi_ash 0

    Get started with the Ash framework in a Phoenix project

More on GitHub
  • Overview
  • Topics
  • Replies
  • Favorites
  • Following
  • Followers
  • 团购电子书:Clojure Applied: From Practice to Practitioner at April 09, 2015

    @huobazi 和 Closure 发音一样:http://dict.youdao.com/search?q=closure

  • 想知道有哪些合适 (最好免费) 的平台可以用来部署小规模应用? at April 20, 2014

    如果考虑基于 CloudFoundry 的 PASS 的话,可以看一下 http://www.mopaas.com/#price_plan

  • Github 开发的心编辑器 Atom 邀请码 at February 27, 2014

    [email protected] 多谢!

  • Active Record: 資料表操作里的 group 应该怎么选择性获取 at February 04, 2013

    得到 price > 0 的计数:

    Animal.select('max(id) as id, name, sum(number) as number').where('price > 0').group(:name)
    # => [#<Animal id: 3, name: "乌龟", number: 2>, #<Animal id: 6, name: "猫", number: 4>] 
    

    如果要得到所有的计数(不限制 price),应该需要分开做:

    animals = Animal.select('max(id) as id, name').where('price > 0').group(:name)
    # => [#<Animal id: 3, name: "乌龟">, #<Animal id: 6, name: "猫">] 
    
    numbers = Animal.group(:name).sum(:number)
    # => {"乌龟"=>3, "猫"=>4} 
    
    animals.each { |animal| animal.number = numbers[animal.name] }
    # => [#<Animal id: 3, name: "乌龟", number: 3>, #<Animal id: 6, name: "猫", number: 4>]
    
  • Active Record: 資料表操作里的 group 应该怎么选择性获取 at January 30, 2013

    方法一(会执行两条 SQL 语句):

    Animal.where(id: Animal.select('max(id) as id').where('price > 0').group(:name).pluck(:id))

    方法二(一条 SQL):

    Animal.find_by_sql('select b.* from (select max(id) as id from animals where price > 0 group by name) a inner join animals b on (a.id = b.id)')

  • 分享: 使用 Rspec, Capybara 和 Zeus 等测试 Rails 应用 at October 21, 2012

    #1 楼 @lyfi2003 谢谢建议,之前用过 spork, 因为一些原因改用了 zeus, 也有 guard-zeus 的 gem.

  • 如何使用 Capistrano 部署 rails 并且使用 remote_cache 选项? at July 21, 2012

    设置 set :deploy_via, :remote_cache 就可以了,可以参考 http://www.iteye.com/topic/1114390

  • [北京][2012年07月21日] Ruby 活动公告 at July 19, 2012

    #32 楼 @karma 当然记得 ;) 可能我们仨都去

  • Sinatra + Backbone - To-do App 分享 at July 18, 2012

    推荐 ember.js

  • [北京][2012年07月21日] Ruby 活动公告 at July 18, 2012

    报名 [email protected]

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