Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am elomar on github.
  • I am elomar (https://keybase.io/elomar) on keybase.
  • I have a public key ASCFlZPeyV7xKXbn-W29C_KmJXnjqA2w4OokNCHmM9x9_Ao

To claim this, I am signing this object:

# encoding: utf-8
class Contato
attr_accessor :nome, :telefone
end
opcao = nil
contatos = []
def somapares(*pares)
pares.map {|par| par[0] + par[1]}
end
somapares [1, 5], [4, 7]
Ideias on a nicer ActiveResource API
= ActiveResource
== Guidelines
ARes is a platform to build clients to restful-like web services. It maps resources to objects that complies with the ActiveModel API.
To enjoy the advantages of being restful (whose discussion is beyond the scope of this gist), ARes should support:
* using HTTP verbs, headers and status code as they are meant;
# encoding: UTF-8
require 'sinatra'
require 'sinatra/mongo'
require 'csv'
require 'geokit'
set :mongo, 'mongo://localhost:27017/fulbright2010'
set :haml, {:format => :html5}
GOOGLE_APPLICATION_ID = "ABQIAAAAAZX3aTjRo2xfx1lrVs0boRS82gkS-Z98sZltoqpfSzIi6nwd6xQTdeXxh6sEhSJJ7xiEPfAeocsvE"
ART 131 001 Photography I
ART 141 001 Beginning Graphic Design
ASTR 1010 001 Intro to Astronomy I
BUS 101 001 Intro to Business
BUS 104 W01 Computer Presentations
BUS 112 T01 Personal Finance
BUS 278 T01 Entrepreneurship
namespace :templates do
desc "Copy all the templates from rails to the application directory for customization"
task :copy do
require 'rubygems'
require 'rubygems/gem_runner'
require 'fileutils'
railties = (version = ENV['VERSION']) ?
Gem.cache.find_name('railties', "= #{version}").first :
Gem.cache.find_name('railties').sort_by { |g| g.version }.last
base_path = railties.full_gem_path

Bio

Why do you use Ruby and/or Rails? How would you like to see them improve?

Outline the specific project you're proposing.

Why is this important to the Ruby and/or Rails communities at large? Why is this important to you?

= pagseguro_form @order, :submit => "Efetuar pagamento!", :email => @seller.email
def pagseguro
render unless request.post?
seller = Seller.find params[:id]
pagseguro_notification(seller.authenticity_token) do |notification|
# ...
end
end