-
Install any of the Mongo add-ons available at http://addons.heroku.com
-
Vendor the Mongo driver with your application. You can download it here:
https://github.com/wuputah/heroku-libraries/raw/master/php/mongo/mongo.so
Add it to a folder like "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
// Named constants with unique integer values | |
var C = {}; | |
// Tokenizer States | |
var START = C.START = 0x11; | |
var TRUE1 = C.TRUE1 = 0x21; | |
var TRUE2 = C.TRUE2 = 0x22; | |
var TRUE3 = C.TRUE3 = 0x23; | |
var FALSE1 = C.FALSE1 = 0x31; | |
var FALSE2 = C.FALSE2 = 0x32; | |
var FALSE3 = C.FALSE3 = 0x33; |
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 camera, | |
scene, | |
renderer, | |
group, | |
grid, | |
wave , | |
mesh, | |
currentLayout, | |
container, | |
layoutNames, |
ror, scala, jetty, erlang, thrift, mongrel, comet server, my-sql, memchached, varnish, kestrel(mq), starling, gizzard, cassandra, hadoop, vertica, munin, nagios, awstats
SQL | Mongodb |
---|---|
INSERT INTO collection(username,email,age) VALUES('johndoe','johndoe_at_example.com',28) | db.collection.insert({username:'johndoe','johndoe_at_example.com'}) |
UPDATE collection SET username = 'jackdoe' WHERE email = 'johndoe_at_example.com'' | db.collection.update({email:'johndoe_at_example.com''},{$set{username:'jackdoe'}}) |
SELECT COUNT(*) as count FROM collection WHERE age >= 18 | db.collection.count({age:{$gte:18}}) or db.collection.aggregate([{$match:{age:{$gte:18}}},{$count:"count"}]) |
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
/** | |
* Allow the use of backbone collections instead of models | |
* @see http://experience.eu01.aws.af.cm/3/#backbone for the adaptor in action | |
* @see https://github.com/Rich-Harris/Ractive for details about Ractive | |
*/ | |
;(function(exports){ | |
var Ractive = exports.Ractive; | |
if(Ractive){ | |
Ractive.adaptors.backboneCollection = function(collection,path){ | |
var settingCollection, settingView, setCollection, setView, pathMatcher, pathLength, prefix; |
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
# Make mouse useful in copy mode | |
setw -g mode-mouse on | |
# Allow mouse to select which pane to use | |
set -g mouse-select-pane on | |
# Allow mouse dragging to resize panes | |
set -g mouse-resize-pane on | |
# Allow mouse to select windows |
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
-- PostgreSQL 9.2 beta (for the new JSON datatype) | |
-- You can actually use an earlier version and a TEXT type too | |
-- PL/V8 http://code.google.com/p/plv8js/wiki/PLV8 | |
-- Inspired by | |
-- http://people.planetpostgresql.org/andrew/index.php?/archives/249-Using-PLV8-to-index-JSON.html | |
-- http://ssql-pgaustin.herokuapp.com/#1 | |
-- JSON Types need to be mapped into corresponding PG types | |
-- |
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
Latency Comparison Numbers | |
-------------------------- | |
L1 cache reference 0.5 ns | |
Branch mispredict 5 ns | |
L2 cache reference 7 ns 14x L1 cache | |
Mutex lock/unlock 25 ns | |
Main memory reference 100 ns 20x L2 cache, 200x L1 cache | |
Compress 1K bytes with Zippy 3,000 ns 3 us | |
Send 1K bytes over 1 Gbps network 10,000 ns 10 us | |
Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD |
Visit my blog or connect with me on Twitter
git init
or
NewerOlder