Skip to content

Instantly share code, notes, and snippets.

@satyr
satyr / bookmarkeys.uc.js
Created January 14, 2009 08:10
Allows accessing Bookmark Toolbar with alt/opt + 1~0.
// ==UserScript==
// @name BookmarKeys
// @namespace http://d.hatena.ne.jp/murky-satyr
// @description Allows accessing Bookmark Toolbar with alt/opt + 1~0.
// @include main
// @compatibility Firefox 3.0+
// @author satyr
// @version 09-12-01
// @note inspired by addons.mozilla.org/en-US/firefox/addon/3647
// ==/UserScript==
CmdUtils.CreateCommand({
name: "favicon-of-my-color",
takes: {'CSS color': noun_arb_text},
execute: function(inp){
var doc = CmdUtils.getDocument(), link = doc.createElement('link');
link.href = this._canvas(inp).toDataURL();
link.rel = 'shortcut icon';
doc.body.appendChild(link);
},
preview: function(pbl, inp){
@satyr
satyr / test2.js
Created January 23, 2009 10:08 — forked from Constellation/test2.js
<script>alert=0</script>
alert("test2");
/* appjet:version 0.1 */
http://validator.w3.org/feed/check.cgi?url=http%3A//d3adspace.appjet.net/3
import('storage', 'lib-at0m');
Top = 'http://mayokara.info/';
Dsp = Top +'deadspace/';
Myk = Atom.Person('mayokara', {uri: Dsp});
HTM = wget(Dsp);
htm = HTM.replace(/<!--[\s\S]+?-->/g, '')
cnt = +request.path.slice(1) || 7e7;
// ==UserScript==
// @name autoContentFocus
// @namespace http://d.hatena.ne.jp/murky-satyr
// @description Focuses the content whenever a tab is selected.
// @include main
// @compatibility Fx 3.0.*
// @version 2010-04-02
// ==/UserScript==
setTimeout(function(){
gBrowser.tabContainer.addEventListener('TabSelect', function(e){
// ==UserScript== for userChrome.js 0.8 (+ subscriptoverlayloader.js)
// @name TMP_BLURL4BML
// @namespace http://d.hatena.ne.jp/murky-satyr
// @description Fixes TabMixPlus so that "javascript:"s work as intended.
// @include main
// @compatibility Firefox 3.0~3.1b3 + Tab Mix Plus 0.3.7.4pre.090107
// @version 09-04-14
// ==/UserScript==
if(Application.prefs.getValue('extensions.tabmix.opentabfor.urlbar', 0))
setTimeout(function(){
@satyr
satyr / shell.ubiq.js
Created January 30, 2009 18:07
Runs shell commands.
CmdUtils.CreateCommand({
name: "shell",
icon: 'chrome://ubiquity/skin/icons/application_view_list.png',
takes: {command: noun_arb_text},
description: 'Runs shell command.',
execute: function(inp, mod){
var file = Cc['@mozilla.org/file/local;1'].createInstance(Ci.nsILocalFile),
proc = Cc['@mozilla.org/process/util;1'].createInstance(Ci.nsIProcess),
cmd = this._cmd(inp).split(/\s+/), [exe] = cmd, args = cmd.slice(1);
file.initWithPath(exe);
@satyr
satyr / findAmid.uc.js
Created February 3, 2009 16:14
Find Amid
/*==uc/==
@name Find Amid
@author satyr
@description Places the found item in the middle.
@include main
@include ~^chrome://global/content/view(?:Partial)?Source\.xul
@compatibility Firefox 3.5+
@version 2010-05-15
@original http://gist.github.com/346668
@original 8. of http://mayokara.info/deadspace/#d20090202
// ==UserScript==
// @name livedoor 4koma expander
// @namespace http://d.hatena.ne.jp/murky-satyr
// @description Expands each comic on http://4koma.livedoor.com
// @include http://4koma.livedoor.com/y1/member/*
// @include http://4koma.livedoor.com/creator/profile/*
// ==/UserScript==
const R = (/y1/.test(location)
? function(s, i) s.replace(/0(?=\.jpg)/, i)
: function(s, i) s.replace(/0s(?=\.jpg)/, i));
@satyr
satyr / bookmarklet.ubiq.js
Created February 7, 2009 09:24
Executes a bookmarklet from your favorites.
Components.utils.import('resource://gre/modules/utils.js');
const noun_type_b00kmarklet = {
_name: 'b00kmarklet',
suggest: function(txt, htm, cb, sx){
if(!txt) return [];
try { var matcher = RegExp(txt, 'i') }
catch(_){ matcher = {test: function(x) ~x.indexOf(txt)} }
return [{data: b.uri, summary: b.title}
for each(b in this.list) if(matcher.test(b.title))];
},