- Tatsuhiro Ujihisa
- http://ujihisa.blogspot.com/
- 非同期とは?
- スレッド、プロセス
- プロセス生成
// ==UserScript== | |
// @name gist logs | |
// @namespace http://d.hatena.ne.jp/murky-satyr | |
// @description Shows commit logs on Gist. | |
// @include https://gist.github.com/* | |
// @license WTFPL | |
// ==/UserScript== | |
Array.forEach(document.querySelectorAll('#revisions .id'), function(a){ | |
GM_xmlhttpRequest({ | |
method: 'get', url: 'https://raw.github.com/gist'+ a.pathname +'/meta', |
// XPath 式中の接頭辞のない名前テストに接頭辞 prefix を追加する | |
// e.g. '//body[@class = "foo"]/p' -> '//prefix:body[@class = "foo"]/prefix:p' | |
// http://nanto.asablo.jp/blog/2008/12/11/4003371 | |
function addDefaultPrefix(xpath, prefix) { | |
var tokenPattern = /([A-Za-z_\u00c0-\ufffd][\w\-.\u00b7-\ufffd]*|\*)\s*(::?|\()?|(".*?"|'.*?'|\d+(?:\.\d*)?|\.(?:\.|\d+)?|[\)\]])|(\/\/?|!=|[<>]=?|[\(\[|,=+-])|([@$])/g; | |
var TERM = 1, OPERATOR = 2, MODIFIER = 3; | |
var tokenType = OPERATOR; | |
prefix += ':'; | |
function replacer(token, identifier, suffix, term, operator, modifier) { | |
if (suffix) { |
// ==UserScript== | |
// @name check-userjs | |
// @namespace http://www.hatena.ne.jp/hitode909 | |
// @include http://* | |
// @include https://* | |
// ==/UserScript== | |
var anchors = document.querySelectorAll('a[href$=".js"]'); | |
for (var i = 0, len = anchors.length; i < len; i++) { |
// Original code by Constellation | |
// http://d.hatena.ne.jp/Constellation/20100203/1265207970 | |
function convertToHTMLString(source, safe) { | |
if (!source || (source.getRangeAt && source.isCollapsed)) return ''; | |
var range = source.getRangeAt ? source.getRangeAt(0) : null; | |
var node = range ? range.cloneContents() : source.cloneNode(true); | |
if (safe) { | |
var root = range && range.commonAncestorContainer.cloneNode(false) | |
if (!root || root.nodeType !== root.ELEMENT_NODE) |
// ==UserScript== | |
// @name kurukuruwindow | |
// @namespace http://www.hatena.ne.jp/hitode909 | |
// @include * | |
// ==/UserScript== | |
(function() { | |
try { if (window != window.parent) return } catch(e) { return }; | |
var lowPass = { x: 0.0, y: 0.0, z: 0.0 }; |
# リポジトリのトップレベルにcd | |
function u() | |
{ | |
cd ./$(git rev-parse --show-cdup) | |
} |
// ==UserScript== | |
// @name Hatena::Star Waste Color Star | |
// @namespace http://lowreal.net/ | |
// @include * | |
// @require http://github.com/cho45/jsdeferred/raw/master/jsdeferred.userscript.js | |
// ==/UserScript== | |
// | |
(function () { with (D()) { | |
setTimeout(function () { |
// http://gist.github.com/raw/315047/e07932e73fb928365425f13bd7376a43b8433071/patchworkinput.txt を開いた状態で、Chromeのコンソールで実行 | |
// かなり無駄を省きました… 速度はV8 2.1.0.1 で Quad Core 2.66GHzで360msくらい | |
//* この行の先頭の/で使用するデータ切り替えます | |
var text=[ | |
'ABAAAABBBA', | |
'ABABABABBB', | |
'BABBBAABBA', | |
'ABBABBBBBB', | |
'BBABABAAAB', |