Skip to content

Instantly share code, notes, and snippets.

View rpl's full-sized avatar

Luca Greco rpl

  • Mozilla
  • Lecce, Italy
View GitHub Profile
(require 'iimage)
(autoload 'iimage-mode "iimage" "Support Inline image minor mode." t)
(autoload 'turn-on-iimage-mode "iimage" "Turn on Inline image minor mode." t)
(add-to-list 'iimage-mode-image-regex-alist '("@startuml\s+\\(.+\\)" . 1))
;; Rendering plantuml
(defun plantuml-render-buffer ()
(interactive)
(message "PLANTUML Start rendering")
(shell-command (concat "java -jar ~/Downloads/plantuml.jar "
// 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);
});
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) ||
%% yate_decode: yate message decoding experimental erlang module.
%%
%% Copyright (C) 2009 - Alca Società Cooperativa <[email protected]>
%%
%% Author: Luca Greco <[email protected]>
%%
%% 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.
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);
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) {
@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",