Skip to content

Instantly share code, notes, and snippets.

@craigmcnamara
craigmcnamara / RailsInitializerTest.txt
Created March 11, 2011 16:30
target/surefire-reports/org.torquebox.rails.core.RailsRuntimeInitializerTest.txt
-------------------------------------------------------------------------------
Test set: org.torquebox.rails.core.RailsRuntimeInitializerTest
-------------------------------------------------------------------------------
Tests run: 9, Failures: 0, Errors: 9, Skipped: 0, Time elapsed: 98.053 sec <<< FAILURE!
testInitializeWithGems(org.torquebox.rails.core.RailsRuntimeInitializerTest) Time elapsed: 75.668 sec <<< ERROR!
C:/torquebox/components/web/target/rubygems/gems/rails-2.3.11/lib/initializer.rb:437:in `initialize_database': load error: active_record/base -- java.lang.OutOfMemoryError: Java heap space (LoadError)
from C:/torquebox/components/web/target/rubygems/gems/rails-2.3.11/lib/initializer.rb:141:in `process'
from C:/torquebox/components/web/target/rubygems/gems/rails-2.3.11/lib/initializer.rb:113:in `run'
from vfs:/C:/torquebox/components/web/web-core/src/test/rails/ballast/config/environment.rb:9
from vfs:/C:/torquebox/components/web/web-core/src/test/rails/ballast/config/environment.rb:89:in
irb(main):002:0> Dir.chdir { Dir.pwd }
=> "C:/Users/craig"
irb(main):003:0> ENV['HOME']
=> "C:\\Users\\craig"
irb(main):004:0>
-------------------------------------------------------------------------------
Test set: org.torquebox.rails.core.RailsRuntimeInitializerTest
-------------------------------------------------------------------------------
Tests run: 9, Failures: 0, Errors: 9, Skipped: 0, Time elapsed: 101.312 sec <<< FAILURE!
testInitializeWithGems(org.torquebox.rails.core.RailsRuntimeInitializerTest) Time elapsed: 78.353 sec <<< ERROR!
C:/torquebox/components/web/target/rubygems/gems/rails-2.3.11/lib/initializer.rb:437:in `initialize_database': load error: active_record/base -- java.lang.OutOfMemoryError: Java heap space (LoadError)
from C:/torquebox/components/web/target/rubygems/gems/rails-2.3.11/lib/initializer.rb:141:in `process'
from C:/torquebox/components/web/target/rubygems/gems/rails-2.3.11/lib/initializer.rb:113:in `run'
from vfs:/C:/torquebox/components/web/web-core/src/test/rails/ballast/config/environment.rb:9
from vfs:/C:/torquebox/components/web/web-core/src/test/rails/ballast/config/environment.rb:89:i
JRuby limited openssl loaded. http://jruby.org/openssl
gem install jruby-openssl for full support.
Fetching source index for http://rubygems.org/
Fetching source index for http://rubygems.torquebox.org/
Could not find gem 'torquebox-messaging (= 1.0.0.CR1, runtime)' in any of the ge
m sources listed in your Gemfile.
jruby -S rails new torquebox-template -m %TORQUEBOX_HOME%\share\rails\template.rb
@craigmcnamara
craigmcnamara / Rake Daemon
Created March 22, 2011 19:25
A long running rake process as a daemon with output redirection
RAILS_ENV=environment rake task 2>&1 > log.log &
@craigmcnamara
craigmcnamara / Example Pagelander Template
Created April 7, 2011 19:42
This is a Liquid template with access to a Page object and fb_page and fb_user information
<div id="fb-root">
<div style="background-color:#FFFFFF; margin-top: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px;min-height:750px;">
<link rel="stylesheet" type="text/css" href="{{page.host_path}}/screen.css" />
<div id="cny-home-expo-01">
<img src="{{page.host_path}}/cny-home-expo_01.gif" width="520" height="109" alt="">
</div>
<div id="cny-home-expo-02">
<img src="{{page.host_path}}/cny-home-expo_02.gif" width="253" height="362" alt="">
</div>
<div id="cny-home-expo-03">
@craigmcnamara
craigmcnamara / nginx.conf
Created June 17, 2011 19:13 — forked from cmrosado/nginx.conf
the passenger file
user _www;
worker_processes 1;
#error_log logs/error.log;
#error_log logs/error.log notice;
#error_log logs/error.log info;
#pid logs/nginx.pid;
@craigmcnamara
craigmcnamara / gist:1051579
Created June 28, 2011 16:53
FB request params
def do_fbjs_create
post :create, :contact => @fb_contact, :fb_sig_is_ajax => 1, :page_slug => @landing_page.slug
end
def do_fbml_create
post :create, :contact => @fb_contact, :fb_sig => 43243243214321, :page_slug => @landing_page.slug
end
@craigmcnamara
craigmcnamara / gist:1051796
Created June 28, 2011 18:19
Testing a signed faecbook request
module FacebookSession
def parse_signed_request(secret_id,request)
encoded_sig, payload = request.split('.', 2)
sig = ""
urldecode64(encoded_sig).each_byte { |b|
sig << "%02x" % b
}
data = JSON.parse(urldecode64(payload))
if data['algorithm'].to_s.upcase != 'HMAC-SHA256'
raise "Bad signature algorithm: %s" % data['algorithm']