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
=begin | |
datamapper threaded repository sample with multiple mysql databases | |
modelling mysql => User table can be used administering mysql | |
=end | |
require 'dm-core' | |
Servers = { | |
:mysql1 => 'mysql1.foo.com', | |
:mysql2 => 'mysql2.foo.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
diff --git a/configure b/configure | |
index 2f48a9a..1314b70 100755 | |
--- a/configure | |
+++ b/configure | |
@@ -30,7 +30,12 @@ class Configure | |
@llvm_default = File.join(root, "vm", "external_libs", "llvm") | |
if @os =~ /linux/ | |
- @llvm_system_name = `lsb_release -irs`.split.join("-").downcase | |
+ begin |
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
(require 'ido) | |
(ido-mode t) | |
(add-to-list 'load-path "~/.emacs.d/plugins/textmate") | |
(require 'textmate) | |
(textmate-mode) | |
;; Rinari | |
(add-to-list 'load-path "~/.emacs.d/plugins/rinari") | |
(require 'rinari) |
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
[slmn@azrael cbtohtml]$ time ./cbtohtml.rb &>/dev/null | |
real 0m0.726s | |
user 0m0.313s | |
sys 0m0.043s |
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
require 'yaml' | |
s = "a string" | |
a = %w(a array) | |
puts "Before setting instance variable:\n#{s.to_yaml}\n#{a.to_yaml}\n" | |
s.instance_variable_set(:@test, 'test') | |
a.instance_variable_set(:@test, 'test') |
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
source :rubygems | |
# Project requirements | |
gem 'rake' | |
gem 'rack-flash' | |
gem 'thin' # or mongrel | |
# Component requirements | |
gem 'haml' | |
gem 'dm-sqlite-adapter' |
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
RAKEFILE = <<-RAKEFILE | |
require File.dirname(__FILE__) + '/config/boot.rb' | |
require 'thor' | |
require 'padrino-core/cli/rake' | |
PadrinoTasks.init | |
RAKEFILE | |
PV = Padrino.version | |
GEMFILE = <<-GEMFILE |
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
class List | |
attr_reader :list | |
def initialize *args | |
args.each do |a| | |
if a.kind_of? Range | |
@list = parse(args, args.index(a)) | |
end | |
end | |
end |
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
require 'yaml' | |
class Plugin | |
class << self; attr :plugins; end | |
@plugins = [] | |
def initialize opts = nil | |
if opts | |
opts.each do |k,v| | |
instance_variable_set('@' + k, v) |
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
require 'data_mapper' | |
DataMapper::Logger.new(STDOUT, :debug) | |
DataMapper.setup(:default, "sqlite:memory:") | |
class Person | |
class Link | |
include DataMapper::Resource |
OlderNewer