Skip to content

Instantly share code, notes, and snippets.

View leibovic's full-sized avatar

Margaret Leibovic leibovic

  • League
  • Ottawa, ON
  • 03:04 (UTC -04:00)
View GitHub Profile
@leibovic
leibovic / scratchpad.js
Created June 11, 2015 23:06
Replaces the signed ABP extension file in the profile directory with a slightly modified version
let fileName = "{d10d0bf8-f5b5-c8b4-a8b2-2b9879e08c5d}.xpi";
// Copy new add-on file from sdcard to profile extensions directory
let newFile = Cc['@mozilla.org/file/local;1'].createInstance(Ci.nsILocalFile);
newFile.initWithPath("/sdcard/" + fileName);
let extDir = FileUtils.getFile("ProfD", ["extensions"]);
newFile.copyTo(extDir, fileName);
console.log("moved file from sdcard to extensions directory");
@leibovic
leibovic / add-logins.js
Created September 24, 2015 18:06
Adds fake logins to yout Firefox login manager
/*
* This is a JavaScript Scratchpad.
*
* Enter some JavaScript, then Right Click or choose from the Execute Menu:
* 1. Run to evaluate the selected text (Cmd-R),
* 2. Inspect to bring up an Object Inspector on the result (Cmd-I), or,
* 3. Display to insert the result in a comment after the selection. (Cmd-L)
*/
function addFakeLogins(window) {
@leibovic
leibovic / data-uri.sh
Created September 28, 2015 21:58
png to data URI
echo -n `cat file.png` | base64 > output.txt
openssl base64 < file.png | tr -d '\n' > output.txt
cat file.png | openssl base64 | tr -d '\n' > output.txt
openssl base64 -in file.png -out output.txt