Skip to content

Instantly share code, notes, and snippets.

View josephmisiti's full-sized avatar

Joseph Misiti josephmisiti

View GitHub Profile
PRIMARY> use test
PRIMARY> db.testdoc.save( { "test" : "test" } )
SECONDARY> rs.slaveOK()
SECONDARY> use test
SECONDARY> db.tetsdoc.find().count()
@josephmisiti
josephmisiti / gist:3137813
Created July 18, 2012 18:09
OpenCV 2.4 Install on osx 10.6
$ tar xvf OpenCV-2.4.0.tar
$ cd OpenCV-2.4.0
$ cmake -G "Unix Makefiles"
$ make
$ sudo make install
// create pub-sub functionality
Backbone.pubSub = _.extend({}, Backbone.Events);
// view one needs to trigger an event in view2
View1 = Backbone.View.extend({
triggerView2Event : function() {
Backbone.pubSub.trigger('view2event', { 'some' : 'data' } );
})
> db.stats(1024)
{
"db" : "sqdev",
"collections" : 25,
"objects" : 31509618,
"avgObjSize" : 704.2919142974059,
"dataSize" : 21671844,
"storageSize" : 24783691,
"numExtents" : 163,
> sudo add-apt-repository ppa:ferramroberto/java
> sudo apt-get update
> sudo apt-get -f install sun-java6-jdk
which tells me to run this:
> sudo apt-get -f install
> sudo apt-get install sun-java6-jdk
@josephmisiti
josephmisiti / gist:3278679
Created August 6, 2012 21:37
Facebook created_time Conversion
import sys, datetime
from django.core.management.base import BaseCommand, CommandError
from optparse import make_option
from django.conf import settings
from pymongo import Connection
from bson.objectid import ObjectId
class Command(BaseCommand):
help = """Converts all facebook dates to MongoDate Strings So They are Query-able"""
<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
<configuration>
<property>
<name>hadoop.tmp.dir</name>
<value>/usr/local/Cellar/hadoop/hdfs/tmp</value>
<description>A base for other temporary directories.</description>
</property>
<property>
<name>fs.default.name</name>
<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
<configuration>
<property>
<name>mapred.job.tracker</name>
<value>localhost:9010</value>
</property>
</configuration>
<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
<configuration>
<property>
<name>dfs.replication</name>
<value>1</value>
</property>
</configuration>