Capturing my notes about setting up an Oracle 10g XE / Rails environment for development work. Tested using the following versions, others may work as well:
- Ubuntu 11.04
- Ruby 1.9.2
- Rails 3
- Oracle 10 XE
require 'sproutcore' | |
require 'sproutcore-statechart' | |
require 'sproutcore-routing' | |
App = SC.Application.create() | |
App.GlobalNavController = SC.Object.create( | |
home: -> App.statechart.gotoState 'home' | |
about: -> App.statechart.gotoState 'about' | |
) |
require 'minitest/autorun' | |
class TaxCodeBase | |
class AbstractMethod < StandardError | |
end | |
attr_accessor :user_id | |
def initialize(user_id=nil) | |
self.user_id = user_id |
class TaxCode | |
GENERATORS = { | |
:us => lambda { |id| "US-#{id}" }, | |
:br => lambda { |id| "#{id + 9}-BRA" }, | |
} | |
def self.generate(code, id) | |
gen = GENERATORS[code] || raise ArgumentError, "No generator for country #{code}" | |
gen.call(id) | |
end |
module ApiPageHelper | |
PAGINATE_OPTIONS = { | |
:default_page_size => 10 | |
} | |
PAGINATE_PARAMS = [ "page", "offset", "size" ] | |
def paginate(coll, options = {}) | |
options = PAGINATE_OPTIONS.merge(options) | |
if params[:page] | |
page = params[:page].to_i | |
size = (params[:size] || options[:default_page_size]).to_i |
# ... | |
gem 'carrierwave' | |
gem 'fog', '~> 1.0.0' # Need to specify version, as carrierwave references older (0.9.0) which doesn't allow configuration of Rackspace UK Auth URL |
/* | |
*= require_self | |
*/ | |
html, body { | |
background-color: #eee; | |
} | |
body { | |
padding-top: 40px; /* 40px to make the container go all the way to the bottom of the topbar */ | |
} |
Key was generated using: | |
tom% openssl genrsa -des3 -out example.com.key 2048 | |
Generating RSA private key, 2048 bit long modulus | |
....+++ | |
..........................................................................................................................+++ | |
e is 65537 (0x10001) | |
Enter pass phrase for example.com.key: | |
Verifying - Enter pass phrase for example.com.key: | |
%tom |
jQuery.get('/templates/foo.handlebars', function(data) { | |
var template = SC.Handlebars.compile(data); | |
SC.TEMPLATES['foo'] = template; | |
}) |
require 'msgpack' | |
module Goliath | |
module Rack | |
module Formatters | |
# A MessagePack formatter. | |
# @example | |
# use Goliath::Rack::Formatters::MSGPACK | |
class MSGPACK | |
include AsyncMiddleware |