Skip to content

Instantly share code, notes, and snippets.

View bgrins's full-sized avatar

Brian Grinstead bgrins

View GitHub Profile
@bgrins
bgrins / cloc-fxteam.log
Created June 25, 2014 21:45
Lines of code count for Firefox (fx-team)
cloc fx-team
126872 text files.
94996 unique files.
207360 files ignored.
http://cloc.sourceforge.net v 1.58 T=924.0 s (83.6 files/s, 18978.3 lines/s)
--------------------------------------------------------------------------------
Language files blank comment code
--------------------------------------------------------------------------------
C++ 8753 616565 452290 3649379
@bgrins
bgrins / getFilePath.js
Last active August 29, 2015 14:07
Fx frontend snippets
Components.classes["@mozilla.org/chrome/chrome-registry;1"]
.getService(Components.interfaces.nsIChromeRegistry)
.convertChromeURL(makeURI("chrome://global/skin/icons/chevron.png")).spec
/* Or, inside of webapprt: */
Components.utils.import("resource://gre/modules/Services.jsm");
Components.classes["@mozilla.org/chrome/chrome-registry;1"].getService(Components.interfaces.nsIChromeRegistry).convertChromeURL(Services.io.newURI("chrome://global/skin/icons/chevron.png",
null, null)).spec
gToolbox.once("debugger-ready", panel => {
panel._controller.activeThread.addListener("paused", this._updateBadgeText)
panel._controller.activeThread.addListener("resumed", this._updateBadgeText)
});
@bgrins
bgrins / talos-instructions-WIP
Created December 19, 2014 21:34
How to test try push against talos (WIP)
bgrins: MattN: can you remind me what the talos tests I should compare when converting tab preprocessor stuff to CSS variables?
4:52:53 PM MattN: bgrins: other, svgr
---
Using build API to retrigger tests: https://secure.pub.build.mozilla.org/buildapi/self-serve/try/rev/a156536eadd1
Use TabSubmit addon to be able to retrigger a bunch at a time (it's a <form> so you can't normall cmd+click to open in new tab): https://addons.mozilla.org/en-US/firefox/addon/tabsubmit/
Then can compare talos results from a try push once you have a sufficient number of runs: http://compare-talos.mattn.ca/dev/?oldBranch=Fx-Team&oldRevs=94be697bd801&newBranch=Try&newRev=a156536eadd1&submit=true
@bgrins
bgrins / using-walker-from-scratchpad.js
Last active May 31, 2017 18:12
Opening a devtools connection and sample usage of the walker front
var { console } = Cu.import("resource://gre/modules/devtools/Console.jsm", {});
var { gDevTools } = Cu.import("resource:///modules/devtools/gDevTools.jsm", {});
var { devtools } = Cu.import("resource://gre/modules/devtools/Loader.jsm", {});
var { InspectorFront } = devtools.require("devtools/shared/fronts/inspector");
var { Task } = Cu.import("resource://gre/modules/Task.jsm", {});
Task.async(function* () {
let target = yield devtools.TargetFactory.forRemoteTab(gBrowser.selectedTab);
let inspector = InspectorFront(target.client, target.form);
jpm run --binary /Applications/FirefoxDeveloperEdition.app/ --binary-args --jsconsole -v
@bgrins
bgrins / find-intermittent.sh
Created January 27, 2015 22:39
A script to find an intermittent mochitest error - meant to be run in an VM
./mach mochitest-devtools browser/devtools/inspector --start-at browser_inspector_highlighter-iframes.js --end-at browser_inspector_iframe-navigation.js --run-until-failure --repeat 10000
@bgrins
bgrins / async-storage.js
Created February 18, 2015 23:56
devtools storage api command
let require = Components.utils.import("resource://gre/modules/devtools/Loader.jsm", {}).devtools.require;
const asyncStorage = require("devtools/toolkit/shared/async-storage");
asyncStorage.clear();
const {Cc, Ci, Cu, Cr} = require("chrome");
Cu.importGlobalProperties(["indexedDB"]);
const {Promise} = Cu.import("resource://gre/modules/Promise.jsm", {});
/*!
localForage -- Offline Storage, Improved
Version 1.2.2
https://mozilla.github.io/localForage
(c) 2013-2015 Mozilla, Apache License 2.0
@bgrins
bgrins / browser-toolbox-run.sh
Last active August 5, 2020 17:00
Running browser toolbox as a separate process
# Start a normal instance with the debugger server running
./mach run --start-debugger-server 6080
# Run the Browser Toolbox instance
MOZ_BROWSER_TOOLBOX_PORT=6080 ./mach run --temp-profile -chrome chrome://devtools/content/framework/browser-toolbox/window.html --purgecaches --jsconsole