Skip to content

Instantly share code, notes, and snippets.

View autonome's full-sized avatar

Dietrich Ayala autonome

View GitHub Profile
@autonome
autonome / betterSeesmic.js
Created November 8, 2010 16:44
Some changes to make Seesmic Web use space more efficiently.
// Should make it a sliding drawer
document.getElementById("sideBarPanel").style.display = "none";
@autonome
autonome / awesomedata.js
Created November 9, 2010 15:49
Jetpack module for querying the datasource that powers the Firefox awesomebar.
const { Ci, Cc, Cu } = require("chrome");
Cu.import("resource://gre/modules/Services.jsm", this);
Cu.import("resource://gre/modules/XPCOMUtils.jsm", this);
function AutoCompleteInput(aSearches) {
this.searches = aSearches;
}
AutoCompleteInput.prototype = {
@autonome
autonome / commands.js
Created November 22, 2010 08:44
Jetpack module for searching and executing browser commands
/*
Module for searching available commands in the browser.
Allows searching and execution of commands in Firefox, such as
'Back', 'Zoom In', 'Reload'.
Example that adds buttons to the add-on bar for every command,
which trigger the command when clicked:
@autonome
autonome / ext-editor.js
Created December 1, 2010 08:46
CommonJS module for Jetpack for choosing and loading strings in an external editor.
/**
* Module for using an external editor.
*
* Example where the user will be prompted for the path
* to their editor of choice. The callback is passed the
* entirety of the changed contents, whenever a change is
* detected.
*
* const extEditor = require("ext-editor");
*
@autonome
autonome / newtab.js
Created December 12, 2010 02:23
CommonJS module for Jetpack that allows you to set the URI to load when a new tab is opened.
exports.setURI = function setURI(uri) {
let window = require("window-utils").activeWindow;
// Make BrowserOpenTab point to the new tab uri instead of about:blank
window.eval(window.BrowserOpenTab.toSource().replace(/about:blank/g, uri));
// Clear out the new tab url
window.eval(window.URLBarSetURI.toSource().replace(/}$/, 'if (gURLBar.value == "' + uri + '") gURLBar.value = ""; $&'));
};
@autonome
autonome / btoa.js
Created May 10, 2011 16:24
jetpack btoa
const { Cc, Ci } = require("chrome");
function base64encode(str) {
var wm = Cc["@mozilla.org/appshell/window-mediator;1"].
getService(Ci.nsIWindowMediator);
return wm.getMostRecentWindow("navigator:browser").btoa(str);
}
@autonome
autonome / poucherror.txt
Created August 1, 2012 05:41
pouch error
Sample code:
Pouch('idb://test', function(err, db) {
if (!err)
console.log('DB OPENED', db)
else
console.log('ERROR OPENING DB', err);
});
[22:36:45.849] ERROR OPENING DB ({status:500, error:"error", reason:({})}) @ http://localhost/pouch.html:75
@autonome
autonome / transitively-blocking-bookmarklet
Created September 18, 2012 21:26
Transitively-blocking Bookmarket - see a list of all bugs in the dependency chaing that are blocking a given bug. For use when on a bug details page on Bugzilla.
javascript:document.location='http://jlebar.github.com/transitively-blocking/?'+document.title.substr(0,6)
@autonome
autonome / blocking-template
Created October 1, 2012 15:29
blocking-template
Blocking-. We have to focus on stabilization and fixing of functional bugs, see https://wiki.mozilla.org/B2G/V1StabilizationPhase.
Once the functional issues are fixed, if a patch becomes available for this issue and it has tests and passes the smoketest, file it at https://bugzilla.mozilla.org/enter_bug.cgi?product=Boot2Gecko&component=Gaia and ask for driver approval.
@autonome
autonome / gist:4965107
Created February 16, 2013 01:55
jitsu log
squirple:bugdata dietrich$ jitsu deploy
path.existsSync is now called `fs.existsSync`.
info: Welcome to Nodejitsu
info: It worked if it ends with Nodejitsu ok
info: Executing command deploy
info: Analyzing your application dependencies in start.js
warn: Creating new snapshot for version 0.0.1-1
info: Done creating snapshot 0.0.1-1
error: Error running command deploy
error: Nodejitsu Error (500): Internal Server Error