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
painless removal of all the gems `gem list | cut -d" " -f1 | xargs gem uninstall -aIx` | |
rvm install 1.9.2 on OS X 10.6 `rvm install 1.9.2 -C --with-readline-dir=/opt/local,--build=x86_64-apple-darwin10` |
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
Create Documents and view | |
========================= | |
curl -X PUT http://localhost:5984/testdb -d {} | |
curl -X PUT http://localhost:5984/testdb/Claire -d '{"title": "VP of Official Attitude"}' | |
curl -X PUT http://localhost:5984/testdb/Mikeal -d '{"title": "VP of Pastries and Automating Stuff"}' | |
curl -X PUT http://localhost:5984/testdb/Jason -d '{"title": "VP of Hosting and Lightning"}' | |
curl -X PUT http://localhost:5984/testdb/team -d '{"members": ["Claire", "Mikeal", "Jason"]}' | |
curl -X PUT http://localhost:5984/testdb/_design/myview -d '{"language":"javascript","views":{"test":{"map":"function(doc) {if(doc.members) {doc.members.forEach(function(member) {emit(member, {_id: member});});}}"}}}' | |
Test the view |
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
{"error":"timeout","reason":"{[{shard,<<\"shards/80000000-9fffffff/testdb.1295344320\">>,\n 'bigcouch@bigcouch3-ip',<<\"testdb\">>,\n [2147483648,2684354559],\n #Ref<0.0.2.126921>},\n {shard,<<\"shards/80000000-9fffffff/testdb.1295344320\">>,\n 'bigcouch@bigcouch2-ip',<<\"testdb\">>,\n [2147483648,2684354559],\n #Ref<0.0.2.126922>}],\n 2,\n [{{<<\"Claire\">>,\n {1,[<<121,63,75,187,191,227,242,249,21,77,110,83,242,96,192,38>>]}},\n {{ok,{doc,<<\"Claire\">>,\n {1,\n [<<121,63,75,187,191,227,242,249,21,77,110,83,242,96,192,38>>]},\n {[{<<\"title\">>,<<\"VP of Official Attitude\">>}]},\n [],false,[]}},\n 1}}]}"} |
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
-- Example from http://blog.couchone.com/post/446015664/whats-new-in-apache-couchdb-0-11-part-two-views | |
>> curl -X GET http://localhost:5984/testdb/Claire | |
>> | |
{"error":"timeout","reason":"{[{shard,<<\"shards/80000000-9fffffff/testdb.1295344320\">>,\n 'bigcouch@bigcouch3-ip',<<\"testdb\">>,\n [2147483648,2684354559],\n #Ref<0.0.2.126921>},\n {shard,<<\"shards/80000000-9fffffff/testdb.1295344320\">>,\n 'bigcouch@bigcouch2-ip',<<\"testdb\">>,\n [2147483648,2684354559],\n #Ref<0.0.2.126922>}],\n 2,\n [{{<<\"Claire\">>,\n {1,[<<121,63,75,187,191,227,242,249,21,77,110,83,242,96,192,38>>]}},\n {{ok,{doc,<<\"Claire\">>,\n {1,\n [<<121,63,75,187,191,227,242,249,21,77,110,83,242,96,192,38>>]},\n {[{<<\"title\">>,<<\"VP of Official Attitude\">>}]},\n [],false,[]}},\n 1}}]}"} |
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
#32 bit - centos 5, bigcouch 0.3 | |
================================ | |
# add new source | |
su -c 'rpm -Uvh http://download.fedora.redhat.com/pub/epel/5/i386/epel-release-5-4.noarch.rpm' | |
#add dependencies | |
yum install js-devel libicu libicu-devel | |
sed -i 's/gpgcheck=1/gpgcheck=0/' /etc/yum.conf | |
sudo yum install gcc glibc-devel make ncurses-devel openssl-devel |
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
module MyApp | |
class Money | |
include Mongoid::Fields::Serializable | |
def cast_on_read?; true; end | |
def deserialize(object) | |
return nil if object.blank? | |
::Money.new(object[:cents] || object["cents"], object[:currency] || object["currency"]) | |
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
# Install git | |
sudo apt-get install git-core | |
# Install Node.js | |
sudo apt-get install -y libssl-dev pkg-config build-essential curl gcc g++ checkinstall | |
sudo apt-get install python-software-properties | |
sudo add-apt-repository ppa:chris-lea/node.js | |
sudo apt-get update | |
sudo apt-get install nodejs |