Skip to content

Instantly share code, notes, and snippets.

// vim:set fdm=marker et sw=4 ts=4:
var INFO = //{{{
<plugin name="treeStyleTab" version="0.0.2"
href="http://github.com/caisui/vimperator/blob/master/plugin/treeStyleTab.js"
summary="Tree Stye Tab"
xmlns="http://vimperator.org/namespaces/liberator">
<author href="http://d.hatena.ne.jp/caisui">caisui</author>
<license href="http://www.opensource.org/licenses/bsd-license.php">New BSD License</license>
<project name="Vimperator" minVersion="2.0"/>
<item>
@caisui
caisui / hello.coffee
Created October 22, 2011 02:03
CoffeeScript で Command 追加
commands.addUserCommand ["hel[lo]"], "Coffee Script Command Sample",
([name])->liberator.echo "Hello #{name}",
{
argCount: "1",
completer: (context, args)->
context.completions = [
["CoffeeScript", "Description1"]
["Vimperator", "Description2"]
["ECMAScript", "Description3"]
]
@caisui
caisui / gist:1351332
Created November 9, 2011 12:45
vimperatorrc を here doc で 遅延
" plugin load 後実行
" Enter 後、:source 時は、遅延無しで実行
" here doc の ネスト 可能
:js <<END
{
let one= function (f1) liberator.registerObserver("enter", function f2() {f1(); liberator.unregisterObserver("enter", f2);});
let c = commands.addUserCommand(["lazy"], "lazy", function (args, extra) {
function f() {
io.source({
@caisui
caisui / _vimperatorrc
Created November 21, 2011 13:00
liberator-overlay-ext の 残骸
# mapping の 当て方
:js mappings.addUserMap([modes.COMMAND_LINE], ["<C-g>"], "toggle completions list", function () plugins.toggleFloatBox.toggleBox());
function a(...a) {
return a;
}
console.log(a(1,2,3));
//[1, 2, 3]
function b({a: [b,...c]}, ...d) {
return [c, d];
}
console.log(b({a:[1,2,3,4]},5,6,7,8,9));
var a = {
__noSuchMethod__: function () {c++;}
};
var e = [];
var c = 0;
for (var i = 0; i < 100; i++) {
try {
a.b();
} catch (ex) {
e.push([i, ex.message]);
@caisui
caisui / rc.py
Created May 8, 2012 14:49
percol's keymap
from types import FunctionType
def percol_specialkey_replace(fn):
def decofn(self, key):
if len(key) > 2 and key[0] == "<" and key[-1] == ">":
key = key[1:-1]
return fn(self, key)
return decofn
class ChainMap(object):
@caisui
caisui / service.js
Created June 17, 2012 07:41
compatible service.js
if (!services.services.pref) {
[
["appStartup", "startup"],
["browserSearch", "search"],
["directory", "dirsvc"],
["observer", "obs"],
["pref", "prefs"],
["subscriptLoader", "scriptloader"],
["windowMediator", "wm"],
["windowWatcher", "ww"],
content inspector-ext chrome/content/
override chrome://inspector/content/viewers/eventListeners/eventListeners.js chrome://inspector-ext/content/eventListeners.js
override chrome://inspector/content/viewers/eventListeners/eventListeners.xul chrome://inspector-ext/content/eventListeners.xul
override chrome://inspector/content/res/viewer-registry.rdf chrome://inspector-ext/content/viewer-registry.rdf
@caisui
caisui / realsize.js
Created June 28, 2012 11:05
指定サイズの矩形を MOW に 表示
commands.addUserCommand(["realsize"], "may be real size", function (args) {
var width, height;
if (args.length === 1)
width = height = args[0];
else {
width = args[0];
height = args[1];
}
if (args["-r"])
[width, height] = [height, width];