Skip to content

Instantly share code, notes, and snippets.

View doxavore's full-sized avatar

Doug Mayer doxavore

View GitHub Profile
@doxavore
doxavore / gist:1857419
Created February 18, 2012 04:33
Output after deploying app to local Torquebox
22:27:19,433 ERROR [org.torquebox.core.runtime] (Thread-114) Failed to initialize runtime: : org.jruby.exceptions.RaiseException: (LoadError) load error: org/torquebox/web/rails/boot -- java.lang.NullPointerException: null
at org.jruby.RubyKernel.require(org/jruby/RubyKernel.java:1047) [jruby.jar:]
at #<Class:0x2e13f822>.(root)(/Users/doug/projects/myapp/<torquebox-bootstrap>-boot.rb:3)Caused by: java.lang.NullPointerException
at org.yecht.ruby.RubyLoadHandler.handle(RubyLoadHandler.java:38) [jruby.jar:]
at org.yecht.Parser.addNode(Parser.java:300) [jruby.jar:]
at org.yecht.DefaultYAMLParser.yyparse(DefaultYAMLParser.java:676) [jruby.jar:]
at org.yecht.Parser.yechtparse(Parser.java:290) [jruby.jar:]
at org.yecht.Parser.parse(Parser.java:284) [jruby.jar:]
at org.yecht.ruby.YParser.load(YParser.java:152) [jruby.jar:]
at org.yecht.ruby.YParser$s$0$1$load.call(YParser$s$0$1$load.gen:65535)
web:
static: public
context: /
ruby:
version: 1.9
@doxavore
doxavore / Vagrantfile
Created April 15, 2012 20:16
Vagrant configuration
##################################
### Custom additions from Krux
##################################
### Extensive documentation here:
### http://vagrantup.com/docs/vagrantfile.html
require 'etc'
owner = ENV['KRUX_MY_USERNAME'] || Etc.getlogin
hosts = {
@doxavore
doxavore / presenter.rb
Created April 19, 2012 16:00 — forked from ahoward/presenter.rb
worlds simplest presenter pattern. drop in replacement for ActiveRecord/Mongoid models in your controller
# the worlds lightest weight presenter pattern. to use simply
#
# file app/presenters/post_presenter.rb
#
# PostPresenter =
# Presenter.for(Post) do
# validates_presence_of :custom_field_for_this_form
#
# end
#
@doxavore
doxavore / gist:2661631
Created May 11, 2012 18:44 — forked from hipertracker/gist:214210
NGinx -> TorqueBox
/etc/hosts:
127.0.0.1 myhost jboss_server
NGINX:
server {
listen myhost:80;
server_name myhost;
location / {
proxy_set_header X-Real-IP $remote_addr;
@doxavore
doxavore / benchmark.rb
Created May 14, 2012 22:04 — forked from panthomakos/benchmark.rb
Benchmark Your Bundle
#!/usr/bin/env ruby
require 'benchmark'
REGEXPS = [
/^no such file to load -- (.+)$/i,
/^Missing \w+ (?:file\s*)?([^\s]+.rb)$/i,
/^Missing API definition file in (.+)$/i,
/^cannot load such file -- (.+)$/i,
]
± % torquebox run -J "\-Xmx2048m \-Xms1024m \-Xmn512m \-XX:+TieredComplication"
/bin/sh bin/standalone.sh -Djruby.home=/Users/doug/.rbenv/versions/jruby-1.6.7.2
=========================================================================
JBoss Bootstrap Environment
JBOSS_HOME: /Users/doug/.rbenv/versions/jruby-1.6.7.2/lib/ruby/gems/1.8/gems/torquebox-server-2.1.0-java/jboss
JAVA: java
@doxavore
doxavore / gist:3758520
Created September 20, 2012 21:40
RubyMotion 1.23 and iOS 6 (latest XCode)
% rake spec --trace
================================================================================
A new version of RubyMotion is available. Run `sudo motion update' to upgrade.
================================================================================
** Invoke spec (first_time)
** Execute spec
** Invoke simulator (first_time)
** Invoke build:simulator (first_time)
** Execute build:simulator
#! /usr/bin/env python
import fileinput
import argparse
from operator import itemgetter
parser = argparse.ArgumentParser()
parser.add_argument('--target-mb', action = 'store', dest = 'target_mb', default = 61000, type = int)
parser.add_argument('vmtouch_output_file', action = 'store', nargs = '+')
args = parser.parse_args()
TorqueBox.configure do
web do
context "/"
static "public"
end
ruby do
version "1.9"
end