Skip to content

Instantly share code, notes, and snippets.

ENV['GEM_HOME'] = '/home/<dreamhost user name>/.gems'
ENV['GEM_PATH'] = '$GEM_HOME:/usr/lib/ruby/gems/1.8'
require 'rubygems'
Gem.clear_paths
public void encodeBegin( FacesContext context ) throws IOException {
super.encodeBegin( context );
// Without this 'if' statement everything gets rendered again on every partial submit
if( getChildCount() == 0 ) {
processTagAttributes();
if( fieldSetContainerList != null && !fieldSetContainerList.isEmpty() ) {
# Convert all dvdmedia files in the current directory to iso images
# OSX only
# .dvdmedia files are really just folders that hold the VIDEO_TS/AUDIO_TS
# but adding .dvdmedia make OSX do nice things
movie_directory = Dir.open( Dir.pwd )
movie_directory.entries.each do |movie|
if movie.include? '.dvdmedia' then
movie_name = movie.chomp '.dvdmedia'
puts movie + " --> " + movie_name
result = `hdiutil makehybrid -udf -udf-volume-name #{movie_name} -o #{movie_name} #{movie}`