This file contains 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
function railsapp { | |
template=$1 | |
appname=$2 | |
shift 2 | |
rails $appname -T -d postgresql -f -m ~/dev/voomify/templates/$template.rb $@ | |
} |
This file contains 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
rails_root/ | |
accounts/apps/ | |
controllers/ | |
models/ | |
views/ | |
helpers/ | |
specs/ | |
lib/ | |
users/apps/ | |
controllers/ |
This file contains 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
How to enable Java in Ubuntu | |
Hi, | |
here is a short recipe how to enable Java applets and the Java console in Ubuntu (and others with the same installation tool set), compiled from a previous contribution and another hint somewhere: | |
sudo -i | |
apt-get update | |
apt-get install sun-java6-jre sun-java6-jdk sun-java6-plugin sun-java6-fonts |
This file contains 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
http://ayende.com/Blog/archive/2008/08/13/Mutli-Tenancy--multi-tenant-apps-and-frameworks.aspx |
This file contains 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
http://aac2009.confreaks.com/videos/06-feb-2009-14-30-writing-multi-tenant-applications-in-rails-guy-naor-small.mp4 | |
Skip ahead to 22:55 | |
Here is my retype of the application control logic to switch schemas using search paths in postgresql. | |
class ApplicationController < ActionController::Base | |
before_filter :set_account | |
after_filter :clear_account |
This file contains 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
# 1) Point *.example.com in your DNS setup to your server. | |
# | |
# 2) Setup an Apache vhost to catch the star pointer: | |
# | |
# <VirtualHost *:80> | |
# ServerName *.example.com | |
# </VirtualHost> | |
# | |
# 3) Set the current account from the subdomain | |
class ApplicationController < ActionController::Base |
This file contains 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
http://rubytester.com/blog/2009/08/12/using-local-watir-with-local-gem.html |
This file contains 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
Great articles on setting up postgres: | |
http://articles.slicehost.com/postgresql |
This file contains 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
$ gem install hobo | |
ERROR: Error installing hobo: | |
hobo requires mislav-will_paginate (>= 2.2.1, runtime) | |
Fixed with: | |
$ gem install mislav-will_paginate -s http://gems.github.com |
This file contains 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
def post_xml( xml, path) | |
url = URI.parse("http://[login]:[password]@[domain]/#{path}") | |
req = Net::HTTP::Post.new(url.path) | |
userinfo = url.userinfo.split(':') | |
req.basic_auth(userinfo[0], userinfo[1]) | |
req['Content-Type'] = "text/xml" | |
req.body = xml | |
@response = Net::HTTP.start(url.host, url.port) do |http| | |
http.request(req) | |
end |