Skip to content

Instantly share code, notes, and snippets.

View MichaelTorfs's full-sized avatar

Michael Torfs MichaelTorfs

View GitHub Profile
@MichaelTorfs
MichaelTorfs / message_thread.rb
Created May 28, 2011 14:04
non guessable url with md5 generator
def md5hash
md5 = Digest::MD5.hexdigest(self.id.to_s + self.initial_sender_email + MD5_SECRET)
logger.info "DEBUG: md5 = " + md5
return self.id.to_s + "-" + md5
end
def check_md5(md5_to_check)
md5 = Digest::MD5.hexdigest(self.id.to_s + self.initial_sender_email + MD5_SECRET)
if md5 == md5_to_check
return true
@MichaelTorfs
MichaelTorfs / OSX gem env
Created February 15, 2011 15:55
Rails test performance under Windows & OSX
MacBook-Pro-van-Michael-Torfs:rake michaeltorfs$ gem env
RubyGems Environment:
- RUBYGEMS VERSION: 1.5.2
- RUBY VERSION: 1.8.7 (2009-06-12 patchlevel 174) [universal-darwin10.0]
- INSTALLATION DIRECTORY: /Library/Ruby/Gems/1.8
- RUBY EXECUTABLE: /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby
- EXECUTABLE DIRECTORY: /usr/bin
- RUBYGEMS PLATFORMS:
- ruby
- universal-darwin-10
C:\Users\Michael\Devel\fitrent>rake development radiant:extensions:google_maps:migrate --trace
(in C:/Users/Michael/Devel/fitrent)
** Invoke development (first_time)
** Execute development
** Invoke environment (first_time)
** Execute environment
rake aborted!
wrong number of arguments (1 for 2)
C:/Users/Michael/Devel/fitrent/vendor/extensions/google_maps/vendor/plugins/spatial_adapter/lib/mysql_spatial_adapter.rb:75:in `attribute_condition'
C:/Users/Michael/Devel/fitrent/vendor/extensions/google_maps/vendor/plugins/spatial_adapter/lib/mysql_spatial_adapter.rb:75:in `get_rails2_conditions'
C:/Ruby/ruby/lib/ruby/gems/1.8/gems/radiant-0.8.0/vendor/rails/actionpack/lib/action_view/helpers/date_helper.rb:62:in `distance_of_time_in_words'
C:/Ruby/ruby/lib/ruby/gems/1.8/gems/radiant-0.8.0/vendor/rails/actionpack/lib/action_view/helpers/date_helper.rb:103:in `time_ago_in_words'
C:/Users/Michael/Devel/fitrent/vendor/extensions/dashboard/app/views/admin/dashboard/index.html.haml:30:in `_run_haml_vendor47extensions47dashboard47app47views47admin47dashboard47index46html46haml'
C:/Users/Michael/Devel/fitrent/vendor/extensions/dashboard/app/views/admin/dashboard/index.html.haml:23:in `each'
C:/Users/Michael/Devel/fitrent/vendor/extensions/dashboard/app/views/admin/dashboard/index.html.haml:23:in `_run_haml_vendor47extensions47dashboard47app47views47admin47dashboard47index46html46haml'
C:/Ruby/ruby/lib/ruby/gems/1.8/gems/radiant-0.8.0/vendor/plugins/haml/lib/haml/helpers.rb:261:in `call'
C:/Ruby/ruby/lib/ruby/gems/1.8/gems/radiant-0.8.0/vendor/plugins/haml/lib/haml/helpers.rb:261:in `capture_haml'
C:/Ruby/rub