Skip to content

Instantly share code, notes, and snippets.

@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';
function cmd_
@satyr
satyr / gist:74384
Created March 5, 2009 15:28
CreateCommand(
CreateCommand(
if $*.empty?
puts "usage: #$0 commands1 [, commands2, ...]"
exit 1
end
$*.each do |file|
@cmd = "file:///#{file.tr ?\\, ?/}"
@apd = `echo %appdata%`.strip.tr ?\\, ?/
@dbf = Dir.glob("#@apd/Mozilla/Firefox/Profiles/*/ubiquity_ann.sqlite").first
@stt = 'insert or replace into ubiquity_annotation_memory'
@satyr
satyr / subscribe-locally.ubiq.js
Created March 7, 2009 02:07
Directly subscribes to commands in your local files.
CmdUtils.CreateCommand({
name: 'subscribe locally',
icon: 'chrome://ubiquity/skin/icons/favicon.ico',
description: 'Directly subscribes to local command/skin feeds.',
help: ('Execute to open the file picker. '+
'You can select multiple files with it.'),
homepage: 'http://d.hatena.ne.jp/murky-satyr/20090308/subscribe_locally',
author: 'satyr', license: 'MIT',
execute: function sl_execute(){
const {nsIFilePicker, nsIFile} = Ci;
function cmd_scrapeGooglesMetas(){
var domains = (<>dk se co.nz ca cn com.pr fi co.in co.uk lv co.hu lk com.au
ru nl be de ro kz by no pl pt com.br vc co.za tm com.my bg
co.jp ie com.mx com.om fr mu com.ph com.jm</>).match(/\S+/g),
tab = Application.activeWindow.open(Utils.url('data:text/html,'));
tab.events.addListener('load', function(){
var {document} = tab;
domains.forEach(function(dm){
Utils.parseRemoteDocument('http://google.'+ dm, null, function(doc){
var params = (jQuery('input[name="meta"][id!="all"]', doc)
const Name = 'lleval',
Icon = 'http://www.dan.co.jp/favicon.ico',
Langs = [CmdUtils.makeSugg(name, null, ext) for each([name, ext] in Iterator({
Perl: 'pl',
Ruby: 'rb',
Python: 'py',
JavaScript: 'js',
Gosh: 'scm',
PHP: 'php',
Perl6: 'perl6',
XML.prettyPrinting = XML.ignoreWhitespace = false;
const
Name = 'bijin-tokei',
BT = 'http://www.bijint.com',
Base = [<div class={Name +' root'}
><div class="acts"
><input type="button" id="copy" accesskey="c" disabled="disabled" value="Copy"
/><input type="button" id="open" accesskey="o" disabled="disabled" value="Open"
/></div
><div id={Name} class="content"> </div
@satyr
satyr / dicts.ubiq.js
Created March 14, 2009 01:46
simple dictionary commands
const
DY = 'http://dic.search.yahoo.co.jp/',
TR = 'http://thesaurus.reference.com/',
MW = 'http://www.merriam-webster.com/',
UD = 'http://www.urbandictionary.com/',
WK = 'http://en.wiktionary.org/',
CSS = '\
body {line-height:1.35}\
ul, ol {margin:0 0 0.5em; padding-left:2em}\
a img {border:none}\
@satyr
satyr / hit@hint.ubiq.user.js
Created March 16, 2009 12:11
yet another Hit-a-Hint implementation
// ==UserScript== function cmd_
// @name hit@hint
// @description pseudo Hit-a-Hint for Ubiquity/Greasemonkey
// @namespace http://d.hatena.ne.jp/murky-satyr
// @include *
// ==/UserScript==
function pageLoad_HatH(doc, win){ if((win = doc.defaultView) === win.top){{}
HatH(win, doc, {
key: 'asdfghjkl',
bind: {