This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| -- PostgreSQL 9.2 beta (for the new JSON datatype) | |
| -- You can actually use an earlier version and a TEXT type too | |
| -- PL/V8 http://code.google.com/p/plv8js/wiki/PLV8 | |
| -- Inspired by | |
| -- http://people.planetpostgresql.org/andrew/index.php?/archives/249-Using-PLV8-to-index-JSON.html | |
| -- http://ssql-pgaustin.herokuapp.com/#1 | |
| -- JSON Types need to be mapped into corresponding PG types | |
| -- |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * inspired by JavaCPP's Loader utility | |
| * @see http://bit.ly/loader-java | |
| */ | |
| public class Caller { | |
| /** | |
| * Returns the {@link Class} object that contains a caller's method. | |
| * | |
| * @param i the offset on the call stack of the method of interest |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| source 'https://rubygems.org' | |
| gem 'rails', '3.2.16' # or whatever | |
| # ... | |
| group :assets do | |
| # make sure you have the latest rhino : | |
| gem 'therubyrhino', '>= 2.0.2', :platform => :jruby | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require 'java' | |
| input = 'INPUT_FILE' | |
| output = 'WHERE_TO_COPY' | |
| input_file = nil; input_channel = nil; output_channel = nil | |
| new_io_channels = Proc.new do | |
| input_file = File.open(input, 'r') unless input_file | |
| input_channel = input_file.to_channel |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| * Wait Until Exists Version v0.2 - http://javascriptisawesome.blogspot.com/ | |
| * | |
| * | |
| * TERMS OF USE - Wait Until Exists | |
| * | |
| * Open source under the BSD License. | |
| * | |
| * Copyright © 2011 Ivan Castellanos | |
| * All rights reserved. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?xml version="1.0" encoding="UTF-8"?> | |
| <web-app> <!-- NS and Schemas omitted --> | |
| <!-- Rails (filter/servlet) configuration ... --> | |
| <listener> | |
| <listener-class> | |
| org.jruby.rack.rails.RailsServletContextListener | |
| </listener-class> | |
| </listener> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require 'rhino' | |
| Rhino::Context.open do |context| | |
| context.eval "function bar(foo) { return foo + 'bar'; }" | |
| bar = context[:bar] | |
| if bar.is_a?(org.mozilla.javascript.Function) | |
| puts bar.call('foo') | |
| end | |
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| klass = org.apache.catalina.startup.Tomcat # change me | |
| java_class = klass.java_class.to_java | |
| code_source = java_class.getProtectionDomain.getCodeSource | |
| puts code_source.getLocation.toString |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require 'rubygems' | |
| %w(action_controller/railtie).map &method(:require) | |
| class JrubyRackTest < Rails::Application | |
| config.secret_token = routes.append { root :to => 'send_file#deliver' }.inspect | |
| initialize! | |
| end | |
| run JrubyRackTest |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| group :assets do | |
| #gem 'sass-rails', '~> 3.1.4' | |
| #gem 'coffee-rails', '~> 3.1.1' | |
| #gem 'uglifier', '>= 1.0.3' | |
| gem 'less', :git => 'git://github.com/kares/less.rb.git', :submodules => true | |
| gem 'less-rails', '>= 2.2.1' | |
| gem 'less-rails-bootstrap' # optional | |
| gem 'therubyracer', :platforms => :ruby |