Skip to content

Instantly share code, notes, and snippets.

@buddye
buddye / gist:1885520
Created Feb 22, 2012
rjb - Ruby Java Bridge - Loading multiple .jar files, for example, Boilerpipe and Stanford parts of speech tagger
View gist:1885520
## 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
Rails 3 Select form helper for onchange javascript event
View gist:975977
<%= f.select :offer_type, { "Custom" => "offer", "Discount" => "discount", "Video" => "video" }, {}, :onchange => 'alert(this.options[this.selectedIndex].value);' %>