Skip to content

Instantly share code, notes, and snippets.

View jamesgary's full-sized avatar

James Gary jamesgary

View GitHub Profile
@jamesgary
jamesgary / gist:5504200
Last active February 27, 2017 12:46
How to Talk to Developers - Ben Orenstein (@r00k) - RailsConf 2013

How to Talk to Developers

Ben Orenstein (@r00k)

Obey Law of Demeter

  • Reduces coupling
  • Enables refactoring

Throw something weird at people to keep their attention. Bored people don't learn anything, so focus on entertainment over being informative.

Write like a newspaper

@jamesgary
jamesgary / gist:5504424
Created May 2, 2013 18:51
Dissecting Ruby with Ruby - Richard Schneeman (@schneems) - RailsConf2013

Dissecting Ruby with Ruby

Richard Schneeman (@schneems)

  • Get into a library
    • bundle open wicked
    • Make sure you've set your $EDITOR
  • Forget fancy debuggers
    • All you need is puts
    • A rubyist's tracer round: puts "================="
  • Notation
@jamesgary
jamesgary / gist:5639529
Created May 23, 2013 21:23
Method Modeling: A Refactoring: A Refactoring
module AwesomeResource
attr_reader :awesome_attributes
def initialize(attributes={})
@awesome_attributes = attributes
@awesome_attributes.keys.each do |method_name|
create_method(method_name.to_sym) do
@awesome_attributes[method_name]
end
App = Ember.Application.create();
App.IndexRoute = Ember.Route.extend({
model: function() {
return EmberFire.Array.create({
ref: new Firebase("https://dp-ember-chat.firebaseio.com/")
});
}
});