Skip to content

Instantly share code, notes, and snippets.

@satyr
satyr / gist_diff.user.js
Created May 5, 2009 22:40 — forked from ucnv/README.md
Diffs on Gist with google-diff-match-patch
// ==UserScript==
// @name gist diff
// @namespace http://github.com/satyr
// @description Shows diffs on Gist with google-diff-match-patch.
// @include https://gist.github.com/*
// @require https://raw.github.com/gist/105908
// @require https://google-diff-match-patch.googlecode.com/svn/trunk/javascript/diff_match_patch.js
// @fork_of http://gist.github.com/105913
// @check_also http://gist.github.com/107780
// ==/UserScript==
@satyr
satyr / selector.ubiq.js
Created May 2, 2009 12:52 — forked from cers/x
CmdUtils.CreateCommand({
name: 'selector-selector',
description: (
<ul style="list-style-image:none">
<li>Lets you type a CSS selector and highlights matched elements.</li>
<li>Hovering on an element creates a matching selector.</li>
</ul>+''),
help: [
[<b>Left-click / Enter</b>,
'Copy and Quit'],
// 1. Should also work for <img>, <form>, <link>, etc.
// 2. Should also work for html string, DOM, and XML.
// 3. Should return the same (type of) object it received.
function absolutifyUrls(data, baseUrl) {
switch(typeof data){
case "string":
return data.replace(
/\b(href|src|action)=([\"\']?)(?!https?:\/\/)(\S+)\2/ig,
function au_repl(_, a, q, path)(
a + "=" + q + Utils.url({uri: path, base: baseUrl}).spec + q));
const Name = 'check-twitter',
Twitter = 'http://twitter.com/',
Icon = Twitter +'favicon.ico',
Base = <div class={Name}><style><![CDATA[
${position:relative}
$ol {list-style:none; margin:0}
$li {font-size:92%; line-height:1.2em}
$ol, $li {padding:0.2em 0}
$a img {border:none}
$button {font:bold 100% "Consolas",monospace; padding:0; border-width:1px}
@satyr
satyr / x
Created March 23, 2009 10:02 — forked from cers/x
CmdUtils.CreateCommand({
name: "example",
takes: {"search term": /.*/},
preview: function(pblock, input) {
CmdUtils.previewGet(pblock, "http://google.com/search", {q: input.text}, function(data){
pblock.innerHTML = data;
});
}
});
// ==UserScript==
// @name OperaStyle_menuAccessKey.uc.js
// @namespace http://d.hatena.ne.jp/Griever/
// @include main
// ==/UserScript==
var menuAccessKey = {
HINTKEYS : new String('abcdefghijklmnopqrstuvwxyz0123456789'),
init : function(){
window.addEventListener('popupshown', this, false);
// ==UserScript==
// @name Appjet Gist Sync
// @description Syncs Appjet publishing to Gist posting/updating
// @namespace http://d.hatena.ne.jp/murky-satyr
// @name$pace http://d.hatena.ne.jp/youpy/
// @include http://appjet.com/app/*/ide
// ==/UserScript==
if(top !== self) return;
const {URL} = document, [AppID] = /\d+/(URL);
@satyr
satyr / x
Created March 5, 2009 14:53 — forked from dhou/x
//Twitter search + Google search
//Migrated to Ubiquity from Greasemonkey script: http://userscripts.org/scripts/show/43451
//houyr@twitter
//function cmd_
function pageLoad_twitterSearchPlusGoogle(doc) {
var href = doc.location.href;
var q = (/^https?:\/\/(?:www\.)?google\..*\/.*[&?]q=([^&]*)(?:&|$)/(href)||0)[1];
if(!q) return;
var lang = (href.match(/[&?]hl=([^&]*)(?:&|$)/)) ? href.match(/[&?]hl=([^&]*)(?:&|$)/)[1] : 'en';
@satyr
satyr / vacuum-and-reindex.ubiq.js
Created March 1, 2009 14:53
Performs VACUUM and REINDEX on your Firefox storage.
const noun_storage_file = {
_name: 'storage_file',
suggest: function(txt, htm, cb, sx){
if(sx || !txt) return [];
return matchSuggs(this.list, txt);
},
list: (function({directoryEntries}, ls){
while(directoryEntries.hasMoreElements()){
var f = directoryEntries.getNext().QueryInterface(Ci.nsIFile);
if(f.exists() && f.isFile() && /\.sqlite$/.test(f.path)){
@satyr
satyr / undo-closed-tabs.ubiq.js
Created February 20, 2009 15:47
Reopens tabs you've closed recently.
const Name = 'undo-closed-tabs',
SS = Cc['@mozilla.org/browser/sessionstore;1'].getService(Ci.nsISessionStore),
Style = <style>{<><![CDATA[
@, @* {margin:0; padding:0}
@button {border-width:1px;
font:bold 112% "Consolas",monospace; vertical-align:top}
@li {list-style-type:none}
@img {width:16px; height:16px}
@span.url {display:inline-block; white-space:pre; font-size:88%}
@img, @span {vertical-align:middle}