Skip to content

Instantly share code, notes, and snippets.

@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 / 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 / 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 / iframe-auto-adjust.js
Created August 17, 2011 10:47
iframeAutoAdjust.js: iframeの高さをリンク先文書の高さにする
/**
* iframe-auto-adjust.js
*
* @version 1.0.1
* @author think49
* @url https://gist.github.com/1151313
*/
'use strict';
(function () {
@think49
think49 / is-textcontent-of-script.js
Created November 4, 2011 15:38
is-textcontent-of-script.js : script要素の内容が正しいかを検査する(HTML5準拠)
/**
* is-textcontent-of-script.js
*
* @version 1.0.1
* @author think49
* @see <a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/scripting-1.html#restrictions-for-contents-of-script-elements">4.3.1.2 Restrictions for contents of script elements - HTML5 Standard</a>
*/
'use strict';
@think49
think49 / parse-object-literal.js
Created January 11, 2012 16:17
parse-object-literal.js : ES5 規定のオブジェクト初期化子構文(ObjectLiteral)をパースしてオブジェクトを返す関数。ただし、この機能は簡易的で ES5 規定に部分的に準拠しています。
/**
* parse-object-literal.js
* parseObjectLiteral function returns an object, by parsing "ObjectLiteral".
* However, this function is simple. It isn't based upon the part of ES5.
*
* @version 1.0.1b
* @author think49
* @url https://gist.github.com/1595411
* @license http://www.opensource.org/licenses/mit-license.php (The MIT License)
* @see <a href="http://es5.github.com/#x11.1.5">11.1.5 Object Initialiser - Annotated ES5</a>
@think49
think49 / test006.js
Created March 11, 2012 03:15 — forked from os0x/test006.js
// strict check
//
function strict () {
'use strict';
var isStrict = (function () { return typeof this === 'undefined'; }());
console.log(isStrict);
}
function nonStrict () {
@think49
think49 / escaperegexpchar.js
Last active April 2, 2022 10:11
escaperegexpchar.js: 正規表現文字列をエスケープします(ES5準拠)。エスケープ文字列は new RegExp() に渡すことができます。
/**
* escaperegexpchar.js
* Escape the regular expression string (ES5 compliant).
* Escape string can be passed to the () new RegExp().
*
* @version 1.0.2
* @author think49
* @url https://gist.github.com/think49/7691225
* @license http://www.opensource.org/licenses/mit-license.php (The MIT License)
* @see <a href="http://es5.github.io/#x15.10.1">15.10.1 Patterns - Annotated ES5.1</a>
@think49
think49 / getchartypeat.js
Last active December 29, 2015 21:19
対象の文字タイプ(アルファベット、ひらがな、カタカナ)を取得します。
/**
* getchartypeat.js
* Get the character type (Alphabet, Hiragana, Katakana).
*
* @version 1.0.3
* @author think49
* @url https://gist.github.com/think49/7728995
* @license http://www.opensource.org/licenses/mit-license.php (The MIT License)
*/
@think49
think49 / insert-comma-delimiter.js
Last active August 29, 2015 14:08
insert-comma-delimiter.js: 小数or整数文字列に3桁区切りでカンマを挿入します。
/**
* insert-comma-delimiter.js
* Insert commas in a numeric string.
*
* @version 1.0.1
* @author think49
* @url https://gist.github.com/think49/c13758815bc0af4b19e3
* @license http://www.opensource.org/licenses/mit-license.php (The MIT License)
*/