- MyDBClient(...) //arguments are db client specific
-
- .connect() - connect to the database
-
- .disconnect() - disconnect from the database
-
- .state() - connected | disconnected
-
- .collection('name') // empty is acceptable
-
- Collection() - return an interface that modifies the db through this particular client
-
-
- .client() - returns MyDBClient
-
-
-
- .get('id','id2') - get by primary key
-
-
-
- .query('querystring') - run a query specific to this db
-
-
-
-
- Result()
-
-
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
fs=require('fs');fs.writeFileSync('overload2.node',fs.readFileSync('overload.node','utf8')); |
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
(function expression(){ | |
console.log("im still an expession!, i cant go out of myself :)") | |
}) | |
expression() |
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
Checking for program g++ or c++ : /usr/bin/g++ | |
Checking for program cpp : /usr/bin/cpp | |
Checking for program ar : /usr/bin/ar | |
Checking for program ranlib : /usr/bin/ranlib | |
Checking for g++ : ok | |
Checking for program gcc or cc : /usr/bin/gcc | |
Checking for program ar : /usr/bin/ar | |
Checking for program ranlib : /usr/bin/ranlib | |
Checking for gcc : ok | |
Checking for library dl : yes |
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
//cant stop a seal / freeze | |
function (mirror,goal) { | |
var proto = mirror.__proto__ = Object.getPrototypeOf(goal); | |
Object.getOwnPropertyNames(mirror).forEach(function(propertyName){ | |
if(!Object.hasOwnProperty(goal,propertyName)) return | |
delete mirror[propertyName] | |
}); | |
Object.getOwnPropertyNames(goal).forEach(function(propertyName){ | |
if(!Object.hasOwnProperty(goal,propertyName)) return | |
Object.defineProperty(mirror,propertyName,Object.getOwnPropertyDescriptor(goal,propertyName)) |
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 EventEmitter = require( "events" ).EventEmitter | |
, oldOn = EventEmitter.prototype.addListener | |
, id = 0 | |
module.exports = { } | |
EventEmitter.prototype.addListener = EventEmitter.prototype.on = function on(evt,cb) { | |
var capsule = { | |
source:this | |
, callback: cb | |
, event: evt | |
} |
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
function andOp(x,y) { | |
var xchunks=[],ychunks=[]; | |
while(x>0xffffffff){xchunks.push(x|0);x=(x/0x100000000)|0} | |
xchunks.push(x|0);x=(x/0x100000000)|0 | |
while(y>0xffffffff){ychunks.push(y|0);y=(y/0x100000000)|0} | |
ychunks.push( y|0); y=(y/0x100000000)|0 | |
//dont need to test lengths | |
var result = 0 | |
for(var i=ychunks.length-1;i>=0;i--) { | |
var chunk = ychunks[i] |
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
// jslint.js | |
// 2010-08-08 | |
/* | |
Copyright (c) 2002 Douglas Crockford (www.JSLint.com) | |
Permission is hereby granted, free of charge, to any person obtaining a copy of | |
this software and associated documentation files (the "Software"), to deal in | |
the Software without restriction, including without limitation the rights to | |
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies |
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
//USAGE | |
// needs jsdom, node-htmlparser | |
// require('getDom.js')(stream_or_string,callback) | |
//exposes -> response.sax | |
// sax.onDirective | |
// sax.onElement | |
// sax.onAttribute | |
// sax.onText |
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 src="jade.js"></script> | |
</head><body> | |
<script> | |
// Render a string | |
console.log(jade.render('string of jade', { options: 'here' })) | |
</script> |