Skip to content

Instantly share code, notes, and snippets.

{
"title": "Blog Entry",
"name" : "blog.entry",
"id" : "ASDF123-ADSF-123-1AAA",
"desc" : "Blog entry is a title and body",
"isa" : [
"blerby://core/entity/type"
],
"components" : [
{
(function (exports) {
// because the anonymous function is being called without a scope being set,
// "this" will refer to the global scope. In a browser, that's the window, but
// will be "undefined" in strict mode. In other JS platforms, it may be some
// other thing.
// my code here.
// don't make accidental globals.
// hang a small number of things on the "exports" object.
// base.js
var base = function() {
};
base.prototype = {
};
exports.base = base;
// test.js
var base = require("./base").base,
sys = require("sys");
@tmpvar
tmpvar / jquery.filterlist.js
Created February 9, 2010 19:07
filterlist jquery plugin
/**
* jQuery-Plugin "filterlist"
*
* @version: 1.0, 09.11.2009
*
* @author: Eli Insua
* elijahi@arc90.com
*
*
* @example: $('#selector').filterlist({
Starting program: /usr/local/bin/node --debug workspace/v8DebuggerTest/test.js
[Thread debugging using libthread_db enabled]
[New Thread 0x7fffd2e61910 (LWP 4407)]
debugger listening on port 5858
Use 'd8 --remote_debugger' to access it.
[New Thread 0x7ffff7ff7910 (LWP 4408)]
Server running at http://127.0.0.1:8000/
[New Thread 0x7fffd2660910 (LWP 4412)]
Program received signal SIGSEGV, Segmentation fault.
tmpvar@tmpvar:~$ gdb --args node_g --debug workspace/v8DebuggerTest/test.js
GNU gdb (GDB) 7.0-ubuntu
Copyright (C) 2009 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
// sax-test.js
var sys = require("sys"), sax = require("./sax");
parser = sax.parser(false);
sax.EVENTS.forEach(function (ev) {
parser["on" + ev] = function() { sys.puts(sys.inspect(arguments)); };
});
parser.write("<span>Welcome,</span> to monkey land");
// output
@tmpvar
tmpvar / jsdom-pure-sizzle.js
Created February 16, 2010 03:58
A HUUUUUGE MILESTONE
// ... other setup
doc.innerHTML = '<html><head></head><body><div class="who"></div></body></html>';
var window = {
alert : function() { sys.puts(sys.inspect(arguments)); },
document : doc
};
window.Sizzle = require("../sizzle/sizzle").sizzleInit(window, doc);
var $ = require("./pure").pureInit(window, doc);
$("div").autoRender({"who":"Hello Wrrrld"});
@tmpvar
tmpvar / performer.json
Created February 21, 2010 19:51
simple performer example (Simple Creation)
{
"name" : "Simple Creation",
"id" : "simple.creation",
"description" : "This is a simple example for submitting a new entry, validating the submission, and storing the result",
"actions" : {
"New Entry" : {
"success" : "Validation"
},
"Validation" : {
"failure" : {
@tmpvar
tmpvar / promise.js
Created February 21, 2010 21:42 — forked from ry/promise.js
promises!
var events = require('events');
exports.Promise = function () {
exports.EventEmitter.call(this);
this._blocking = false;
this.hasFired = false;
this._values = undefined;
};
process.inherits(exports.Promise, events.EventEmitter);