Public Gists by carlosbrando

Gravatar
Tue Sep 15 10:18:04 -0700 2009
1
2
3
(rdb:1) p "uma string normal"
"uma string normal"
(rdb:1) p "uma string com o sinal de ;"
Gravatar
Tue Sep 15 09:57:00 -0700 2009
1
2
3
(rdb:1) p "; "
SyntaxError Exception: compile error
/opt/local/lib/ruby/gems/1.8/gems/sociably-0.0.1/lib/sociably/renderable.rb:16: unterminated string meets end of file
Gravatar
Mon Sep 07 15:00:20 -0700 2009
1
2
3
# Exemplo do uso de rotas polimórficas para gerar a URL à partir
# da classe de um modelo
 
Gravatar
Thu Jul 30 14:42:26 -0700 2009
1
2
3
Rails::Initializer.run do |config|
 
  # ...
Gravatar
Thu May 21 12:03:48 -0700 2009
1
2
3
[carlosbrando:remarkable(master)]$ rake pre_commit
(in /Users/carlosbrando/Projects/github/remarkable)
cd /Users/carlosbrando/Projects/github/remarkable/remarkable
Gravatar
Thu May 21 11:58:38 -0700 2009
1
2
3
[carlosbrando:remarkable(master)]$ rake pre_commit
(in /Users/carlosbrando/Projects/github/remarkable)
cd /Users/carlosbrando/Projects/github/remarkable/remarkable
Gravatar
Thu May 21 11:49:31 -0700 2009
1
2
3
1)
ArgumentError in 'Admin::ProductOptionTypesController GET index should == [#<Discount id: 14, value: 344, on_percentage: true, active: true, discountable_id: 7, discountable_type: "Product", starting_on: "2009-05-20 18:47:12", ending_on: "2009-05-22 18:47:12", created_at: "2009-05-21 18:47:12", updated_at: "2009-05-21 18:47:12">]'
Cannot yield from a Proc type filter. The Proc must take two arguments and execute #call on the second argument.
Gravatar
Wed Feb 11 03:36:07 -0800 2009
1
2
3
# Should prepare a formatted link in the following format:
# <li><a href="#"><span>Texto</span></a></li>
#
Gravatar
Thu Feb 05 10:05:05 -0800 2009
1
2
3
class MessagesBuilder
  def initialize
    @description = nil
Gravatar
Thu Feb 05 09:08:54 -0800 2009
1
2
3
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
Gravatar
Fri Jan 23 03:26:08 -0800 2009
1
2
3
(function($){
$.fn.defaultValueActsAsHint = function() {
return this.each(function() {
Gravatar
Fri Jan 09 12:19:57 -0800 2009
1
2
3
class Object
  def try(method_id, *args, &block)
    respond_to?(method_id) ? send(method_id, *args, &block) : nil
gist: 24491 Silent method
Gravatar
Thu Nov 13 08:47:52 -0800 2008
1
2
3
def silent(command)
  system "#{command} &> /dev/null"
end
Gravatar
Thu Nov 06 17:48:02 -0800 2008
1
2
3
class NilClass
  def to_s
    "n/a"
Gravatar
Thu Oct 16 08:38:20 -0700 2008
1
2
3
# Video: http://rubyhoedown2008.confreaks.com/08-chris-wanstrath-keynote.html
 
Olá, Eu sou Chris Wanstrath.
Gravatar
Mon Sep 15 06:56:22 -0700 2008
1
2
3
CmdUtils.CreateCommand({
  name: "viu",
  icon: "http://www.viuisso.com.br/favicon.ico",
Gravatar
Fri Sep 05 05:01:25 -0700 2008
1
2
3
Action Pack
 
* All 2xx requests are considered successful [Josh Peek]
Gravatar
Wed Sep 03 06:39:18 -0700 2008
1
2
3
What's new in Rails 2.0.4
-------------------------
 
Gravatar
Wed Jul 30 12:05:36 -0700 2008
1
render :template => "weblog/show", :locals => {:customer => Customer.new}
Gravatar
Mon Jul 28 11:08:28 -0700 2008
1
2
3
class Post < ActiveRecord::Base
  has_many :comments