Skip to content

Instantly share code, notes, and snippets.

(function($,templateStr){
var MiniTemplate = function(template){
this.template = eval(['([\'',template.replace(/\$\{([^${}]+)\}/g,'\',{key:\'$1\'},\''),'\'])'].join(''));
};
MiniTemplate.prototype.merge = function(context){
var template = this.template || [];
var temp = [];
for(var i = 0; i < template.length; i++){
if(typeof template[i] == 'string'){
temp.push(template[i]);
/*
* join function for Java
*
* example
* List<String> list = new ArrayList<String>();
* list.add("hogehoge");
* list.add("fugafuga");
* list.add("piyopiyo");
* join(list,"&");// hogehoge&fugafuga&piyopiyo
*
var MiniTemplate = function(template){
this.template = eval(['([\'',template.replace(/\$\{([^${}]+)\}/g,'\',{key:\'$1\'},\''),'\'])'].join(''));
};
MiniTemplate.prototype.merge = function(context){
var template = this.template || [];
var temp = [];
for(var i = 0; i < template.length; i++){
if(typeof template[i] == 'string'){
temp.push(template[i]);
}else if(typeof template[i] == 'object' && typeof template[i]['key'] == 'string'){
/*
* Brainf**k in JavaScript1.6
*/
function Cell(memory){
this._memory = memory || [];
if(!this._memory.length){
this._memory.push(this);
}
};
Cell.prototype._memory;
// ==UserScript==
// @name LDR + ?B comments for Firefox3
// @namespace http://d.hatena.ne.jp/monjudoh/
// @include http://reader.livedoor.com/reader/*
// ==/UserScript==
(function () {
var regex = [
[/\?ref=rss$/, ''],
[/&amp;from=rss$/, ''],
//本体
Twittelien = {};
Twittelien.entryFilters = {};
Twittelien.template = {};
Twittelien.classes = {};
(function($){
function TableUpdator(params){
this._parseRules = params['parseRules'] || {};
this._table = params['table'] || new TAFFY([]);
// ==UserScript==
// @name pixiv add-bookmark
// @namespace http://d.hatena.ne.jp/monjudoh/
// @include http://www.pixiv.net/member_illust.php?mode=medium&illust_id=*
// @require http://ajax.googleapis.com/ajax/libs/jquery/1.2/jquery.js
// @require http://ajax.googleapis.com/ajax/libs/jqueryui/1.5.3/jquery-ui.js
// @require http://gist.github.com/raw/17960/35b4defa324ed39e2891dda8304db941058ed031?taffy-1.6.1.js
// @require http://jqueryjs.googlecode.com/svn/trunk/plugins/form/jquery.form.js
// @resource flora http://jquery-ui.googlecode.com/svn/tags/1.6rc2/themes/flora/flora.css
// @resource floraDialog http://jquery-ui.googlecode.com/svn/tags/1.6rc2/themes/flora/flora.dialog.css
// Twitterタイムラインまとめ用script
// まとめる対象を「もっと読む」ボタンなどで全て表示させてから実行すること
// Firebug前提(copy関数)
// JavaScript1.8前提(式クロージャ)
// jQueryロード済み前提(TwitterのWebページならロード済みのはず)
copy(
$('#timeline>li.hentry')
.get()
.reverse()
.map(function(n,i)
(function($){
if(typeof DOMParser === 'undefined')return;
var _httpData = $.httpData;
$.httpData = function( xhr, type, s ) {
var ct = xhr.getResponseHeader("content-type"),
xml = type == "xml" || !type && ct && ct.indexOf("xml") >= 0,
data = xml ? xhr.responseXML : xhr.responseText;
if(!xml || data){
return _httpData( xhr, type, s );
}
// http://d.hatena.ne.jp/Gimite/20091129/1259495440
if(typeof JSON !== 'undefined' && typeof Object.toJSON === 'function'){
JSON.stringify = function(obj){
return Object.toJSON(obj);
}
}