Skip to content

Instantly share code, notes, and snippets.

@yajd
yajd / gist:9423152
Last active August 29, 2015 13:57
best up time free hosting with php and mysql
1. Say 99.8% - https://secure.freehostingeu.com/ (Page86!)
2. Say 99% - http://www.host-ed.net/
3. Say up time is their #1 goal but no number shown - http://www.byethost.com/free-hosting
@yajd
yajd / gist:9476471
Created March 10, 2014 23:16
_ff-addon-snippet-DynamicallyInsertFrameIntoPanel - When you dyanically insert iframe into panel you MUST use namespace HTML or else on DOMContentLoaded or load(with true) the iframe.contentWindow will be undefined!!! Crazyyyyy
var iframe = win.document.createElementNS('http://www.w3.org/1999/xhtml', 'iframe');
iframe.setAttribute('style','border:0; background-color:rgba(255,255,255,.95); ;margin:0; padding:0; width:300px; height:300px; box-shadow: 0 3px 10px rgba(0, 0, 0, 0.3); border-radius:10px;');
iframe.addEventListener('DOMContentLoaded', function() {
console.log('done loaded', iframe.contentWindow);
}, false);
@yajd
yajd / gist:9535908
Created March 13, 2014 20:08
/Find Bar/ creator and info
dtownsend@oxymoronical.com
http://www.oxymoronical.com/web/firefox/FindBarRX
@yajd
yajd / gist:9536294
Created March 13, 2014 20:26
australis tour page with nice animation and css
https://www.mozilla.org/en-US/firefox/29.0a2/whatsnew/?oldversion=27.0.1
@yajd
yajd / _ff-addon-snippet-SSS.js
Created March 13, 2014 22:06
_ff-addon-snippet-SSS - using style sheet service
var sss = Components.classes['@mozilla.org/content/style-sheet-service;1'].getService(Components.interfaces.nsIStyleSheetService);
var ios = Components.classes['@mozilla.org/network/io-service;1'].getService(Components.interfaces.nsIIOService);
try {
sss.unregisterSheet(cssUri, sss.USER_SHEET);
} catch (ex) {}
var css = 'setting .preferences-alignment{ display:flex; flex-direction:row-reverse; align-items:center; }';
//var cssEnc = 'data:text/css;base64,' + window.btoa(css);
var cssEnc = encodeURIComponent(css);
var cssUri = makeURI('data:text/css,' + cssEnc);
sss.loadAndRegisterSheet(cssUri, sss.USER_SHEET);
You sure can do this.
Use the nsIEventListenerInfo component.
https://developer.mozilla.org/en-US/docs/XPCOM_Interface_Reference/nsIEventListenerInfo
Just tell it which element you want to get the listeners for.
@yajd
yajd / gist:9656859
Created March 20, 2014 03:53
check out these addons
adds beutiful button to aurora non restartless so its interesting - https://addons.mozilla.org/en-US/firefox/addon/re-start/?src=cb-dl-hotness
beutiful post man alternative for firefox - https://addons.mozilla.org/en-US/firefox/addon/rest-easy/?src=cb-dl-hotness
@yajd
yajd / gist:9752419
Created March 25, 2014 00:27
textencoder question
does textencoder and textdecodeer module decode the new line character per os. like if i use \n for eol character it will encode it properly? but what if i read \n in my code and i did this on windows then on mac or something its \r?
var me = Services.wm.getMostRecentWindow(null);
Cu.import('resource://gre/modules/osfile.jsm');
var pathProfilesIni = OS.Path.join(OS.Constants.Path.userApplicationDataDir, 'profiles.ini');
me.alert(pathProfilesIni);
//apparently theres for profiles made in default prof dir:
//localDir = C:\Users\ali57233\AppData\Local\Mozilla\Firefox\Profiles\czbm1ps9.rnd1
//rootDir = C:\Users\ali57233\AppData\Roaming\Mozilla\Firefox\Profiles\czbm1ps9.rnd1
//for custom prof dir localDir and rootDir are same
@yajd
yajd / bootstrap.js
Last active August 29, 2015 13:57
trying to extend whole findbar
const {classes: Cc, interfaces: Ci, utils: Cu} = Components;
const self = {
name: 'MatchWord',
path: {
chrome: 'chrome://matchword/content/'
},
aData: 0,
};
const myServices = {};
var cssUri;