This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==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== |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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'], |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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)); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | |
}); | |
} | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==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); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//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'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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)){ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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} |