Skip to content

Instantly share code, notes, and snippets.

@vanderhoorn
vanderhoorn / rails-2-3-14-select_options.rb
Created March 23, 2012 20:05
Monkey patch for the "XSS Vulnerability in the select helper"
# A Rails 2.3.14 monkey patch for the "XSS Vulnerability in the select helper", as reported in:
# http://groups.google.com/group/rubyonrails-security/browse_thread/thread/9da0c515a6c4664
#
module ActionView
module Helpers
class InstanceTag #:nodoc:
private
def add_options(option_tags, options, value = nil)
if options[:include_blank]
@CameronCarroll
CameronCarroll / RCF2.Rakefile.rb
Created July 2, 2012 21:44
Rakefile to compile Ruby/C/Fortran extensions
# Ruby/C/Fortran Bridge Rakefile
# Cameron Carroll, July 2012
# Purpose: Rake build script to facilitate calling Fortran code from Ruby in order to outsource
# heavy lifting computation. This script will compile Fortran and C code in present directory
# but leaves implementation and linking up to the user.
#
# Notes: This script may require a little bit of configuration depending on the system.
# 1: The Ruby include flags are specifically for MY system. I haven't found a way to generate them,
# so you have to either tailor them by hand or generate a extconf.rb makefile, enable verbose mode,
# and copy the include flags from the compile command. Yeah, I know, I know...
@nathania
nathania / RCF2.Rakefile.rb
Created August 4, 2012 21:09 — forked from CameronCarroll/RCF2.Rakefile.rb
Rakefile to compile Ruby/C/Fortran extensions
# Ruby/C/Fortran Bridge Rakefile
# Cameron Carroll, July 2012
# Purpose: Rake build script to facilitate calling Fortran code from Ruby in order to outsource
# heavy lifting computation. This script will compile Fortran and C code in present directory
# but leaves implementation and linking up to the user.
#
# Notes: This script may require a little bit of configuration depending on the system.
# 1: The Ruby include flags are specifically for MY system. I haven't found a way to generate them,
# so you have to either tailor them by hand or generate a extconf.rb makefile, enable verbose mode,
# and copy the include flags from the compile command. Yeah, I know, I know...