Skip to content

Instantly share code, notes, and snippets.

View jamesgary's full-sized avatar

James Gary jamesgary

View GitHub Profile
App = Ember.Application.create();
App.IndexRoute = Ember.Route.extend({
model: function() {
return EmberFire.Array.create({
ref: new Firebase("https://dp-ember-chat.firebaseio.com/")
});
}
});
@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
@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: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:5492397
Last active December 16, 2015 20:29
What Ruby developers can learn from Go - Lionel Barrow @lionelbarrow - RailsConf 2013

What Ruby developers can learn from Go

Lionel Barrow @lionelbarrow

  • Go is compiled, garbage collected, strongly typed, OO
  • Lower level than Ruby, but still aimed at web
  • Go has an agenda
    • Not welcome to a lot of styles of writing code
    • Prodded to write code in a certain way
    • Ruby doesn't have an agenda, but it does have idioms
  • What are the design goals here?
@jamesgary
jamesgary / gist:5492121
Created April 30, 2013 21:33
From Rails to the web server to client to browser - David Padilla (@dabit) - RailsConf 2013

From Rails to the web server to client to browser

David Padilla @dabit

  • Life of a request
    • Browser creates request
    • Sends it to webserver (Unicorn)
    • Sends it to Rails
    • Sends it to spaghetti code
    • HTML is returned
  • Rack's job is to communicate between webservers and frameworks
@jamesgary
jamesgary / gist:5491390
Last active July 26, 2022 09:06
The Magic Tricks of Testing - Sandi Metz - RailsConf2013

The Magic Tricks of Testing

Sandi Metz

  • Many people say "I hate my tests"
  • They kill your productivity when they're slow
  • A little change can break your tests (even if they shouldn't)
  • They're expensive
  • They are misery incarnate
  • Just delete some tests
  • You may have too many tests testing the wrong tests
@jamesgary
jamesgary / gist:5491098
Created April 30, 2013 19:05
Rails vs. The Client - Noel Rappin (@noelrap) - RailsConf 2013

Rails vs. The Client

Noel Rappin (@noelrap)

  • Problem: Want users to have "rich client exp" (even though clients don't know what that means)
  • @dhh and @wycats offer different opinions (document vs json api)
  • But @noelrap just wants to write an e-commerce site
  • We tend to split stuff up into client stuff and server stuff between the user and data
  • @dhh says that the focus is on the server. The app lives on the server
  • @wycats says that the client is the focus, and the server just does whatever the client can't do (i.e. validation, persistence)
  • Where does the heart of your application live?
@jamesgary
jamesgary / gist:5486112
Created April 30, 2013 01:34
Michael Lopp Keynote @rands - Stable & Volatiles - RailsConf 2013

Michael Lopp Keynote @rands

Stables and Volatiles

  • Humans are bad at making decisions (see eletrical outlets)

  • Why no one single plug?

  • Look at Apple's plugs

  • You're in a hurry

  • Your gig has an expiration date

  • Switch jobs about every 3 years

@jamesgary
jamesgary / gist:5485898
Created April 30, 2013 00:41
Humanity on Rails - Daniel Azuma - RailsConf 2013

Humanity on Rails

Daniel Azuma

  • What is 'living'?
  • RailsBridge: Org to increase diversity in tech
  • Diversity's a big issue
  • How do we attract more minorities?
  • Yahoo recently canned their remote working program
  • What do we make of all of this?
  • Daniel got laid off, went back to school to study theology at Regent