Skip to content

Instantly share code, notes, and snippets.

/**
* A combined status is the worser of the provided statuses. The statuses
* can be provided either as a set of arguments or a single array
*/
combine: function() {
var combined = Status.VALID;
for (var i = 0; i < arguments; i++) {
var status = arguments[i];
if (Array.isArray(status) {
status = Status.combine(status);
/opt/local/bin/python2.7 /Users/joe/Projects/mozilla/firefox/mozilla-central/config/pythonpath.py -I../../config /Users/joe/Projects/mozilla/firefox/mozilla-central/config/expandlibs_exec.py --uselist -- g++-4.2 -fno-rtti -fno-exceptions -Wall -Wpointer-arith -Woverloaded-virtual -Wsynth -Wno-ctor-dtor-privacy -Wno-non-virtual-dtor -Wcast-align -Wno-invalid-offsetof -Wno-variadic-macros -Werror=return-type -fno-strict-aliasing -fpascal-strings -fno-common -fshort-wchar -pthread -DNO_X11 -pipe -DNDEBUG -DTRIMMED -g -O3 -fomit-frame-pointer -fPIC -o XUL nsStaticXULComponents.o nsUnicharUtils.o nsBidiUtils.o nsRDFResource.o -framework Cocoa -lobjc -framework ExceptionHandling -Wl,-executable_path,/Users/joe/Projects/mozilla/firefox/mozilla-central/obj-ff-mac-dbg/dist/bin -Wl,-dead_strip ../../toolkit/xre/libxulapp_s.a ../../staticlib/components/libnecko.a ../../staticlib/components/libuconv.a ../../staticlib/components/libi18n.a ../../staticlib/components/libchardet.a ../../staticlib/components/libjar
@joewalker
joewalker / gist:1358026
Created November 11, 2011 13:41
XUL document bizarreness
// document is browser.xul
var p = document.createElementNS('p', XHTML);
p.foo = { hello:'world' };
console.log(p.foo.hello); // world
document.body.appendChild(p);
@joewalker
joewalker / build.sh
Created March 21, 2012 14:38
moz incremental build
#!/bin/sh
dirs=( \
$FIREFOX_HOME/obj/browser/themes \
$FIREFOX_HOME/obj/browser/devtools \
$FIREFOX_HOME/obj/browser/base \
$FIREFOX_HOME/obj/browser/app \
)
cd #####
/*
* Copyright 2009-2011 Mozilla Foundation and contributors
* Licensed under the New BSD license. See LICENSE.txt or:
* http://opensource.org/licenses/BSD-3-Clause
*/
/**
* Define a module along with a payload.
* @param moduleName Name for the payload
@joewalker
joewalker / gist:2300868
Created April 4, 2012 12:50
proxy default traps
var s = {
foo: 'bar'
};
for (prop in s) {
console.log(prop + '=' + s[prop]);
}
// foo=bar as expected
var proxy = Proxy.create({
@joewalker
joewalker / browser_gcli_break.js
Created April 9, 2012 12:11
browser_gcli_break.js
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */
// Tests that the break command works as it should
const TEST_URI = "http://example.com/browser/browser/devtools/shared/test/browser_gcli_break.html";
function test() {
DeveloperToolbarTest.test(TEST_URI, function(browser, tab) {
testBreakCommands();
@joewalker
joewalker / scratchpad.js
Created June 17, 2012 12:15 — forked from paulrouget/scratchpad.js
Firefox Magnifier
/*
TODO:
- zoom level menu
- need to find a way to re-start the update
- add color tools
- integrate better in Firefox
- crosshair has a 1px offset
*/
@joewalker
joewalker / gist:2944434
Created June 17, 2012 12:35 — forked from anonymous/gist:2661058
Micro Debugger Demo
var debuggr = new Debugger(gBrowser.selectedBrowser.contentWindow);
debuggr.onEnterFrame = function(frame) {
alert(frame.callee.name + "(" + frame.arguments.join(", ") + ")");
};
@joewalker
joewalker / bootstrap.js
Created June 17, 2012 13:56
Hello Command
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */
Components.utils.import("resource:///modules/devtools/gcli.jsm");
var helloCommandSpec = {
name: 'hello',
description: 'Show a message',
params: [
{