Skip to content

Instantly share code, notes, and snippets.

View nmaier's full-sized avatar
😨
I may be slow to respond.

Nils Maier nmaier

😨
I may be slow to respond.
View GitHub Profile
@nmaier
nmaier / gist:1579273
Created January 8, 2012 18:41
alerts hello-world
Components.classes["@mozilla.org/alerts-service;1"].getService(Components.interfaces.nsIAlertsService).showAlertNotification(null, "hello", "world", false)
@nmaier
nmaier / wget.log
Created July 13, 2011 04:55
/downloads wget log
--2011-07-13 06:52:50-- https://github.com/downloads/nmaier/scriptish/scriptish-nightly-0.1.4a1pre.20110713.0400.xpi
Resolving github.com... 207.97.227.239
Connecting to github.com|207.97.227.239|:443... connected.
HTTP request sent, awaiting response...
HTTP/1.1 302 Found
Server: nginx/1.0.4
Date: Wed, 13 Jul 2011 04:52:57 GMT
Content-Type: text/html; charset=utf-8
Connection: keep-alive
Status: 302 Found
// ==UserScript==
// @id [email protected]
// @name Userscripts https installation
// @version 1.0
// @namespace tn123.org
// @author tn123
// @description Demonstrated GM_xpath usage
// @include http://userscripts.org/scripts/show/*
// @run-at document-end
// ==/UserScript==
@nmaier
nmaier / dc.html
Created June 9, 2011 19:42
Dominant FavIcon color, see dominantColor_opt; optimized processing + IMO better results on black/gray; requires chrome privs
<!DOCTYPE html>
<style type="text/css">
body {
-moz-column-count: 4;
}
</style>
<script type="text/javascript;version=1.8">
function getDominantColor(aImg) {
let canvas = document.createElement("canvas");
canvas.height = aImg.height;
@nmaier
nmaier / test-ignore.user.js
Created June 8, 2011 18:48
test ignoreRedirect and redirectionLimit
// ==UserScript==
// @id test-ignore
// @name test-ignore
// @namespace tn123.org
// @include https://tn123.org/
// ==/UserScript==
GM_xmlhttpRequest({
method: "GET",
url: "https://tn123.org/somewhere",
<?xml version="1.0"?>
<?xml-stylesheet href="skin.css" type="text/css"?>
<overlay id="AppTab-overlay" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<script type="application/javascript">
<![CDATA[
window.addEventListener('load', function() {
removeEventListener('load', arguments.callee, false);
function checkforAppTab() {
if (gBrowser.selectedTab.pinned) {
<!DOCTYPE>
<script type="text/javascript">
Object.prototype.a = "a";
Array.prototype.c = "c";
var o = {b: "b"};
for (var k in o) {
alert("obj key: " + k);
}
// expected: b
import os, sys
from zipfile import ZipFile, ZIP_DEFLATED
def stripdirectoryentries(source, target):
szf = ZipFile(source)
try:
if os.path.exists(target):
raise Exception("Target %s already exists" % target)
tzf = ZipFile(target, "w", ZIP_DEFLATED)
// ==UserScript==
// @name Linkify Plus
// @version 2.0.2
// @namespace http://arantius.com/misc/greasemonkey/
// @description Turn plain text URLs into links. Supports http, https, ftp, email addresses.
// @include http*
// @exclude http://www.google.tld/search*
// @exclude https://encrypted.google.tld/search*
// ==/UserScript==