This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/ash | |
#set -x | |
SELF=`basename $0 .sh` | |
function log() { | |
logger -t $SELF -s "$@" | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import org.apache.commons.io.input.ReaderInputStream; | |
import org.apache.commons.lang.StringUtils; | |
import java.io.BufferedReader; | |
import java.io.IOException; | |
import java.io.InputStream; | |
import java.io.InputStreamReader; | |
import java.nio.charset.StandardCharsets; | |
import java.util.HashMap; | |
import java.util.LinkedHashMap; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Adblock script for OpenWRT | |
# (c) 2014 by Jan Holthuis | |
# | |
# This is an adblocker script for OpenWRT. Simply run this script as a | |
# daily cronjob on your OpenWRT-router. This works since OpenWRT | |
# revision 39312 [1] and does not manipulate any files in /etc/. | |
# Instead, this adds the adblock serverlist as a separate file | |
# to /tmp/dnsmasq.d/. It also checks the file with grep to make sure | |
# that it doesn't contain malicious commands. | |
# |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function csLogger (subject, topic, data) { console.log (topic, data); } | |
Services.obs.addObserver(csLogger, "garbage-collection-statistics", false); | |
Services.obs.addObserver(csLogger, "cycle-collection-statistics", false); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/mozmill_automation/testrun.py b/mozmill_automation/testrun.py | |
--- a/mozmill_automation/testrun.py | |
+++ b/mozmill_automation/testrun.py | |
@@ -468,6 +468,34 @@ | |
""" Execute the endurance tests in sequence. """ | |
self.endurance_results = [] | |
+ | |
+ # instantiate handlers | |
+ logger = mozmill.logger.LoggerListener(log_file=self.options.logfile, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const { classes: Cc, interfaces: Ci, utils: Cu } = Components; | |
var gfxInfo = Cc["@mozilla.org/gfx/info;1"].getService(Ci.nsIGfxInfo); gfxInfo.getInfo().toSource(); | |
/** | |
* Example output: | |
* ({AzureCanvasBackend:"cairo", AzureFallbackCanvasBackend:"none", AzureContentBackend:"none"}) | |
* | |
* Or: | |
* Error: gfxInfo.getInfo is not a function | |
* | |
* Or even: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* To get a base64 encoded data uri from a local file | |
* | |
* @originalauthor brody at MozillaZine | |
* @see http://forums.mozillazine.org/viewtopic.php?p=5091285#p5091285 | |
*/ | |
brodyFile2DataURL = { | |
getFileFromURLSpec: function(aURL) { | |
var ios = Components.classes["@mozilla.org/network/io-service;1"].getService(Components.interfaces.nsIIOService); | |
var fph = ios.getProtocolHandler("file").QueryInterface(Components.interfaces.nsIFileProtocolHandler); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Components.utils.import("resource:///modules/XPCOMUtils.jsm"); | |
XPCOMUtils.defineLazyModuleGetter(this, "Services", "resource:///modules/Services.jsm"); | |
XPCOMUtils.defineLazyModuleGetter(this, "AddonManager", "resource:///modules/AddonManager.jsm"); | |
AddonManager.getAddonsByTypes(["locale"] , function (aAddons) { | |
aAddons.forEach(function(aAddon){ | |
Services.console.logStringMessage(aAddon.name + " ("+ aAddon.id +") is " + (aAddon.isCompatible ? "compatible" : "not compatible") ); | |
}); | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const Cc = Components.classes; | |
const Ci = Components.interfaces; | |
const Cu = Components.utils; | |
Components.utils.import('resource://gre/modules/XPCOMUtils.jsm'); | |
Components.utils.import('resource://gre/modules/Services.jsm'); | |
function startup(aData, aReason) { | |
var fileuri = Services.io.newFileURI(aData.installPath); | |
if (!aData.installPath.isDirectory()) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Progress listener that stops the loading of tabs that are opened in | |
* the background and whose contents is loaded by C++ code. This | |
* occurs for instance when the 'browser.tabs.loadDivertedInBackground' | |
* preference is enabled (because links are always opened by docshell code). | |
*/ | |
function BarTabWebProgressListener () {} | |
BarTabWebProgressListener.prototype = { | |
... | |
/*** nsIWebProgressListener ***/ |
NewerOlder