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(d){ | |
console.log("Wrapping dojo.connect/subscribe"); | |
var dc = d.connect, | |
ddc = d.disconnect, | |
ds = d.subscribe, | |
dus = d.unsubscribe, | |
uniqueHandleId = 0, | |
handleIds = {}; | |
var handleData = { connect: 0, disconnect: 0, subscribe: 0, unsubscribe: 0 }; | |
d.connect = function() { |
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
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" | |
"http://www.w3.org/TR/html4/strict.dtd"> | |
<html> | |
<head> | |
<title>Lazy Widgets</title> | |
<link id="themeStyles" rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/dojo/1.5/dijit/themes/claro/claro.css"> | |
<!-- required: dojo.js --> | |
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/dojo/1.5/dojo/dojo.xd.js" |
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(d){ | |
console.log("Wrapping dojo.connect/subscribe"); | |
var dc = d.connect, | |
ddc = d.disconnect, | |
ds = d.subscribe, | |
dus = d.unsubscribe, | |
uniqueHandleId = 0, | |
handleIds = {}; | |
var handleData = { connect: 0, disconnect: 0, subscribe: 0, unsubscribe: 0 }; |
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
dojo.provide("myns.data.FeedStore"); | |
dojo.require("dojox.data.ServiceStore"); | |
dojo.require("dojox.rpc.Service"); | |
dojo.declare("myns.data.FeedStore", dojox.data.ServiceStore, { | |
// summary: | |
// Flexible, extensible store for normalizing read-only JSON feed data | |
service: null, |
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
getValue: function(/*Object*/ item, /*String*/property, /*value?*/defaultValue){ | |
// summary: | |
// Gets the value of an item's 'property' | |
// | |
// item: | |
// The item to get the value from | |
// property: | |
// property to look up value for | |
// defaultValue: | |
// the default value |
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 mockMethod = function(obj, methName, fn) { | |
var orig = obj[methName]; | |
var handle = [obj, methName, orig]; | |
obj[methName] = fn; | |
return handle; | |
}, unMockMethod = function(handle) { | |
handle[0][handle[1]] = handle[2]; | |
}; | |
// usage: |
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
#!/usr/bin/perl | |
# quick, throwaway script to extract out info messages from the HTML dump of the | |
# firebug console which is produced by the ConsoleExport Firefox/Firebug | |
# plugin. | |
# I was interested in info message of the form.. so its pretty specific | |
# console.info("some label:87ms", 113, 200); | |
# TODO provide a way to extract log/warn/info/error/all entry types |
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(){ | |
var sys = require('sys'); | |
var filestem = process.ARGV.length > 2 ? process.ARGV.length[2] : "screen"; | |
var spawn = require('child_process').spawn, | |
timer = null, | |
startTime, stopTime; | |
function outfile(d) { |
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
/** | |
* Module dependencies. | |
*/ | |
var fs = require('fs'), | |
path = require('path'); | |
spawn = require('child_process').spawn, | |
exec = require('child_process').exec; | |
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
// hooking up xml2json to convert XML piped in via stdin to JSON on stdout | |
// e.g.: | |
// curl http://www.gutenberg.org/feeds/today.rss | node index.js > gutenberg.json | |
var x2j = require("xml2json"); | |
process.stdin.resume(); | |
process.stdin.setEncoding('utf8'); | |
var xml = ''; |
OlderNewer