This file contains 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
// DOM要素を結合する。引数はScalaのmkString風 | |
Array.prototype.joinDOM = function() { | |
var [sep, head, tail] = [null, null, null], | |
arg = Array.map(arguments, convertToDOM); | |
switch(arg.length) { | |
case 0: break; | |
case 1: [sep] = arg; break; | |
case 3: [head, sep, tail] = arg; break; | |
default: throw new Error('invalid arguments'); |
This file contains 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 ssh-start() { | |
eval `/usr/local/bin/ssh-start` | |
} | |
[ -e "${HOME}/.ssh/agent-env" ] && . "${HOME}/.ssh/agent-env" |
This file contains 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
var Combinator = function(fun) { | |
if (typeof fun === 'function') | |
this.parse = fun; | |
}; | |
Combinator.define = function(fun) { | |
var c = new this(); | |
fun.call(c); | |
return c; | |
}; | |
Combinator._rjoin = function(fun) { |
This file contains 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
default xml namespace = "http://www.w3.org/1999/xhtml"; | |
(function() { | |
var parser = new DOMParser(), | |
range = document.createRange(); | |
function toDOM(xmlns) { | |
var pretty = XML.prettyPrinting; | |
// disable prettyPringing temporary to avoid extra space inclusion | |
XML.prettyPrinting = false; |
This file contains 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 nicovideo_createPanel(id, labelText) { | |
let panelID = 'itab_' + id; | |
let label = document.createElement('a'); | |
label.href = '#' + panelID; | |
label.innerHTML = '<div>' + labelText + '</div>'; | |
// remove extra <a>...</a> | |
label.firstChild.textContent = labelText; | |
document.querySelector('#itab td').appendChild(label); |
This file contains 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 ssh-start() { | |
ssh-agent -s > "${HOME}/.ssh/agent-env" | |
. "${HOME}/.ssh/agent-env" | |
ssh-add | |
} | |
if [ -e "${HOME}/.ssh/agent-env" ]; then | |
isAliveAgent=`ps -ef | grep "/ssh-agent" | grep -v grep | wc -l` | |
if [ $isAliveAgent = 1 ]; then | |
echo "ssh-agent is alive" |
This file contains 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() { | |
const NAMESPACE = 'mfp.xrea.jp'; | |
if (!(NAMESPACE in window)) | |
window[NAMESPACE] = {}; | |
if (window[NAMESPACE].DataGrid !== undefined) | |
return; | |
const DataGrid = function(property, namePrefix) { | |
this._property = new DataGrid.Property(property); | |
this._namePrefix = namePrefix || ''; |
This file contains 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
Data = { | |
count: Integer, // タグの個数 | |
first: Date, // タグ情報を最初に取得した日時 | |
last: Date, // タグ情報を最後に取得した日時 | |
tags: [Tag] // タグ情報の配列 | |
}; | |
Tag = { | |
id: Integer, // タグのID | |
name: String, // タグ名 |
This file contains 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() { | |
const NAMESPACE = 'mfp.xrea.jp'; | |
if (!(NAMESPACE in window)) | |
window[NAMESPACE] = {}; | |
if (window[NAMESPACE].Pager !== undefined) | |
return; | |
const Pager = function(namePrefix) { | |
this._namePrefix = namePrefix; | |
this._callbacks = []; |
This file contains 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 gunosy redirect | |
// @namespace gifnksm.hatenablog.jp | |
// @include https://gunosy.com/articles/* | |
// @version 1.0.2 | |
// @grant none | |
// @downloadURL https://gist.github.com/gifnksm/cc0ae271dab4b31036d1/raw/gunosy_redirect.user.js | |
// @author NAKASHIMA, Makoto <makoto.nksm+github@gmail.com> | |
// ==/UserScript== |