Skip to content

Instantly share code, notes, and snippets.

@buddye
buddye / gist:1885520
Created February 22, 2012 15:21
rjb - Ruby Java Bridge - Loading multiple .jar files, for example, Boilerpipe and Stanford parts of speech tagger
## rjb - Ruby Java Bridge - Loading multiple .jar files, for example, Boilerpipe and Stanford parts of speech tagger
## Works in Ruby 1.9.3 and Nginx with Unicorn. Doesn't work in Phusion Passenger. In unicorn, preload_app has to be false (default)
## 'java' folder is in the root rails folder.
## http://rjb.rubyforge.org/
## For Stanford PoS tagger: ../java/ folder contains: stanford-postagger.jar, left3words-wsj-0-18.tagger
## http://nlp.stanford.edu/software/tagger.shtml
## For Boilerpipe, ../java/ folder contains: boilerpipe-1.2.0.jar, nekohtml-1.9.13.jar, xerces-2.9.1.jar
@buddye
buddye / gist:975977
Created May 17, 2011 04:57
Rails 3 Select form helper for onchange javascript event
<%= f.select :offer_type, { "Custom" => "offer", "Discount" => "discount", "Video" => "video" }, {}, :onchange => 'alert(this.options[this.selectedIndex].value);' %>