Skip to content

Instantly share code, notes, and snippets.

// ==UserScript==
// @name translator
// @namespace http://d.hatena.ne.jp/youpy/
// @include *
// @require http://github.com/cho45/jsdeferred/raw/master/jsdeferred.userscript.js
// ==/UserScript==
var div = document.createElement('div');
div.className = 'gm_translator';
window.addEventListener("mouseup", translate, false);
#!/usr/bin/env ruby
# Usage: ./translator.rb -t yi あれ、今日日食?
require 'ubygems'
require 'grope'
require 'optparse'
@env = Grope::Env.new
@env.load 'http://translate.google.com/'
#!/usr/bin/env ruby
require 'ubygems'
require 'grope'
env = Grope::Env.new
env.load 'http://translate.google.com/'
env.eval('return Grope').
mousedown(env.document.getElementById('old_sl'))
diff --git a/xpi/chrome/content/library/01_utility.js b/xpi/chrome/content/library/01_utility.js
index 412bddf..78742da 100755
--- a/xpi/chrome/content/library/01_utility.js
+++ b/xpi/chrome/content/library/01_utility.js
@@ -158,7 +158,7 @@ function input(form, title){
}
var vals = values(form);
- var method = (vals[0] == null && typeof(vals[1]) == 'boolean')? 'confirmCheck' : 'prompt';
+ var method = (vals[0] == null && typeof(vals[1].value) == 'boolean')? 'confirmCheck' : 'prompt';
TextConversionServices.getServices().addCallback(function(services){
var menus = [];
services.forEach(function(service){
var name = service.getMetaInfo().name;
menus.push({
name : name,
execute : function(ctx){
return TextConversionServices.convert(ctx.target.value, name).addCallback(function(res){
ctx.target.value = res;
});
// ==UserScript==
// @name disable disturbing animation
// @namespace http://d.hatena.ne.jp/youpy/
// @include http://exonemo.com/view-source/Q.html
// @include http://exonemo.com/qa2b/q/
// ==/UserScript==
unsafeWindow.startDisturb = function() {};
require 'ubygems'
require 'grope'
sourcetext = ARGV.shift || 'Hello!'
env = Grope::Env.new
env.load('http://gyu.que.jp/private/jsfsk/')
env.find('id("sourcetext")').value = sourcetext
env.find('id("startbutton")').click
env.wait(10) # xxx
require 'ubygems'
require 'open-uri'
urls = %w(
http://ns2.aomori.isp.ntt-east.co.jp:60001/-wvhttp-01-/
http://60.36.161.224:60002/-wvhttp-01-/
http://ns2.aomori.isp.ntt-east.co.jp:60037/-wvhttp-01-/
http://60.36.161.224:60018/-wvhttp-01-/
http://ns2.aomori.isp.ntt-east.co.jp:60003/-wvhttp-01-/
http://60.36.161.224:60004/-wvhttp-01-/
// ==UserScript==
// @name tweets_filter
// @namespace http://www.relucks.org/
// @include http://twitter.com/
// ==/UserScript==
var re = /(4sq.com|htn.to|tou.ch|shindanmaker.com)/
// var re = /(4sq.com|#example)/
filter(document)
#!/usr/bin/env ruby
# http://buycheapviagraonlinenow.com/
require 'webrick'
require 'webrick/httpproxy'
handler = Proc.new() do |req,res|
if content = res.header['x-true-content']
res['cache-control'] = 'no-cache'
res.body = content