Skip to content

Instantly share code, notes, and snippets.

@Yasushi
Yasushi / eijiro.js
Created August 29, 2008 07:31
英辞郎 on the WEB for ubiquity
CmdUtils.CreateCommand({
names: ["eijiro"],
icon: "http://www.alc.co.jp/favicon.ico",
author: {name: "Yasushi Abe", email: "[email protected]"},
arguments: {"object search term": noun_arb_text},
preview: function(pblock, args) {
var {text, html} = args.object;
if (!text) {
pblock.innerHTML = "Searches eijiro for your words.";
return;
@Yasushi
Yasushi / gist:8281
Created September 1, 2008 07:16
StGIT completion function
#compdef stg
__stg_command_successful () {
if (( ${#pipestatus:#0} > 0 )); then
_message 'not a stg branch or git repository'
return 1
fi
return 0
}
CmdUtils.CreateCommand({
name: "excite-en-ja",
icon: "http://image.excite.co.jp/jp/favicon/lep.ico",
homepage: "http://www.excite.co.jp/world/english/",
description: "translate",
takes: {"input": noun_arb_text},
preview: function( pblock, input ) {
if(input.text.length == 0) {
pblock.innerHTML = "Performs a search";
return;
CmdUtils.CreateCommand({
name: "download-youtube",
description: "Download YouTube FLV",
icon: "http://s.ytimg.com/yt/favicon-vfl1123.ico",
_is_video: function(doc) {
var uri = Utils.url(doc.documentURI);
return(uri.host.indexOf("youtube.com") != -1 && uri.path.match("[?&]v=([^&]+)"));
},
_video_id: function(doc) {
var uri = Utils.url(doc.documentURI);
@Yasushi
Yasushi / gist:11541
Created September 19, 2008 04:48
undefined
CmdUtils.CreateCommand({
name: "goodic",
icon: "http://dictionary.goo.ne.jp/favicon.ico",
homepage: "http://dictionary.goo.ne.jp/",
description: "Searches <a href=\"http://dictionary.goo.ne.jp/\">goo 辞書</a> for your words.",
takes: {"search term": noun_arb_text},
_url: function(word) {
if(word.length == 0) {
return;
}
/**
* flvdl - FLV downloader.
* This is fork of
* http://gist.github.com/53229
*/
+function(flvdl_siteinfo){
CmdUtils.CreateCommand({
name: "flvdl",
description: "FLV Downloader.",
icon: "chrome://ubiquity/skin/icons/favicon.ico",
#!/usr/bin/ruby
require 'win32/registry'
Win32::Registry::HKEY_CURRENT_USER.open('Software\SimonTatham\PuTTY\Sessions') do |reg|
reg.each_key do |skname, wt|
reg.open(skname, Win32::Registry::KEY_READ|Win32::Registry::KEY_WRITE) do |sk|
puts "#{sk.keyname} BCE #{sk.read_i('BCE')}"
sk.write_i('BCE',1)
end
end
/**
* The LDOCE Online Dictionary.
*/
+function(){
const $j = jQuery;
const LDOCE_QUERY_URL = {
def: "http://www.ldoceonline.com",
html: "http://www.ldoceonline.com/search/?q="
};
const LDOCE_RENDER = function(pb, prm){
@Yasushi
Yasushi / pom.xml
Created February 17, 2009 08:43
maven で cucumber を使う
<!--
http://binil.wordpress.com/2008/10/29/running-cucumber-on-jrubymaven/
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>test</groupId>
<artifactId>cucumbertest</artifactId>
<version>1.0</version>
<dependencies>
<dependency>
<?
echo '<pre>';
echo shell_exec("top -bn1");
echo '</pre>';
?>