Skip to content

Instantly share code, notes, and snippets.

View rpl's full-sized avatar

Luca Greco rpl

  • Mozilla
  • Lecce, Italy
View GitHub Profile
@rpl
rpl / .gitignore
Last active August 29, 2015 14:02
JEP DevTools SDK Director
_Attic
@rpl
rpl / dev_panel_example.js
Last active August 29, 2015 14:07
Extending the Firefox Developer Tools
// import base Devtools SDK Panel constructor
const { Panel } = require("dev/panel");
// import Devtools SDK Toolbox manager constructor
const { Tool } = require("dev/toolbox");
// import Class helper from the Addon SDK
const { Class } = require("sdk/core/heritage");
// import self module needed to result data resources urls
var self = require('sdk/self');
@rpl
rpl / README.md
Last active August 29, 2015 14:23
RDP packets dump (filtered and unfiltered)

This gist contains two RDP packets dump (loadable in the RDP Inspector):

  • filtered (with the RDPi internals RDP packets filtered)
  • unfiltered (without any filtering enabled)
@rpl
rpl / tomboy_ubiquity.js
Created October 11, 2008 12:56
Tomboy Ubiquity Commands (require mozjs_dbus extension)
Components.utils.import("resource://mozjs_dbus/DBUS.jsm");
const bus = DBUS.sessionBus;
const tb = bus.getObject("org.gnome.Tomboy",
"/org/gnome/Tomboy/RemoteControl",
"org.gnome.Tomboy.RemoteControl");
CmdUtils.CreateCommand({
name: "tomboy-list",
homepage: "http://rplcodeline.blogspot.com",
function reloadChrome() {
try {
Components.classes["@mozilla.org/chrome/chrome-registry;1"].
getService(Components.interfaces.nsIXULChromeRegistry).reloadChrome();
} catch(e) { alert(e); }
}
reloadChrome.doc = "Reload all chrome packages";
function debugPrefs(enabled) {
var notifyBox = window.getNotificationBox(content);
notifyBox.appendNotification( "XULit say: NotificationBox is cool, isn't it?",
"notify-01",
"chrome://xulnotificationbox/content/xulit.ico",
notifyBox.PRIORITY_INFO_LOW, null);
%% yate_decode: yate message decoding experimental erlang module.
%%
%% Copyright (C) 2009 - Alca Società Cooperativa <info@alcacoop.it>
%%
%% Author: Luca Greco <luca.greco@alcacoop.it>
%%
%% This program is free software: you can redistribute it and/or modify
%% it under the terms of the GNU Lesser General Public License as published by
%% the Free Software Foundation, either version 3 of the License, or
%% (at your option) any later version.
const Ci = Components.interfaces;
const Cr = Components.results;
const STATE_START = Ci.nsIWebProgressListener.STATE_START;
const STATE_STOP = Ci.nsIWebProgressListener.STATE_STOP;
var myScreenshotListener =
{
QueryInterface: function(aIID) {
if (aIID.equals(Ci.nsIWebProgressListener) ||
aIID.equals(Ci.nsISupportsWeakReference) ||
// recovery
var httpReadOrRetry = function (url, timeout, times) {
return http.read(url).then(function (content) {
return content;
}, function (error) {
if (times == 0)
return error;
return delay(timeout).then(function () {
return httpReadOrRetry(url, timeout, times - 1);
});