Skip to content

Instantly share code, notes, and snippets.

View jamesgary's full-sized avatar

James Gary jamesgary

View GitHub Profile
#!/usr/bin/env ruby
require 'rubygems'
require 'gmail'
class SecretSanta
class << self
def get_secret_santas(people, couples)
invalid = true
while(invalid) do
@jamesgary
jamesgary / gist:5485061
Last active December 16, 2015 19:29
Testing HTTP APIs in Ruby - @shaiguitar - RailsConf 2013

Testing HTTP APIs in Ruby

@shaiguitar

  • Everything as a service
  • Test it!
  • Problem statement: Testing a server/client HTTP API
  • Good plan:
    • Create API
    • Build client lib that can be used in confusmer apps
  • Make it easy for consumer apps to test w/ our client library
@jamesgary
jamesgary / gist:5485331
Created April 29, 2013 22:31
Object-Oriented Lessons for a Service-Oriented World - Chris Kelly (@amateurhuman) - RailsConf 2013

Object-Oriented Lessons for a Service-Oriented World

Chris Kelly (@amateurhuman)

  • Works for New Relic as Happiness Engineer
  • These aren't hard principles, mostly ideas for now
  • Monorail - Monolithic Rails App
  • Network-based application software instead of SOA
  • (not necessarily building 'service')
  • Monorail (which is a mess) <-> Cache <-> Database
  • Your app is a special snowflake that breaks every time something changes.
  • Apt metaphor: Crystaline architecture shatters when a small thing changes
@jamesgary
jamesgary / gist:5485643
Created April 29, 2013 23:35
Incremental Design - Rebecca Miller-Webster and Savannah Wolf - RailsConf 2013

Incremental Design

Rebecca Miller-Webster and Savannah Wolf

  • Rebecca: Developer, Savannah: Designer

  • How do you make design changes?

  • Big redesigns are often long and frustrating

  • Designers throw the design over the wall

  • Developers either are confused by it, or 'screw it up'

  • Redesigning page by page can lead to technical debt, and is awkward

@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
@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: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: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: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