This file contains hidden or 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
ADAPTER=sqlite3 spec spec/one_to_one_spec.rb | |
Profiling enabled. | |
...F....F....F........F. | |
Top 10 slowest examples: | |
0.0558030 Person.has(1, :profile); Person.accepts_nested_attributes_for(:profile, :allow_destroy => true) should allow to delete an existing profile via Person#profile_attributes | |
0.0469530 Person.has(1, :profile); Person.accepts_nested_attributes_for(:profile) should allow to update an existing profile via Person#profile_attributes | |
0.0460890 Person.has(1, :profile); Person.accepts_nested_attributes_for(:profile, :reject_if => lambda { |attrs| true }) should not allow to delete an existing profile via Person#profile_attributes |
This file contains hidden or 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
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> | |
<dict> | |
<key>KeepAlive</key> | |
<true/> | |
<key>Label</key> | |
<string>org.postgresql.postgres</string> | |
<key>ProgramArguments</key> | |
<array> |
This file contains hidden or 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
# This file is used by Rack-based servers to start the application. | |
require ::File.expand_path('../config/environment', __FILE__) | |
run Whatever::Application |
This file contains hidden or 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
var responseMap = {}; | |
responseMap["/"] = function (req, res) { | |
// if (req.method === "GET") | |
sys.puts("getting"); | |
var body = JSON.stringify({blah: "blah"}); | |
sys.puts(sys.inspect(body)); | |
res.writeHead(200, { "Content-Type": "text/json", "Content-Length:": body.length}); | |
res.end(body); |
This file contains hidden or 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
before :each do | |
@user = User.new(:email => '[email protected]') | |
@profile = Profile.new(:name => 'Ripple') | |
@billing = Address.new(:street => '123 Somewhere Dr', :kind => 'billing') | |
@shipping = Address.new(:street => '321 Anywhere Pl', :kind => 'shipping') | |
@friend1 = User.create(:email => "[email protected]") | |
@friend2 = User.create(:email => "[email protected]") | |
end | |
it "should save a many linked association" do |
This file contains hidden or 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 Shop | |
class Warehouse | |
def self.find(id) | |
Product.find_by_id(id) | |
end | |
end | |
class Customer | |
attr_reader :user |
This file contains hidden or 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
<html> | |
<body> | |
<b>test</b> | |
</body> | |
</html> |
This file contains hidden or 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
var stream = JSONStream.stringifyObject() | |
stream.pipe(response) | |
_.pairs(myObject).map(function(current) { stream.write.apply(stream, current); }) | |
stream.end() |
This file contains hidden or 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(doc, req) { | |
if (doc.type && doc.type == 'alert') { | |
return true; | |
} | |
return false; | |
} |
This file contains hidden or 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
var base64map = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; | |
// Global Crypto object | |
var Crypto = exports.Crypto = {}; | |
// Crypto utilities | |
var util = Crypto.util = { | |
// Bit-wise rotate left | |
rotl: function (n, b) { |