Skip to content

Instantly share code, notes, and snippets.

View orlandov's full-sized avatar

Orlando Vazquez orlandov

View GitHub Profile
static int eio_AfterConnect(eio_req *req) {
printf("eio_AfterConnect; rc = %d\n", req->result);
ev_unref(EV_DEFAULT_UC);
}
static int eio_Connect(eio_req *req) {
// Note: this function is executed in the thread pool! CAREFUL
int *foo = (int*)(req->data);
printf("** %p\n", foo);
/*
I Have a C++ class Sqlite3Db that inherits from EventEmitter. It has a
private variable `db` of type (sqlite3*) which is the sqlite handle.
Is it okay to pass this handle to the function executing
in eio's threadpool?
*/
struct connect_request {
sqlite3 *db;
--- a/lib/Template.js
+++ b/lib/Template.js
@@ -48,6 +48,11 @@
**/
if (!this.exports) this.exports = {};
+var uneval;
+if (typeof uneval === "undefined") {
+ uneval = JSON.stringify
+}
#!/usr/bin/env node
process.mixin(GLOBAL, require('mjsunit'));
require.paths.push("lib");
var mongodb = require( 'mongodb' );
var sys = require( 'sys' );
var mongo = new mongodb.MongoDB();
jjj = JSON.stringify
---
NPC: Bart The Drunkard
AVATAR: gui/icons/npc.png
START: main_dialog
SECTIONS:
main_dialog:
- say: "Hey there, back up... no need to gang up on a poor guy!"
- responses:
-
test