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
name := "mongo-test" | |
version := "1.0" | |
scalaVersion := "2.9.2" | |
libraryDependencies += "org.mongodb" %% "casbah" % "2.5.0" | |
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
START TRANSACTION; | |
/* Create a purchase order row */ | |
INSERT INTO purchase_orders (id,title,total) VALUES (1, ‘purchase order 1’, 10.50); | |
/* Create a line item, including the foreign key of the purchase order we just created */ | |
INSERT INTO line_items(id,sku,quantity,price,purchase_order_id) VALUES (2, ‘a’, 1, 10.50 1); | |
COMMIT; |
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 "http://rubygems.org" | |
gem "rails", "3.0.5" | |
gem "mongo_mapper" | |
gem "bson_ext" |
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
var Db = require('/usr/local/lib/node/mongodb').Db, | |
Server = require('/usr/local/lib/node/mongodb').Server; | |
var client = new Db('nodejs_test', new Server("127.0.0.1", 27017, {})); | |
client.open(function(err,p_client) { | |
client.createCollection('test_insert', function( err, collection ){ | |
client.collection('test_insert', function(err,collection) { | |
collection.save({_id:ObjectId('4d4c45209a54301520000001'),d:3}, function(err,docs) {console.log(err)}); | |
}) |
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
<html> | |
<head> | |
<script type="text/javascript"> | |
//<![CDATA[ | |
var _gaq = _gaq || []; | |
(function() { | |
var headTime = new Date().getTime(); | |
var reportTimeSegment = function(index, name, start, end, scope) { | |
if( (start && end) && (end-start > 0) ) { | |
var distance = Math.round( (end-start)/100 )*100; |