This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Class(sup, pro) { | |
if (sup && typeof sup === 'object') | |
pro = sup, sup = Object; | |
var con = Object.getOwnPropertyDescriptor(pro, 'constructor'); | |
if (!con) | |
con = {value: Function(), writable: true, configurable: true}; | |
if (con.configurable) { | |
con.enumerable = false; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function inherit(sub, sup) { | |
var c = Function(); | |
c.prototype = sup.prototype; | |
var fn = new c; | |
fn.constructor = sub; | |
sub.prototype = fn; | |
sub.superclass = sup; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* @require Prototype.js | |
var src = new WaveFile(properties).toDataURI(); | |
// properties は WaveFile.prototype を参考に。 | |
*/ | |
Object.extend(Number.prototype, { | |
toLEArray: function toLEArray(length) { | |
var num = this | 0, length = +length, result = []; | |
if (0 < arguments.length && !length) return result; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[p for(p in Iterator(#1={ | |
0: +'', | |
1: -~'', | |
2: -~-~'', | |
3: -~-~-~'', | |
4: -~-~-~-~'', | |
5: -~-~-~-~-~'', | |
6: '$$$$$$'[~''], | |
7: '$$$$$$$'[~''], | |
8: -~''<<-~-~-~'', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// できないこと | |
// ・演算子(/, /=) の後ろにあるコメントを除去できない | |
// ・演算子(/, /=) の後ろにある正規表現リテラルを無視できない | |
// ・<xml>{0/*消えて*/}/*消えないで*/</xml> | |
function trimComment(str) { | |
// コメント___________________ 文字列リテラル(")_______ 文字列リテラル(')_______ CDATA セクション________ 正規表現リテラル___________________________ | |
return str.replace(/(\/)(?:\*[\s\S]*?\*\/|\/.*)|"(?:\\[\s\S]|[^\\\n"])*"|'(?:\\[\s\S]|[^\\\n'])*'|<!\[CDATA\[[\s\S]*?\]\]>|\/(?:\\.|\[(?:\\.|[^\n\]])*\]|[^\n/])+\/\w*/g, function($0, $1) { | |
return $1 ? '' : $0; | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name lastModifiedPanel.uc.js | |
// @description adds toolbaritem that indicates Last-Modified. | |
// @include main | |
// @compatibility Firefox 4.0+ | |
// @namespace http://twitter.com/xulapp | |
// @author xulapp | |
// @license MIT License | |
// @version 2011/04/03 19:00 +09:00 addon-bar | |
// ==/UserScript== |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name showFxVersionInTitlebar.uc.js | |
// @description the version number is displayed behind "Mozilla Firefox". | |
// @include main | |
// @compatibility Firefox 3.5+ | |
// @namespace http://twitter.com/xulapp | |
// @author xulapp | |
// @license MIT License | |
// @version 2010/03/31 18:00 +09:00 | |
// ==/UserScript== |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name showTabsCountInTitlebar.uc.js | |
// @description the tabs count is displayed in the end of the title string. | |
// @include main | |
// @compatibility Firefox 3.5+ | |
// @namespace http://twitter.com/xulapp | |
// @author xulapp | |
// @license MIT License | |
// @version 2011/04/03 15:40 +09:00 | |
// ==/UserScript== |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Prediction(level) { | |
this.level = +level || 5; | |
this.history = ''; | |
this.recent = ''; | |
this.accum = {}; | |
this.tokens = {}; | |
} | |
Prediction.prototype.add = function add(c) { | |
c = ('' + c).charAt(0); | |
this.tokens[c] = true; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name altTooltip.uc.js | |
// @description title がなければ alt を出す | |
// @include main | |
// @compatibility Firefox 3.5+ | |
// @namespace http://twitter.com/xulapp | |
// @author xulapp | |
// @license MIT License | |
// @version 2010/04/01 21:00 +09:00 | |
// ==/UserScript== |