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
ruby 1.8.7 (2010-01-10 patchlevel 249) [x86_64-linux] | |
D, [2010-05-07T19:58:57.972048 #549] DEBUG -- : MONGODB admin['$cmd'].find({:ismaster=>1}, {}).limit(-1) | |
D, [2010-05-07T19:58:58.007733 #549] DEBUG -- : MONGODB test['$cmd'].find({:getnonce=>1}, {}).limit(-1) | |
D, [2010-05-07T19:58:58.128017 #549] DEBUG -- : MONGODB test['$cmd'].find({"authenticate"=>1, "user"=>"test", "nonce"=>"8eb2e9dda49a5216", "key"=>"553c88a3752d52866524da54ffd5ba1a"}, {}).limit(-1) | |
D, [2010-05-07T19:58:58.163331 #549] DEBUG -- : MONGODB test['fs.files'].remove({}) | |
D, [2010-05-07T19:58:58.163742 #549] DEBUG -- : MONGODB test['fs.chunks'].remove({}) | |
D, [2010-05-07T19:58:58.164106 #549] DEBUG -- : MONGODB test['system.indexes'].insert([{:unique=>true, :ns=>"test.fs.chunks", :key=>{"files_id"=>1, "n"=>1}, :name=>"files_id_1_n_1"}]) | |
D, [2010-05-07T19:59:15.839098 #549] DEBUG -- : MONGODB test['fs.chunks'].insert([{"_id"=>$oid4be4630337a31c0225000002, "n"=>0, "files_id"=>$oid4be4630337a31c0225000001, "data"=><BSON::Binary:70357 |
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 'rubygems' | |
require 'mongo_mapper' | |
MongoMapper.connection = Mongo::Connection.new('localhost',27017) | |
MongoMapper.database = "test" | |
class Word | |
include MongoMapper::Document | |
key :content, String | |
many :translations do |
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 'rubygems' | |
require 'mongo_mapper' | |
MongoMapper.connection = Mongo::Connection.new('localhost',27017) | |
MongoMapper.database = "test" | |
class Word | |
include MongoMapper::Document | |
key :content, String | |
key :translation_ids, Array |
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
# MongoMapper "embedded document delete" plugin | |
# By Peter Cooper | |
# | |
# Got embedded documents you want to delete? You can delete them as if the | |
# embedded document collection were an array, but then there's no way to get | |
# a callback (as far as I could tell). This plugin gives you a call back | |
# (if you want it) and gives a nicer syntax to deleting embedded docs. | |
# | |
# Example: | |
# |
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 'rubygems' | |
require 'mongo_mapper' | |
MongoMapper.connection = Mongo::Connection.new('localhost',27017) | |
MongoMapper.database = "test" | |
class User | |
include MongoMapper::Document | |
key :name, String | |
many :ideas do |
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(File.dirname(__FILE__) + "/../../config/environment") unless defined?(Rails) | |
require 'sinatra/base' | |
require 'curl' | |
class FbConnect < Sinatra::Base | |
get '/info' do | |
"Redirect URL: #{ENV['REDIRECT_URL']} session_data:#{session.inspect}" | |
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
class AbstractModel | |
def self.set_target(model_name) | |
@@model_name = model_name | |
AbstractModel.class.delegate :find, :to => :"#{@@model_name}" | |
AbstractModel.class.delegate :all, :to => :"#{@@model_name}" | |
end | |
end | |
#AbstractModel.set_target("Product") | |
#AbstractModel.find(1) |
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 Filter | |
def initialize() | |
@constraints = [] | |
end | |
def constraint(&block) | |
@constraints << block | |
end | |
def to_proc |
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 AppSettings::Base | |
@show_info = true | |
class << self | |
attr_accessor :cells | |
attr_accessor :show_info | |
end | |
def self.setup(&block) | |
yield(self) | |
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
.container | |
%h1 Todo List | |
%ul.todos(data-bind="foreach: todos") | |
%li(data-bind="attr: {class: className}") | |
%input(type="checkbox" data-bind="checked: completed") | |
%span(data-bind="text: title") | |
%a(data-bind="visible: allowClear, click: clearList") Clear List | |
%input(type="text" placeholder="New Todo Title" data-bind="value: todoToAdd, event: {change: addTodo}") | |
OlderNewer