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 / chef_recipe_snippet.rb
Created June 28, 2013 16:39
chef snippet to generate a file from json attributes
file "/my/file/path.json" do
content JSON.stringify(my_json_attributes)
mode "0644"
action :create
end
@rpl
rpl / app_adapters_firefox.js
Last active December 29, 2015 14:19
Ember Inspector - Firefox Port Code Fragments
import BasicAdapter from "adapters/basic";
var FirefoxAdapter = BasicAdapter.extend({
// send messages from the target tag to devtool panel
sendMessage: function(options) {
options = options || {};
var event = document.createEvent("CustomEvent");
event.initCustomEvent("ember-extension-send", true, true, options);
document.documentElement.dispatchEvent(event);
@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 / BackboneDebugger_running_on_FirefoxWebExtensionAPI.gif
Last active September 30, 2015 11:43
Backbone Debugger Running on experimental Mozilla WebExtension devtools API
BackboneDebugger_running_on_FirefoxWebExtensionAPI.gif
TEST-PASS | leakcheck | default process: no leaks detected!
== BloatView: ALL (cumulative) LEAK AND BLOAT STATISTICS, tab process 24550
|<----------------Class--------------->|<-----Bytes------>|<----Objects---->|
| | Per-Inst Leaked| Total Rem|
0 |TOTAL | 56 4640| 152828 33|
11 |AsyncTransactionTrackersHolder | 72 72| 2 1|
42 |CompositorChild | 880 880| 1 1|
44 |CondVar | 40 120| 25 3|
@rpl
rpl / httpd.js
Last active December 18, 2015 17:55
test-load-httpd firefox addon
/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
/* vim:set ts=2 sw=2 sts=2 et: */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
/*
* An implementation of an HTTP server both as a loadable script and as an XPCOM
* component. See the accompanying README file for user documentation on
* httpd.js.
@rpl
rpl / ext-tabs.js
Last active January 18, 2016 21:03
tabs.duplicate
duplicate: function(tabId, callback) {
let tab = TabManager.getTab(tabId);
// Ignore invalid tab ids.
if (!tab) {
if (callback) {
runSafe(context, callback, undefined);
}
return;
}