Skip to content

Instantly share code, notes, and snippets.

View teramako's full-sized avatar

teramako teramako

View GitHub Profile
/**
* @description GitHub JavaScript API
* @author teramako teramako@gmail.com
* @license MIT
* @see http://develop.github.com/
*/
var GITHUB;
(function(){
//#!/usr/lib/xulrunner/xpcshell -f
/*
const Cc = Components.classes;
const Ci = Components.interfaces;
*/
liberator.plugins.telnetd = (function(){
const cs = Cc["@mozilla.org/consoleservice;1"].getService(Ci.nsIConsoleService);
#!/usr/lib/xulrunner/xpcshell
const USAGE = <><![CDATA[
XULRunner付属のxpcshellで動くJavaScript
引数のURLのHTML文字列を取得しパースして、再度文字列化して出力するもの
Usage: xpcshell curl.js URL
]]></>.toString();
// ==UserScript==
// @name twittager
// @namespace http://twitter.com/teramako/
// @include http://twitter.com/*
// @include https://twitter.com/*
// ==/UserScript==
(function(){
const twittagerNS = new Namespace("http://twittag.r-definition.com/");
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のイベントリスナーで実装する場合、画像ページでもショートカットキーは有効?