Skip to content

Instantly share code, notes, and snippets.

@Happy-Ferret
Happy-Ferret / chrome.js
Created March 29, 2017 06:36 — forked from Gozala/chrome.js
API for chrome URI registration
/*jshint asi:true globalstrict:true*/
'use strict';
// Workaround for Bug 785891
// and sugar around: https://developer.mozilla.org/en-US/docs/XPCOM_Interface_Reference/nsIComponentManager#addBootstrappedManifestLocation%28
let { Cc, Ci, Cm } = require('chrome')
let ioService = Cc['@mozilla.org/network/io-service;1'].
getService(Ci.nsIIOService)
@Happy-Ferret
Happy-Ferret / resource.js
Created March 29, 2017 06:37 — forked from Gozala/resource.js
SDK API for registering new resource URIs
/*jshint asi:true globalstrict:true*/
'use strict';
let { Cc, Ci } = require('chrome')
let ioService = Cc['@mozilla.org/network/io-service;1'].
getService(Ci.nsIIOService)
let resourceHandler = ioService.getProtocolHandler('resource').
QueryInterface(Ci.nsIResProtocolHandler)
@Happy-Ferret
Happy-Ferret / compute.html
Created April 24, 2017 08:48 — forked from adrianseeley/compute.html
WEBGL COMPUTE SHADER SETUP
<!DOCTYPE html>
<html>
<canvas id="c" width="128" height="128"></canvas>
<script src="glutil.js"></script>
<script id="vshader" type="text/plain">
attribute vec2 vtxpos;
varying vec2 texpos;
void main() {
texpos = (vtxpos / 2.) + vec2(0.5, 0.5);
gl_Position = vec4(vtxpos, 0, 1);
@Happy-Ferret
Happy-Ferret / gist:77144d8019bcdb41a69e590810cf3766
Created May 1, 2017 00:33
Typescript d.ts for PlayCanvas engine
declare module pc {
export module fw {
export class Application {
constructor(canvas: HTMLElement, options: any);
start: () => void;
setCanvasFillMode: (mode: any) => void;
setCanvasResolution: (mode: any) => void;
on: (event: string, any) => void;
@Happy-Ferret
Happy-Ferret / _ff-addon-snippet-IsWorktationLocked.js
Created August 21, 2017 09:46 — forked from Noitidart/_ff-addon-snippet-IsWorktationLocked.js
_ff-addon-snippet-IsWorktationLocked - Detects if workstation is locked or not. (Windows) (jsctypes)
Cu.import('resource://gre/modules/ctypes.jsm')
var wintypesInit = function() {
// BASIC TYPES (ones that arent equal to something predefined by me)
this.BOOL = ctypes.bool;
this.DWORD = ctypes.uint32_t;
this.HANDLE = ctypes.voidptr_t;
this.INT = ctypes.int;
this.PVOID = ctypes.voidptr_t;
@Happy-Ferret
Happy-Ferret / install-addon
Created August 23, 2017 06:09 — forked from jeffgca/install-addon
A node script that abuses child_process to run cfx and post the resulting xpi to Firefox. Requires: *nix, a working installation of the Add-on SDK ( with cfx on your PATH ) and a recent version of Firefox with the 'Extension Auto-installer' extension installed.
#!/usr/bin/env node
var util = require('util'),
fs = require('fs'),
path = require('path'),
http = require('http'),
_ = require('lodash'),
url = require('url');
var DEBUG = false,
@Happy-Ferret
Happy-Ferret / README.md
Created August 23, 2017 08:53 — forked from eddiejaoude/README.md
Install Firefox addon/extension with no user interaction
@Happy-Ferret
Happy-Ferret / fast-firefox
Created September 16, 2017 13:47 — forked from amorgner/fast-firefox
Some config options to make Firefox faster (updated)
Over time, I collected some options to make Firefox really fast.
WARNING! NO WARRANTY, use on your own risk!
If you know what you're doing, go to 'about:config' and edit the listed values accordingly.
Hint: Double-click boolean values to toggle true/false.
###########################
If mouse-wheel scrolling is slow, try
@Happy-Ferret
Happy-Ferret / bootstrap.js
Created September 19, 2017 12:44 — forked from Noitidart/bootstrap.js
Bootstrap addon demo. Shows how to add a sidebar to all browsing windows. More specifically, a sidebar which allows HTML content.
const {interfaces: Ci, utils: Cu} = Components;
Cu.import('resource://gre/modules/Services.jsm');
/*start - windowlistener*/
var windowListener = {
//DO NOT EDIT HERE
onOpenWindow: function (aXULWindow) {
// Wait for the window to finish loading
let aDOMWindow = aXULWindow.QueryInterface(Ci.nsIInterfaceRequestor).getInterface(Ci.nsIDOMWindowInternal || Ci.nsIDOMWindow);
aDOMWindow.addEventListener("load", function () {
@Happy-Ferret
Happy-Ferret / _ff-addon-snippet-xcbGrabKey.js
Created September 22, 2017 17:40 — forked from Noitidart/_ff-addon-snippet-xcbGrabKey.js
_ff-addon-snippet-xcbGrabKey - Trying to create a global hotkey with XCB. [jsctypes] [xcb] [unix] [linux] [*nix]
Cu.import('resource://gre/modules/ctypes.jsm');
var libxcb;
try {
libxcb = ctypes.open('libxcb.so');
} catch(ignore) {
libxcb = ctypes.open('libxcb.so.1');
}
var libkey;