Skip to content

Instantly share code, notes, and snippets.

View carlosbrando's full-sized avatar

Carlos Brando carlosbrando

View GitHub Profile
@carlosbrando
carlosbrando / url_dsl.rb
Created December 14, 2009 17:45 — forked from defunkt/url_dsl.rb
URL DSL
require 'open-uri'
# url dsl -- the ultimate url dsl!
#
# You just can't beat this:
#
# $ irb -r url_dsl
# >> include URLDSL
# => Object
# >> http://github.com/defunkt.json
var DateHelper = {
// Takes the format of "Jan 15, 2007 15:45:00 GMT" and converts it to a relative time
// Ruby strftime: %b %d, %Y %H:%M:%S GMT
time_ago_in_words_with_parsing: function(from) {
var date = new Date;
date.setTime(Date.parse(from));
return this.time_ago_in_words(date);
},
time_ago_in_words: function(from) {
class Object
def try(method_id, *args, &block)
respond_to?(method_id) ? send(method_id, *args, &block) : nil
end
end
require 'rubygems'
require 'spec'
describe Object, "#try" do
# Video: http://rubyhoedown2008.confreaks.com/08-chris-wanstrath-keynote.html
Olá, Eu sou Chris Wanstrath.
Quando Jeremy me chamou para falar, eu disse sim. Maldição, eu disse sim.
Imediatamente. Mas, depois que parei para pensar, Espera, por quê? Por que eu?
O que eu vou dizer de interessante? Alguma coisa sobre Ruby, talvez. Talvez,
sobre o futuro dele. Ou o futuro de algo, pelo menos. Isto soa como um
keynote-y.
@carlosbrando
carlosbrando / gist:10861
Created September 15, 2008 13:56 — forked from Neto/gist:10791
CmdUtils.CreateCommand({
name: "viu",
icon: "http://www.viuisso.com.br/favicon.ico",
author: {name: "Mentor Muniz", email: "neto@bullet.com.br"},
description: "Viu Isso? Search",
homepage: "http://www.viuisso.com.br/",
takes: {"query": noun_arb_text},
execute: function (q) {
Action Pack
* All 2xx requests are considered successful [Josh Peek]
* Deprecate the limited follow_redirect in functional tests. If you wish to follow redirects, use integration tests. [Michael Koziarski]
* Fixed that AssetTagHelper#compute_public_path shouldn't cache the asset_host along with the source or per-request proc's won't run [DHH]
* Deprecate define_javascript_functions, javascript_include_tag and friends are much better [Michael Koziarski]
What's new in Rails 2.0.4
-------------------------
Action Mailer
* Less verbose mail logging: just recipients for :info log level; the whole email for :debug only. #8000 [iaddict, Tarmo Tänav]
* Updated TMail to version 1.2.1 [raasdnil]
* Fixed that you don't have to call super in ActionMailer::TestCase#setup #10406 [jamesgolick]