Skip to content

Instantly share code, notes, and snippets.

@neonux
neonux / readonly-proxy.js
Created April 26, 2012 18:22
read-only proxy
function wrap(aObject)
{
if (aObject === undefined || aObject === null) {
return aObject;
}
let type = typeof(aObject);
if (type == "string" || type == "number" || type == "boolean" || type == "function") {
return aObject;
}
@neonux
neonux / binarysearch-ls.js
Created April 11, 2012 13:46
binarySearch compatible with LiveScratchpad v0.3
/*
* This is a JavaScript Scratchpad.
*
* Enter some JavaScript, then Right Click or choose from the Execute Menu:
* 1. Run to evaluate the selected text,
* 2. Inspect to bring up an Object Inspector on the result, or,
* 3. Display to insert the result in a comment after the selection.
*/
function binarySearch(key, array)
@neonux
neonux / meta-scratchpad.js
Created March 30, 2012 15:01
Get the Scratchpad window from the Scratchpad itself
// open one (and only) Scratchpad in chrome/browser context, then:
let scratchpadWindow = Services.wm.getEnumerator("devtools:scratchpad").getNext();
@neonux
neonux / gist:1373000
Created November 17, 2011 12:02
Lua to JS gotchas
> There's a lot of fundamental differences between Lua and Javascript, even at
> the syntax level.
Syntax differences are easy to come by. The problem are semantics.
Don't get me wrong, but I got the impressions this approach is a bit
naive missing the experience from larger projects in both languages.
* JS arrays are indexed with 0. Lua with 1, resulting at least with
issues with length operators.
@neonux
neonux / gist:1293381
Created October 17, 2011 18:30
Overview
[ New ] [ Import ] | Search |
[.] default.css 28 rules.
[.] extra.css 9 rules.
__________________________________
*Style sheets* | Overview
diff --git a/gfx/thebes/nsCoreAnimationSupport.mm b/gfx/thebes/nsCoreAnimationSupport.mm
index 3f85894..ca16498 100644
--- a/gfx/thebes/nsCoreAnimationSupport.mm
+++ b/gfx/thebes/nsCoreAnimationSupport.mm
@@ -451,6 +451,7 @@ nsresult nsCARenderer::SetupRenderer(void *aCALayer, int aWidth, int aHeight) {
CARenderer* caRenderer = nsnull;
CGLPixelFormatAttribute attributes[] = {
+ kCGLPFANoRecovery,
kCGLPFAAccelerated,
@neonux
neonux / gist:1245992
Created September 27, 2011 19:33
build error fx-team tip
c++ -o nsTimerImpl.o -c -I../../dist/stl_wrappers -I../../dist/system_wrappers -include /home/cedric/tmp/stack/mozilla-all/config/gcc_hidden.h -DMOZILLA_INTERNAL_API -DOSTYPE=\"Linux3.0\" -DOSARCH=Linux -D_IMPL_NS_COM -I/home/cedric/tmp/stack/mozilla-all/xpcom/threads/../components -I/home/cedric/tmp/stack/mozilla-all/xpcom/threads -I. -I../../dist/include -I../../dist/include/nsprpub -I/home/cedric/tmp/stack/mozilla-all/obj-x86_64-unknown-linux-gnu-DEBUG-firefox/dist/include/nspr -I/home/cedric/tmp/stack/mozilla-all/obj-x86_64-unknown-linux-gnu-DEBUG-firefox/dist/include/nss -fPIC -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 -pedantic -Wno-long-long -fno-strict-aliasing -std=gnu++0x -pthread -ffunction-sections -fdata-sections -pipe -DDEBUG -D_DEBUG -DTRACING -g -fno-omit-frame-pointer -DMOZILLA_CLIENT -include ../../mozilla-config.h -MD -MF .deps/
diff --git a/browser/devtools/styleeditor/StyleEditorChrome.jsm b/browser/devtools/styleeditor/StyleEditorChrome.jsm
index f8eb4b9..dbff59d 100644
--- a/browser/devtools/styleeditor/StyleEditorChrome.jsm
+++ b/browser/devtools/styleeditor/StyleEditorChrome.jsm
@@ -402,6 +402,7 @@ StyleEditorChrome.prototype = {
data: {
editor: aEditor
},
+ disableAnimations: this._alwaysDisableAnimations,
ordinal: aEditor.styleSheetIndex,
@neonux
neonux / gist:1235815
Created September 22, 2011 19:42
enabled & import fixes
diff --git a/browser/devtools/styleeditor/test/browser_styleeditor_enabled.js b/browser/devtools/styleeditor/test/browser_styleeditor_enabled.js
index f32bf22..4d5b9e3 100644
--- a/browser/devtools/styleeditor/test/browser_styleeditor_enabled.js
+++ b/browser/devtools/styleeditor/test/browser_styleeditor_enabled.js
@@ -10,11 +10,14 @@ function test()
{
waitForExplicitFinish();
+ let count = 0;
addTabAndLaunchStyleEditorChromeWhenLoaded(function (aChrome) {
@neonux
neonux / gist:1220322
Created September 15, 2011 20:06
dumps before and after calling foo()
=== BEFORE FOO() ===
--- SCRIPT :0 ---
loc counts x line op
----- ---------------- ---- --
main:
00000:0/0/0/0/0/0 x 0 stop
--- END SCRIPT :0 ---
--- SCRIPT :0 ---
loc counts x line op