Skip to content

Instantly share code, notes, and snippets.

@erikvold
erikvold / toggleFindBar.uc.js
Created June 23, 2011 18:27 — forked from xulapp/toggleFindBar.uc.js
toggleFindBar.uc.js
// ==UserScript==
// @include main
// @compatibility Firefox 4.0+
// ==/UserScript==
document.getElementById('cmd_find').setAttribute('oncommand', 'gFindBar.hidden ? gFindBar.onFindCommand() : gFindBar.close();');
@erikvold
erikvold / run-this.js
Created June 10, 2011 23:59 — forked from zpao/run-this.js
Simple Window + Tab Stats
// Run this in your error console
var wc=0, tc=0;
var wm = window.top.opener.Services.wm;
var e = wm.getEnumerator("navigator:browser");
var uc = { };
while (e.hasMoreElements()) {
var tabs = e.getNext().gBrowser.tabs;
wc+=1;
tc += tabs.length;
Array.forEach(tabs, function(t) {
@erikvold
erikvold / dominant-color.js
Created June 9, 2011 23:57 — forked from leibovic/dominant-color.js
Dominant Color
function getDominantColor(aImg) {
let canvas = document.createElement("canvas");
canvas.height = aImg.height;
canvas.width = aImg.width;
let context = canvas.getContext("2d");
context.drawImage(aImg, 0, 0);
// keep track of how many times a color appears in the image
let colorCount = {};
// ==UserScript==
// @name Document Start Test
// @namespace vidzbigger.com
// @description This scrip tests document-start
// @include http://*
// @run-at document-start
// ==/UserScript==
GM_addStyle('body{display:none;}');
// ==UserScript==
// @name FF4 window test
// @namespace ventero.de
// @include http://ventero.de/temp/test_gm_ff4.html
// ==/UserScript==
if(typeof window.functionInPageScope !== "undefined")
window.functionInPageScope();
alert(functionInPageScope);
// ==UserScript==
// @name DOMNodeInserted Test
// @namespace test
// ==/UserScript==
GM_setValue('test', 'works');
document.body.addEventListener('DOMNodeInserted', function(event) {
var access=GM_getValue('test', 'FAILS!!');
if ('undefined'==typeof access) access='FAILS!!';
// ==UserScript==
// @name Github: unfold commit history
// @namespace http://github.com/johan/
// @description Adds an "unfold all changesets" button on Commit History pages at github, which lets you browse the source changes without leaving the page. /Click a commit header again to re-fold it.)
// @include https://github.com/*/commits/*
// @include http://github.com/*/commits/*
// ==/UserScript==
(function() {
if ('undefined' == typeof __PAGE_SCOPE_RUN__) { // unsandbox, please!
#!/usr/bin/env python
import glob
import operator
import re
import string
import sys
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
// ==UserScript==
// @name GitHub Dashboard Twitter
// @namespace http://tekkub.net/
// @include https://github.com/
// ==/UserScript==
$("div.news h1").before(
$("<div>").attr("id", "twitter_div2").append(
$("<h1>").text("GitHub status ").css({
@erikvold
erikvold / longurl.js
Created January 3, 2010 07:54 — forked from ba3r/longurl.js
/* longurl v0.81 */
CmdUtils.CreateCommand({
names: ["expand-short-url", "longurl.org"],
icon: "data:image/x-icon;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsQAAA7EAZUrDhsAAAFvSURBVDhPjZPLSsNAFIb/OZNUrLSKl4VbcaEgqOB14wP4DD6C6CuIax/AV/AxdCFeEBeCbyBeUAppoWlME8+ZZtLUJmnJYpJh/nP+/zsT9dMM4qPLJ3x6AeIICKMYYTdKVn4337Lynllj+L9d1Ct1vF5sQr/MHp69NTpQ/AyKpQgXHBBLEaDTmsLi8jXe3SuQdNaqRCxu0iJAu1nF6sYtDvaf8eX5oGHbmc42irHfF+9uP6LTrsGlCqjQ9ggxKQ1NmgukwMbvbMWOIi4QW+oZYEK+wLYVc28odkFhKIfzaQuwlfU72MxZMbF9bRwMzXkQ2N7OvQGWJ9bKEQZJhJxRSWe/UMz2SWUg5mQWsZPQlszWtpbsRBxBGJQA6x3krAXifoF/l6Tcdq+zEQtE+THs9bSZR9m2YsW/AM1NzmBp7caMSjqPZZs7R3x/FqrzUB+eF58/nOK7FaBCbgrKjI0PmlEx7axtxfvTEzWcbB3jD1bNgOd9VMEgAAAAAElFTkSuQmCC",
homepage: "http://longurl.org/tools",
author: {name: "Sean Murphy", homepage: "http://IamSeanMurphy.com"},
contributors: {name: "Michael Baer", homepage: "http://twitter.com/synapsos"},
license: "GPL",
help: "Select a shortened URL and type longurl to display