Skip to content

Instantly share code, notes, and snippets.

View spastorino's full-sized avatar

Santiago Pastorino spastorino

View GitHub Profile

Keybase proof

I hereby claim:

  • I am spastorino on github.
  • I am spastorino (https://keybase.io/spastorino) on keybase.
  • I have a public key whose fingerprint is 2CAD 3D67 ABB3 3654 1EF2 065C EDDB 084C A40D E1F5

To claim this, I am signing this object:

~ cat .zshenv
source /usr/local/opt/chruby/share/chruby/chruby.sh
source /usr/local/opt/chruby/share/chruby/auto.sh
chruby 2.2
~ ruby -v
ruby 2.2.0dev (2014-06-05 trunk 46357) [x86_64-darwin13]
~ cd /tmp/2_1_project
/tmp/2_1_project ruby -v
ruby 2.1.2p95 (2014-05-08 revision 45877) [x86_64-darwin13.0]
/tmp/2_1_project cd
use std::ops::{Add, Sub, Mul};
#[derive(Show, Copy)]
struct Vec2<T> {
x: T,
y: T,
}
// Apply bound to `T` at first instance of `T`. `T`
// must implement the `Add` trait.
use std::ops::{Add, Sub, Mul};
#[derive(Show, Copy)]
struct Vec2<T> {
x: T,
y: T,
}
// Apply bound to `T` at first instance of `T`. `T`
// must implement the `Add` trait.
@spastorino
spastorino / gist:278638
Created January 16, 2010 04:23
Missings do on rdoc
diff --git a/activerecord/lib/active_record/base.rb b/activerecord/lib/active_record/base.rb
index 6ecd506..67eb3f2 100755
--- a/activerecord/lib/active_record/base.rb
+++ b/activerecord/lib/active_record/base.rb
@@ -1746,10 +1746,10 @@ module ActiveRecord #:nodoc:
# class Article < ActiveRecord::Base
# def self.find_with_scope
# with_scope(:find => { :conditions => "blog_id = 1", :limit => 1 }, :create => { :blog_id => 1 }) do
- # with_scope(:find => { :limit => 10 })
+ # with_scope(:find => { :limit => 10 }) do
santiago@debian:~/Documentos/WyeWorks/Proys/rails/actionmailer$ rake test
(in /home/santiago/Documentos/WyeWorks/Proys/rails/actionmailer)
/home/santiago/Documentos/WyeWorks/Proys/rails/activesupport/lib/active_support/core_ext/time/conversions.rb:64: warning: method redefined; discarding old to_date
/home/santiago/Documentos/WyeWorks/Proys/rails/activesupport/lib/active_support/core_ext/time/conversions.rb:81: warning: method redefined; discarding old to_datetime
(eval):1: warning: method redefined; discarding old template
/home/santiago/Documentos/WyeWorks/Proys/rails/activesupport/lib/active_support/core_ext/string/output_safety.rb:40: warning: discarding old concat
/home/santiago/Documentos/WyeWorks/Proys/rails/activesupport/lib/active_support/core_ext/class/inheritable_attributes.rb:168: warning: instance variable @_view_paths not initialized
/home/santiago/Documentos/WyeWorks/Proys/rails/activesupport/lib/active_support/core_ext/class/inheritable_attributes.rb:168: warning: instance variable @default_ur
Pending Cases:
test_response_cache_control_from_rackish_app at ./test/dispatch/response_test.rb, line 190
test_response_cache_control_from_railsish_app at ./test/dispatch/response_test.rb, line 171
test_response_charset_and_content_type_from_rackish_app at ./test/dispatch/response_test.rb, line 226
test_response_charset_and_content_type_from_railsish_app at ./test/dispatch/response_test.rb, line 208
test_file_stream at ./test/controller/send_file_test.rb, line 54
#!/usr/bin/env ruby
require 'rubygems'
require 'twitter'
users = %w(wyeworks spastorino joseicosta smartinez87 nartub)
tweets = users.map { |user_name| Twitter::Search.new.from(user_name) }.
inject([]) { |tweets, search| tweets + search.fetch(5).results }.
sort { |t1, t2| Date.parse(t2.created_at) <=> Date.parse(t1.created_at) }[0..4]
diff --git a/activesupport/lib/active_support/core_ext/string/output_safety.rb b/activesupport/lib/active_support/core_ext/string/output_safety.rb
index 3977971..567ba00 100644
--- a/activesupport/lib/active_support/core_ext/string/output_safety.rb
+++ b/activesupport/lib/active_support/core_ext/string/output_safety.rb
@@ -71,15 +71,12 @@ module ActiveSupport #:nodoc:
super(ERB::Util.h(value))
end
end
+ alias << concat
@spastorino
spastorino / date_helper.rb
Created February 25, 2010 03:38
*_select for date_helper
module ActionView
module Helpers
module DateHelper
[:second, :minute, :hour, :day, :month, :year].each do |name|
self.module_eval(<<-EOS)
def #{name.to_s}_select(object_name, method, options = {}, html_options = {})
InstanceTag.new(object_name, method, self, options.delete(:object)).to_#{name.to_s}_select_tag(options, html_options)
end
EOS
end