Skip to content

Instantly share code, notes, and snippets.

@think49
think49 / encode-html-entity.js
Last active December 9, 2015 08:26
encodeHtmlEntity.js : <>&"' をHTMLエンティティ化する
/**
* encode-html-entity.js
* encode Character entity reference & Numeric character reference.
*
* @version 1.0.3
* @author think49
* @url https://gist.github.com/1032896
* @license http://www.opensource.org/licenses/mit-license.php (The MIT License)
* @see <a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/named-character-references.html">11.5 Named character references - HTML Standard</a>
* @see <a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/apis-in-html-documents.html#innerhtml">3.3 APIs in HTML documents - HTML Standard</a>
@think49
think49 / xquery.js
Created June 4, 2011 07:38
xquery.js : 入力された XPath 文字列を元にノードを生成します。
/**
* xquery.js
* xQuery generates a node based on a XPath character string.
*
* @version 1.0.1
* @author think49
* @url https://gist.github.com/1007702
* @license http://www.opensource.org/licenses/mit-license.php (The MIT License)
* @see <a href="http://www.w3.org/TR/xpath/">XML Path Language (XPath)</a>
*/
@think49
think49 / Google High Light by js.txt
Created May 16, 2011 11:29
google-highlight.js: Google検索結果の検索語をハイライトします。Proxomitronフィルタ用。
---------------------------------------------------------------------
Google: High Light by js
---------------------------------------------------------------------
概要
Google検索結果で検索語を最大7つまでハイライトします。(要 JavaScript)
仕様
- JavaScript を利用しているため、ブラウザの JavaScript を有効にしてください。
@think49
think49 / translate-by-array.js
Created May 11, 2011 09:54
translate.js : XPath の translate() 関数。
/**
* translate-by-array.js
* translate function of XPath.
*
* @version 1.0.2
* @author think49
* @url https://gist.github.com/966219
* @license http://www.opensource.org/licenses/mit-license.php (The MIT License)
* @see <a href="http://www.w3.org/TR/xpath/#function-translate">translate() - XML Path Language (XPath)</a>
*/
@think49
think49 / to-hankaku.js
Created May 10, 2011 14:38
to-hankaku.js, to-zenkaku.js : 半角文字/全角文字をそれぞれ変換する
/**
* to-hankaku.js
* convert to ascii code strings.
*
* @version 1.0.1
* @author think49
* @url https://gist.github.com/964592
* @license http://www.opensource.org/licenses/mit-license.php (The MIT License)
*/
@think49
think49 / cssstyledeclaration-removeproperty.js
Last active June 7, 2017 04:05
cssstyledeclaration-removeproperty.js, cssstyledeclaration-setproperty.js : IE8- で動作する CSSStyleDeclaration#removeProperty, CSSStyleDeclaration#setProperty
/**
* cssstyledeclaration-removeproperty.js
* define CSSStyleDeclaration.prototype.removeProperty for IE.
*
* @version 1.0.4
* @author think49
* @url https://gist.github.com/953107
* @license http://www.opensource.org/licenses/mit-license.php (The MIT License)
* @see <a href="http://dev.w3.org/csswg/cssom/#the-cssstyledeclaration-interface">5.5.1. The CSSStyleDeclaration Interface - CSSOM</a>
* @see <a href="http://msdn.microsoft.com/en-us/library/dd347052%28v=vs.85%29.aspx">CSSStyleDeclaration Prototype (attribute) - MSDN</a>
@think49
think49 / to-zero-padding.js
Created March 29, 2011 08:14
to-zero-padding.js : 数値をゼロパディングされた数値文字列に変換する
/**
* to-zero-padding.js
* The Number value is changed to the numerical string value of zero padding.
*
* @version 1.1.1
* @author think49
* @url https://gist.github.com/891983
* @license http://www.opensource.org/licenses/mit-license.php (The MIT License)
*/
@think49
think49 / natural-language.js
Created March 27, 2011 08:13
natural-language.js : 自然言語アルゴリズムで配列やノードリストをソートする
/**
* natural-language.js
* Array is sorted by natural language algorithm.
*
* @version 0.9
* @author think49
* @url https://github.com/think49
* @license http://www.opensource.org/licenses/mit-license.php (The MIT License)
* @see <a href="http://sourcefrog.net/projects/natsort/">Natural Order String Comparison</a>
*/
@think49
think49 / is-object.js
Last active September 25, 2015 07:47
is-object.js : Object型なら true を返し、他の型なら false を返す(ES6対応)
/**
* is-object.js
*
* @version 1.0.3
* @author think49
* @url https://gist.github.com/887049
* @license http://www.opensource.org/licenses/mit-license.php (The MIT License)
*/
'use strict';
@think49
think49 / textareaSelectEndPoint.js
Created March 24, 2011 12:57
textareaSelectEndPoint.js : テキストボックスにフォーカスした時、文字列の最後にカーソルが移動させる。(IE8 はデフォルトでカーソルが先頭に移動する)
/**
* textareaSelectEndPoint.js
*
* @version 1.0.4
* @author think49
* @url https://gist.github.com/885009
*/
(function () {