Skip to content

Instantly share code, notes, and snippets.

Zeno R.R. Davatz zdavatz

Block or report user

Report or block zdavatz

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@zdavatz
zdavatz / gist:818654
Created Feb 9, 2011
de.oddb.win.conf in C:\Apache2.2\conf\vhosts
View gist:818654
NameVirtualHost *:80
<Directory C:\Users\zdavatz\de.oddb.org\doc>
Options ExecCGI
<Files "*">
SetHandler ruby-object
</Files>
AllowOverride None
Order allow,deny
Allow from all
@zdavatz
zdavatz / mod_ruby Linux config Apache
Created Feb 9, 2011
mod_ruby Linux config Apache
View mod_ruby Linux config Apache
<VirtualHost *:80>
DocumentRoot /var/www/de.oddb.org/doc
ServerName de.oddb.org
DirectoryIndex index.rbx
RubyAddPath /var/www/de.oddb.org/lib
RubyRequire 'sbsm/trans_handler'
SetHandler ruby-object
RubyTransHandler SBSM::ZoneTransHandler.instance
SetEnv DEFAULT_FLAVOR oddb
SetEnv DRB_SERVER druby://localhost:11000
@zdavatz
zdavatz / gist:820138
Created Feb 10, 2011
mod_ruby.so vhosts.conf Windows Apache 2.2.17
View gist:820138
NameVirtualHost *:80
<VirtualHost *:80>
ServerName de.oddb.win
DocumentRoot C:\Ruby-1.8.6-oniguruma\lib\ruby\gems\1.8\gems\de.oddb-2.0.0\doc
DirectoryIndex index.rbx
RubyAddPath 'C:/Ruby-1.8.6-oniguruma/lib/ruby/gems/1.8/gems/de.oddb-2.0.0/lib'
RubyRequire 'sbsm/trans_handler'
RubyTransHandler SBSM::ZoneTransHandler.instance
@zdavatz
zdavatz / gist:820139
Created Feb 10, 2011
mod_ruby vhosts.conf Linux
View gist:820139
<Directory /var/www/de.oddb.org/doc>
Options ExecCGI
AllowOverride None
Order allow,deny
Allow from all
</Directory>
<Directory /var/www/de.oddb.org/var/images>
AllowOverride None
Order allow,deny
Allow from all
@zdavatz
zdavatz / mod_ruby.conf Windows 2.2.17 in C:\Aapche2.2\conf\extra\mod_ruby.conf
Created Feb 10, 2011
mod_ruby.conf Windows 2.2.17 in C:\Aapche2.2\conf\extra\mod_ruby.conf
View mod_ruby.conf Windows 2.2.17 in C:\Aapche2.2\conf\extra\mod_ruby.conf
LoadModule ruby_module modules/mod_ruby.so
<IfModule mod_ruby.c>
RubyRequire apache/ruby-run
<Location /ruby>
SetHandler ruby-object
RubyHandler Apache::RubyRun.instance
Options ExecCGI
</Location>
View oddb.org Rakefile
# -*- ruby -*-
require 'rubygems'
require 'hoe'
## To run 'rake git:manifest' you will need the 'hoe-git' gem.
Hoe.plugin :git
Hoe.plugins.delete :clean
View ruby-1.9-tips.rb
def tip(msg); puts; puts msg; puts "-"*100; end
#
# 30 Ruby 1.9 Tips, Tricks & Features:
# http://www.igvita.com/2011/02/03/new-ruby-19-features-tips-tricks/
#
tip "Upgrading to Ruby 1.9 is simple: rvm install 1.9.2 && rvm --default 1.9.2"
tip "Ruby 1.9 supports named captures in regular expressions!"
View odba - cache.rb
# Returns all objects designated by _bulk_fetch_ids_ and registers
# _odba_caller_ for each of them. Objects which are not yet loaded are loaded
# from ODBA#storage.
def bulk_fetch(bulk_fetch_ids, odba_caller)
instances = []
loaded_ids = []
bulk_fetch_ids.each { |id|
if(entry = fetch_cache_entry(id))
entry.odba_add_reference(odba_caller)
@zdavatz
zdavatz / cache_entry.rb
Created Mar 14, 2011
cache_entry.rb - ODBA
View cache_entry.rb
def odba_cut_connections!
@accessed_by.each { |object_id, odba_id|
if((item = odba_id2ref(odba_id) || object_id2ref(object_id, odba_id)) \
&& item.respond_to?(:odba_cut_connection))
item.odba_cut_connection(_odba_object)
end
}
end
View ODBA - cache_entry.rb
def odba_retire opts={}
# replace with stubs in accessed_by
instance = _odba_object
if opts[:force]
@accessed_by.each do |object_id, odba_id|
if item = odba_id2ref(odba_id)
item.odba_stubize instance, opts
elsif(item = object_id2ref(object_id, odba_id))
if item.is_a?(Persistable) && !item.is_a?(Stub)
item.odba_stubize instance, opts
You can’t perform that action at this time.