Skip to content

Instantly share code, notes, and snippets.

@t-f-m
t-f-m / thread_sample.patch
Created March 8, 2012 02:44
http://www.kmonos.net/alang/boost/classes/thread.html のsampleからboost::ref依存を追い出す
--- test_urger_thread_old.cpp 2012-03-08 11:42:42.570478359 +0900
+++ test_urger_thread.cpp 2012-03-08 11:43:04.921728796 +0900
@@ -1,6 +1,5 @@
#include <iostream>
#include <string>
-#include <boost/ref.hpp>
#include <boost/thread.hpp>
using namespace std;
@@ -15,7 +14,7 @@
@t-f-m
t-f-m / nitenddo_president_interviewer_with_autopagerize.user.js
Created November 20, 2011 22:58
「社長が訊く」をAutoPagerizeで読んだときの2ページ目以降の文字欠けを何とかする
// ==UserScript==
// @name Nintendo president interviwer with autopagerize
// @namespace http://d.hatena.ne.jp/t_f_m/
// @description 「社長が訊く」内の文字欠けを何とかする
// @include http://www.nintendo.co.jp/*/interview/*
// ==/UserScript==
function boot(){
window.AutoPagerize = window.AutoPagerize || sharedObject.AutoPagerize;
//sharedObjectによる一部オブジェクト共有
//グリモン版を使う場合細工済みのもののみ可
@t-f-m
t-f-m / ldrize.user.js.patch
Created September 11, 2011 06:50
LDRizeの#gm_ldrize_pinlistの横幅を制限
diff --git a/LDRize.user.js b/LDRizeB.user.js
index 2ba446f..aae6571 100644
--- a/LDRize.user.js
+++ b/LDRizeB.user.js
@@ -345,6 +345,7 @@ LDRize.prototype = {
if(CSS_HIGHLIGHT_LINK) css += "\n.gm_ldrize_link {" + CSS_HIGHLIGHT_LINK + "}";
if(CSS_HIGHLIGHT_PINNED) css += "\n.gm_ldrize_pinned {" + CSS_HIGHLIGHT_PINNED + "}";
css += ".gm_ldrize_iframe { min-height:200px; position:fixed; bottom:0px; left:0px; right:0px; }";
+ css += "#gm_ldrize_pinlist { max-width:300px; }";
return css;
@t-f-m
t-f-m / ldrize.user.js.patch
Created September 11, 2011 06:49
LDRizeのindicator表示位置バグ修正
diff --git a/LDRize_original.user.js b/LDRize.user.js
index c791643..2ba446f 100644
--- a/LDRize_original.user.js
+++ b/LDRize.user.js
@@ -437,7 +437,7 @@ LDRize.prototype = {
if(!p)return;
var i=this.img.indicator;
i.style.display = 'block';
- i.style.top = (p.y+this.getScrollHeight()-DEFAULT_HEIGHT) + 'px';
+ i.style.top = (p.y+this.scrollHeight) + 'px';
@t-f-m
t-f-m / gist:893182
Created March 29, 2011 20:29
XPathの動作確認
<html>
<head>
<script>
//utilities via AutoPagerize
function getElementsByXPath(xpath, node) {
var nodesSnapshot = getXPathResult(xpath, node,
XPathResult.ORDERED_NODE_SNAPSHOT_TYPE)
var data = []
for (var i = 0; i < nodesSnapshot.snapshotLength; i++) {
data.push(nodesSnapshot.snapshotItem(i))