Skip to content

Instantly share code, notes, and snippets.

ubuntu
libxcb-randr.so.0 (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libxcb-randr.so.0
libXrandr.so.2 (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libXrandr.so.2
libXrandr.so.2 (libc6) => /usr/lib/i386-linux-gnu/libXrandr.so.2
libXrandr.so (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libXrandr.so
libc.so.6 (libc6,x86-64, OS ABI: Linux 2.6.24) => /lib/x86_64-linux-gnu/libc.so.6
libc.so.6 (libc6, OS ABI: Linux 2.6.24) => /lib/i386-linux-gnu/libc.so.6
libc.so.6 (libc6, OS ABI: Linux 2.6.24) => /lib32/libc.so.6
@yajd
yajd / gist:d0e5b61761de2e35cfb4
Last active August 29, 2015 14:25
x11ss copy paste jacked up dashed
Cu.import('resource://gre/modules/ctypes.jsm');
var libx11 = ctypes.open('libX11.so.6');
var core = {os:{}};
core.os.xpcomabi = Services.appinfo.XPCOMABI; // for non worker
core.os.name = OS.Constants.Sys.Name.toLowerCase();
// temp overide as no cutils:
var cutils = {
jscGetDeepest: function(a) { return a }
'use strict';
// Imports
importScripts('resource://gre/modules/osfile.jsm');
importScripts('resource://gre/modules/workers/require.js');
// Globals
const core = { // have to set up the main keys that you want when aCore is merged from mainthread in init
addon: {
path: {
var collMonInfos = [];
var rootGdkWin = ostypes.API('gdk_get_default_root_window')();
console.info('rootGdkWin:', rootGdkWin.toString(), uneval(rootGdkWin), cutils.jscGetDeepest(rootGdkWin));
var rootGtkWin = ostypes.HELPER.gdkWinPtrToGtkWinPtr(rootGdkWin);
// the screen contains all monitors
var gdkScreen = ostypes.API('gtk_window_get_screen')(rootGtkWin);
var yourStringBundle = Services.strings.createBundle('chrome://blah@jetpack/content/bootstrap.properties?' + Math.random()); /* Randomize URI to work around bug 719376 */
var props = yourStringBundle.getSimpleEnumeration();
// MDN says getSimpleEnumeration returns nsIPropertyElement // https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIStringBundle#getSimpleEnumeration%28%29
while (props.hasMoreElements()) {
var prop = props.getNext();
// doing console.log(prop) says its an XPCWrappedObject but we see QueryInterface (QI), so let's try QI'ing to nsiPropertyElement
var propEl = prop.QueryInterface(Ci.nsIPropertyElement);
define('app',[
'routes',
// 'cordova',
'angular',
'angularRoute',
'angularResource',
'angularTouch',
'config',
'controllers',
'services',
I am trying to dynamically create and insert a panel such that it spans across all monitors. I already got the top left most x and y coords and i have the full width and height of all monitors combined. However my panel seems to appear only one monitor even if i set the width and height to be over that size, this is my code, this will put a panel over everything, double click it to close it.
var win = Services.wm.getMostRecentWindow(null);
var panel = win.document.createElement('panel');
var screen = Services.appShell.hiddenDOMWindow.screen;
var props = {
noautohide: true,
level: 'top',
style: 'padding:0; margin:0; width:3286px; height:1237px; -moz-appearance:none; background-color:steelblue;'
}
Calling java from XUL applications
XULRunner is a technology from Mozilla that allows to create cross-platform GUI applications just as easy as a websites. Today I was trying to use my java libraries inside of a XUL application. This is basically to be able to load a jar file and call java functions with my javascript code. It turns out that the only ( and the best ) way to accomplish this is by using LiveConnect, a feature of java plugin that allows to 'talk' to java. LiveConnect among other things is responsible for communication with java applets. With LiveConnect one can instanciate arbitrary java class and use it in javascript. Any java objects returned from method calls will be accessible in javascript as well as any javascript objects passed to java methods will be accessible in java. To achieve this effect LiveConnect does two-way wrapping of objects, i.e. it wraps java object with javascript and the other way around. More precisely, to instanciate a JVM object simply do this:
var javaObject = new j
@yajd
yajd / _moz-versionScheme.md
Last active August 29, 2015 14:24
_moz-versionScheme - My personal version scheme for Mozilla products such as add-ons etc.

Example of Versioning Scheme

1.0-night.initial
	1.0-night.rev1
		1.0-night.rev2
			1.0-night (completed nightly channel work of 1.0) (so this is completed nightly, release this and if any fixes needed then it goes to 1.0a.inital if that wasnt needed then can go straight from here to 1.0)
				1.0a1.initial
					1.0a1.rev1
						1.0a1.rev2
 1.0a1
(gdb) cont
Continuing.
[New Thread 0x7f09121ff700 (LWP 28983)]
[New Thread 0x7f0924ef7700 (LWP 28984)]
[New Thread 0x7f091b0fd700 (LWP 28985)]
[New Thread 0x7f08fc2ff700 (LWP 28986)]
[New Thread 0x7f08fb0ff700 (LWP 29008)]
[New Thread 0x7f08f87ff700 (LWP 29009)]
Program received signal SIGSEGV, Segmentation fault.