Belfast Ruby - Interesting things from the GitHub codebase

Ee5bae7fa46b3195869c285ecbb4619e?s=47 Coby Chapple
November 12, 2014

Belfast Ruby - Interesting things from the GitHub codebase

As part of Break (http://breakconf.org), I gave a talk at the Belfast Ruby (http://belfastruby.com/) meetup talking about a few interesting things from the GitHub codebase.

Ee5bae7fa46b3195869c285ecbb4619e?s=128

Coby Chapple

November 12, 2014
Tweet

Transcript

  1. 4.

    A selection of interesting* things I’ve learnt doing design at

    GitHub. *Actual levels of interestingness may vary.
  2. 7.

    • Responsive is better than fast. • It’s not fully

    shipped until it’s fast. • Anything added dilutes everything else. • Practicality beats purity. • Approachable is better than simple. • Mind your words, they are important. • Speak like a human. • Half measures are as bad as nothing at all. • Encourage flow. • Non-blocking is better than blocking. • Favor focus over features. • Avoid administrative distraction. • Design for failure. • Keep it logically awesome.
  3. 9.
  4. 10.
  5. 13.

    GitHub isn’t a Rails shop. It’s not even a Ruby

    shop. It’s a Unix shop. — @rtomayko “
  6. 22.
  7. 24.
  8. 25.
  9. 26.

    <% if current_repository.pushable_by?(current_user) %> <% if pull_request && pull_request.head_ref_deletable_by?(current_user) &&

    branch != current_repository.default_branch %> <%= link_to "Delete branch", … %> <% end %> <% end %> <% if view.can_delete_branch? %> <%= link_to "Delete branch", … %> <% end %>
  10. 40.

    require "dat/science" class YourApp::Widget def allows?(user) experiment = Dat::Science::Experiment.new "widget-permissions"

    do |e| e.control { model.check_user(user).valid? } e.candidate { user.can? :read, model } end experiment.run end end
  11. 41.

    require "dat/science" class YourApp::Widget include Dat::Science def allows?(user) science "widget-permissions"

    do |e| e.control { model.check_user(user).valid? } e.candidate { user.can? :read, model } end end end
  12. 47.

    --- # Areas of Responsibility in the github/github codebase 2fa:

    name: "Two-Factor Authentication" teams: - "@github/2fa" abilities: name: "Abilities" teams: - "@github/abilities" - "@github/abilibuddies" api: name: "API / OAuth" teams: - "@github/api" - "@github/oauth-of-tomorrow"
  13. 48.
  14. 49.