Skip to content

Instantly share code, notes, and snippets.

// Jetpack Feature : disable-hatena-keyword.js
// はてなダイアリー (http://d.hatena.ne.jp/) の
// キーワードを無効化する
jetpack.tabs.onReady(function(targetDocument) {
if (targetDocument.defaultView.frameElement) {
return;
}
if (targetDocument.location.href.search(/^http:\/\/d.hatena.ne.jp\//) !== -1) {
// Jetpack feature : log-url.js
// ページを開いたらそのページの URL をログ表示する
jetpack.tabs.onReady(function(targetDocument) {
// frame, ifreme の場合は何もしない
if (targetDocument.defaultView.frameElement) {
return;
}
console.log(targetDocument.location.href);
// Jetpack feature : disable-hatena-keyword-pageMods.js
// はてなダイアリー (http://d.hatena.ne.jp/) のキーワードを無効化する
// pageMods を使用するバージョン
jetpack.future.import("pageMods");
var callback = function(targetDocument) {
$(targetDocument).find("a.keyword").each(function() {
$(this).replaceWith($(this).html());
});
};
// jetpack feature : info.js
// info ボタンを押すと選択部分を Google で検索し、
// 検索件数を alert する
jetpack.statusBar.append({
html: "<button>info</button>",
width: 60,
onReady: function(widget) {
$(widget).click(function() {
var word = jetpack.tabs.focused.contentWindow.getSelection();
// Jetpack Feature : hello-jetpack.js
// ページを開いたら通知する
jetpack.tabs.onReady(function() {
jetpack.notifications.show("Hello Jetpack!");
});
// Jetpack Feature : hello-statusbar.js
// ステータスバーのラベルをクリックすると通知する
jetpack.statusBar.append({
html: "Hello",
width: 45,
onReady: function(widget){
$(widget).click(function() {
jetpack.notifications.show("Hello Jetpack!");
});
@mollifier
mollifier / twitterlist.js
Created December 17, 2009 12:29
Jetpack Feature to search tweet in slidebar
// twitterlist.js
// Jetpack Feature to search tweet in slidebar
jetpack.future.import("slideBar");
jetpack.slideBar.append({
icon: "http://a1.twimg.com/a/1260817727/images/favicon.ico",
html: "<h1>Twitter List</h1>" +
"<form>" +
"keyword : <input type='text' id='keyword' value=''></input>" +
@mollifier
mollifier / gist:442344
Created June 17, 2010 16:19
jQuery Text Change Event plugin demo
// twitter incremental search
// jQuery Text Change Event plugin demo
//
// requires
// jQuery 1.4.2
// http://jquery.com/
// jQuery Text Change Event plugin
// http://www.zurb.com/playground/jquery-text-change-custom-event
$(function() {
// ==UserScript==
// @name twitter-average-length2
// @namespace http://www.hatena.ne.jp/mollifier
// @include http://twitter.com/*
// @include https://twitter.com/*
// ==/UserScript==
// Fork of twitter-average-length.user.js (http://gist.github.com/402749)
// original author is hitode909 (http://gist.github.com/hitode909)
// 日付文字列のパース処理に eval を使用しないように変更
@mollifier
mollifier / file0.sh
Created December 11, 2012 00:08
zsh の vcs\_info に独自の処理を追加して stash 数とか push していない件数とか何でも表示する ref: http://qiita.com/items/8d5a627d773758dd8078
# vcs_info 設定
RPROMPT=""
autoload -Uz vcs_info
autoload -Uz add-zsh-hook
autoload -Uz is-at-least
autoload -Uz colors
# 以下の3つのメッセージをエクスポートする