Skip to content

Instantly share code, notes, and snippets.

View teramako's full-sized avatar

teramako teramako

View GitHub Profile
let INFO =
<plugin name="jetpackHack" version="1.0"
href="http://svn.coderepos.org/share/lang/javascript/vimperator-plugins/trunk/jetpackHack.js"
summary="enable to access to Jetpack inner context"
xmlns="http://vimperator.org/namespaces/liberator">
<author email="teramako@gmail.com">teramako</author>
<license>BSD</license>
<project name="Vimperator" minVersion="2.2"/>
<p>Example: list executing Jetpack feature</p>
<code>
@teramako
teramako / dealCards.js
Created December 16, 2009 03:29
カード配り(10分プログラミング)
//テーマはvar, letを使わないこと
(function(n,c)
c.substr(0,c.length-c.length%n).split("").reduce(
function(p,c,i){
p[i%n]+=c;
return p;
},
Array.apply("",Array(n)).map(function()"")
).toSource()
)(4,"111122233445a")
var root = io.File("~/hoge");
var target = io.File("~/var");
var path="";
while (root.parent){
print(root.path);
if (target.path.indexOf(root.path) == 0){
break;
}
root = root.parent;
@teramako
teramako / tumblrDashboardSetPublicLink.user.js
Created January 10, 2010 12:54
Tumblrダッシュボードの各エントリに公開URLをつけるUserScript
@teramako
teramako / xpath_test.js
Created January 20, 2010 11:37
Jetpack Feature: test XPath
jetpack.future.import("slideBar");
let NS = {
xhtml: "http://www.w3.org/1999/xhtml",
xul: "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul",
};
function nsResolver(prefix){
return NS[prefix] || null;
}
function evaluate(xpath, elm){
@teramako
teramako / jetpack.txt
Created January 21, 2010 10:52 — forked from azu/jetpack.txt
azu さんのjetpackに関するメモに返信
// http://gyazo.com/39e1c43d0529375b589843b9e20d26ed.png
- Jetpack
- Jetpackの制限
可能かどうか
- ショートカットキー
グローバルなショートカットキーのフックは可能?
Documentのイベントリスナーで実装する場合、画像ページでもショートカットキーは有効?
@teramako
teramako / jetpack-memo.md
Created January 28, 2010 05:22
reboot/jetpack に関するメモ

Labs/Jetpack/Reboot に関してメモ

  • main.js には Components は使えない
    Error: Permission denied for moz-nullprincipal:{8d6c05eb-fc08-436a-adaa-f440a732c337} to get property XPCComponents.classes
  • まだ全容がつかめない

About manifest.json

{

gist でブログ案

  • markdownが使える
    • ファイル名を *.md にすればOK
  • コードも別ファイル(Add anothor file)として書けば綺麗なシンタックスハイライト可
    • ついでにダウンロードも可能 (UserScriptの配布とかにもってこい!)
  • 変更履歴も自動で付く! (gitだから当たり前か)
  • fork で簡単リログ!
@teramako
teramako / twitterDisableIcon.user.js
Created February 3, 2010 11:15
twitterTL上のiconを消すuserScript
// ==UserScript==
// @name twitter disable icon
// @namespace http://d.hatena.ne.jp/teramako
// @description dont display user icon
// @include http://twitter.com/*
// ==/UserScript==
function insertRule(selector, declarations){
var sheets = document.styleSheets;
var lastSheet = sheets[sheets.length-1];
function Hoge(){
if (this instanceof arguments.callee){
return this;
}
return new arguments.callee;
}
Hoge.prototype = {
foo: "foo",
bar: "bar"
};