brew install mongodb
Set up launchctl to auto start mongod
$ ln -sfv /usr/local/opt/mongodb/*.plist ~/Library/LaunchAgents
/usr/local/opt/mongodb/ is a symlink to /usr/local/Cellar/mongodb/x.y.z (e.g., 2.4.9)
| ANSI_X3.4-1968 ANSI_X3.4-1986 ASCII CP367 IBM367 ISO-IR-6 ISO646-US ISO_646.IRV:1991 US US-ASCII CSASCII | |
| UTF-8 | |
| ISO-10646-UCS-2 UCS-2 CSUNICODE | |
| UCS-2BE UNICODE-1-1 UNICODEBIG CSUNICODE11 | |
| UCS-2LE UNICODELITTLE | |
| ISO-10646-UCS-4 UCS-4 CSUCS4 | |
| UCS-4BE | |
| UCS-4LE | |
| UTF-16 | |
| UTF-16BE |
| update | |
| rdb$triggers | |
| set | |
| rdb$trigger_inactive = 1 | |
| where | |
| rdb$trigger_source is not null | |
| and (coalesce(rdb$system_flag,0) = 0) | |
| and rdb$trigger_source not starting with 'CHECK' |
| #301 Redirects for .htaccess | |
| #Redirect a single page: | |
| Redirect 301 /pagename.php http://www.domain.com/pagename.html | |
| #Redirect an entire site: | |
| Redirect 301 / http://www.domain.com/ | |
| #Redirect an entire site to a sub folder | |
| Redirect 301 / http://www.domain.com/subfolder/ |
| # Tell system when Xcode utilities live: | |
| sudo xcode-select -switch /Applications/Xcode.app/Contents/Developer | |
| # Set "opendiff" as the default mergetool globally: | |
| git config --global merge.tool opendiff |
| dbpath = /var/mongo/data | |
| logpath = /var/mongo/logs/mongod.log |
| var cluster = require('cluster'); | |
| if (cluster.isWorker) { | |
| console.log('Worker ' + process.pid + ' has started.'); | |
| // Send message to master process. | |
| process.send({msgFromWorker: 'This is from worker ' + process.pid + '.'}) | |
| // Receive messages from the master process. |
| // Part of https://github.com/chris-rock/node-crypto-examples | |
| // Nodejs encryption of buffers | |
| var crypto = require('crypto'), | |
| algorithm = 'aes-256-ctr', | |
| password = 'd6F3Efeq'; | |
| var fs = require('fs'); | |
| var zlib = require('zlib'); |
| var dgram = require('dgram'); | |
| var server = dgram.createSocket("udp4"); | |
| // server | |
| server.bind(function() { | |
| server.setBroadcast(true) | |
| server.setMulticastTTL(128); | |
| broadcastNew(); | |
| }); |
| // ------------------------------------------------------------------ | |
| // Friend collection, where _id is a user.Id and Friends is a list, of user.Id. | |
| // Note: friending and unfriending is a two step operation in this scheme: | |
| > db.friends.find() | |
| { "_id" : 1, "friends" : [ 2, 3, 4 ] } | |
| { "_id" : 2, "friends" : [ 1, 3, 5 ] } | |
| { "_id" : 3, "friends" : [ 1, 2, 4, 5 ] } | |
| { "_id" : 4, "friends" : [ 1, 3, 5 ] } | |
| { "_id" : 5, "friends" : [ 2, 3, 4 ] } |