Skip to content

Instantly share code, notes, and snippets.

@asutherland
asutherland / gist:5871825
Created June 26, 2013 21:21
recursion error
InternalError: too much recursion
isWhiteSpace@../../build/r.js:4618
skipComment@../../build/r.js:4803
loadLib/</wrapTrackingFunction/</<@../../build/r.js:7654
parseShiftExpression@../../build/r.js:6191
loadLib/</wrapTrackingFunction/</<@../../build/r.js:7663
parseRelationalExpression@../../build/r.js:6212
loadLib/</wrapTrackingFunction/</<@../../build/r.js:7663
parseEqualityExpression@../../build/r.js:6230
loadLib/</wrapTrackingFunction/</<@../../build/r.js:7663
This file has been truncated, but you can view the full file.
--------- beginning of /dev/log/system
--------- beginning of /dev/log/main
02-24 17:21:55.909 I/Gecko ( 1082): ThebesLayer (0x46a6c000) [shadow-visible=< (x=0, y=50, w=320, h=72); >] [visible=< (x=0, y=50, w=320, h=72); >] [componentAlpha] [valid=< (x=0, y=50, w=320, h=72); >]
02-24 17:21:55.909 I/Gecko ( 1082): ContentHost (0x45ec8ca0) [buffer-rect=(x=0, y=50, w=320, h=72)] [buffer-rotation=(x=0, y=0)]
02-24 17:21:55.909 I/Gecko ( 1082): GrallocTextureHostOGL (0x45f0df60) [size=(width=320, height=72)] [format=SurfaceFormat::B8G8R8A8] [flags=]
02-24 17:21:55.909 I/Gecko ( 1082): ContainerLayerComposite (0x46a70c00) [shadow-clip=(x=0, y=50, w=320, h=364)] [shadow-transform=[ 1 0; 0 1; 0 -7.6793; ]] [shadow-visible=< (x=312, y=148, w=6, h=57); >] [clip=(x=0, y=50, w=320, h=364)] [visible=< (x=312, y=148, w=6, h=57); >] [vscrollbar=83]
02-24 17:21:55.909 I/Gecko ( 1082): ThebesLayer (0x44f06400) [shadow-transform=[ 1 0; 0 1; 312 149; ]] [shadow
@asutherland
asutherland / gist:9216321
Created February 25, 2014 19:49
js2-mode AMD indent stuff
;; --- CommonJS AMD define() compensation
;; Check if the suggested indentation is due to define(). If it is, force
;; the indentation down to zero. We detect this case by checking whether the
;; parse depth is 2 and the last top-level point was preceded by define.
(defun require-def-deindent (list index)
(when (and (eq (nth 0 parse-status) 2)
(save-excursion
(let ((tl-point (syntax-ppss-toplevel-pos parse-status)))
(goto-char tl-point)
@asutherland
asutherland / gist:9219760
Created February 25, 2014 22:55
tn's patch to apply with B2G_DUMP_PAINTING=1 to get awesome paint dumps in gecko
diff --git a/layout/base/nsLayoutDebugger.cpp b/layout/base/nsLayoutDebugger.cpp
index 831b567..390edd9 100644
--- a/layout/base/nsLayoutDebugger.cpp
+++ b/layout/base/nsLayoutDebugger.cpp
@@ -137,7 +137,7 @@ PrintDisplayItemTo(nsDisplayListBuilder* aBuilder, nsDisplayItem* aItem,
}
nsIFrame* f = aItem->Frame();
nsAutoString fName;
-#ifdef DEBUG
+#ifdef DEBUG_FRAME_DUMP
@asutherland
asutherland / git-cleanup-branches
Created March 14, 2014 17:48
modified naive git cleanup script proposed by @millermedeiros
#!/bin/bash
MAYBEECHO=
if [ "$1" != 'gogogo' ]; then
MAYBEECHO=echo
echo "Pretending; pass 'gogogo' as an argument to actually do it."
echo
fi
git branch --merged origin/master | grep -v " master" | xargs -n 1 $MAYBEECHO git branch -d
@asutherland
asutherland / gist:9696605
Created March 21, 2014 21:11
thunderbird localhost smtp trace
220 icona.mv.mozilla.com ESMTP Postfix (Ubuntu)
EHLO [127.0.0.1]
250-icona.mv.mozilla.com
250-PIPELINING
250-SIZE 10240000
250-VRFY
250-ETRN
250-STARTTLS
250-AUTH PLAIN LOGIN
250-AUTH=PLAIN LOGIN
@asutherland
asutherland / force-adb-remount
Created August 15, 2014 21:03
sometimes "adb remount" doesn't work for me on FxOS
#!/bin/bash
adb shell mount -o remount,rw /system
@asutherland
asutherland / validate-imap-stls-cert
Last active December 17, 2016 01:35
Email SSL/TLS validation helpers using openssl command line
#!/bin/bash
openssl s_client -CApath /etc/ssl/certs -starttls imap -connect $1:143 < /dev/null
@asutherland
asutherland / a-way-to-bookmark-windows.md
Last active August 29, 2015 14:17
xdotool window hotkey bookmarking

Two shell scripts to bookmark and restore bookmarks for windows. Based on exact window id's.

You then use these in your desktop environment's global keybindings. For example I have bound:

  • Alt-Super-1 to "bookmark-window-as 1"
  • Super-1 to "bookmark-activate-window 1" And so on for all digits. You could also use letters or whatever you want.

Note that if you don't want bookmarking and instead just want Super-F to always bring up your Firefox window, you want to do things like directly invoke "xdotool search --class firefox windowactivate" (which is literally an example I just ripped from "man xdotool").

@asutherland
asutherland / child-frame.html
Created November 16, 2015 20:40
iframe entrainment investigation
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<script src="child-frame.js" type="application/javascript"></script>
</head>
<body id="content">
<div id="expando-friend">
Child!
</div>