Skip to content

Instantly share code, notes, and snippets.

View cadorn's full-sized avatar

C Dorn cadorn

View GitHub Profile
const Cc = Components.classes;
const Ci = Components.interfaces;
const CC = Components.Constructor;
const BinaryInputStream = CC("@mozilla.org/binaryinputstream;1", "nsIBinaryInputStream", "setInputStream");
const BinaryOutputStream = CC("@mozilla.org/binaryoutputstream;1", "nsIBinaryOutputStream", "setOutputStream");
const ScriptableInputStream = CC("@mozilla.org/scriptableinputstream;1", "nsIScriptableInputStream", "init");
const Pipe = CC("@mozilla.org/pipe;1", "nsIPipe", "init");
const ConverterInputStream = CC("@mozilla.org/intl/converter-input-stream;1", "nsIConverterInputStream", "init");
const StringStream = CC("@mozilla.org/io/string-input-stream;1", "nsIStringInputStream", "setData");
const RCHAR = Ci.nsIConverterInputStream.DEFAULT_REPLACEMENT_CHARACTER
(function (modules) {
if (modules.fs) {
// XXX: migration step for deprecated engines
var system = modules;
var file = system.fs;
var modules = {system: system, file: file};
system.print(
"WARNING: this version of the " + system.engine + " engine \n" +
" is deprecated because it injects the system module \n" +
{
"dependencies": [
[
"nr-devtools",
{
"catalog": "http://github.com/cadorn/narwhalrunner/raw/master/catalog.json",
"name": "devtools",
"revision": "latest"
}
],
make[2]: Nothing to be done for `libs'.
/pinf/library/APE_Server/libs/js1.8/src/config/nsinstall -D dist/sdk/lib
/pinf/library/APE_Server/libs/js1.8/src/config/nsinstall -L /pinf/library/APE_Server/libs/js1.8/src -m 755 libmozjs.dylib dist/sdk/lib
gcc-4.2 -c -x c -E -P -I. imacro_asm.js.in > imacro_asm.js
./dist/bin/js imacro_asm.js ./imacros.jsasm > imacros.c.tmp
imacros.c.out is up to date
make tools
make[2]: Nothing to be done for `tools'.
make[2]: Nothing to be done for `tools'.
make[2]: Nothing to be done for `tools'.
We couldn’t find that file to show.

From System Module

require('<module>')  // search require.paths
require('./<module>')  // resolve relative then search require.paths
require('<module>', '<package>') // module from package

or

require('system#') // search require.paths

@cadorn
cadorn / transport.js
Created November 13, 2010 00:56
requirejs package mappings
define("87A2FC545DE0A1C3918CCC52B8AB3AC9!/package3", ["require", "module", "exports"], function(require, module, exports) {
var PACKAGE2 = require("package2/package2");
exports.announceNext = function (console) {console.log("Chrome Package 3");PACKAGE2.announcePrevious(console);};
});
define("F30B57B6CF848463FC10711298FFB063!/package2", ["require", "module", "exports"], function(require, module, exports) {
var PACKAGE1 = require("packageA/package1");
var PACKAGE3 = require("packageB/package3");
exports.announceNext = function (console) {console.log("Chrome Package 2");PACKAGE3.announceNext(console);};
exports.announcePrevious = function (console) {console.log("Chrome Package 2");PACKAGE1.announcePrevious(console);};
<?php
// TODO: Configure FirePHP
//define('FIREPHP_ACTIVATED', true); // Ensure FirePHP is always collecting data
//require_once('FirePHP/Init.php');
// listen to all data that would be sent to client (if authorized)
class PayloadListener {
public function onPayload($request, $payload) {
@cadorn
cadorn / main.js
Created February 11, 2011 21:32
HelloWorld CommonJS Program
module.declare([], function(require, exports, module)
{
exports.main = function()
{
module.print("Hello World from Gist!\n");
}
});
@cadorn
cadorn / main.js
Created February 12, 2011 00:07
Test with NodeUnit CommonJS Program
module.declare(["nodejs/path", "nodeunit/nodeunit"], function(require, exports, module)
{
var PATH = require("nodejs/path");
exports.main = function()
{
module.print("Hello World from NodeUnit Gist Test!\n");
var reporter = require("nodeunit/nodeunit").reporters["default"];