Skip to content

Instantly share code, notes, and snippets.

@think49
think49 / readme.md
Last active September 13, 2017 07:36
String.prototype.padStart, String.prototype.padEnd の Polyfill (ECMAScript 2017 / ECMA-262 8th edition)

string-prototype-padstart+padend.js

概要

ECMAScript 2017 (ECMA-262 8th edition) 既定の String.prototype.padStart 及び String.prototype.padEnd の Polyfill(互換コード)を提供します。

使い方

String.prototype.padStart( maxLength [ , fillString ] )

@think49
think49 / poker.js
Last active May 30, 2020 05:07
poker.js: 数値添字配列をトランプの手札に見立てて役を求める。4種のマークが存在しないので不完全。とりあえず、作ったので公開してみたレベル。
/**
* poker.js
*
* @version 0.1.1
* @author think49
* @url https://gist.github.com/think49/39c020a54939513cb2fd
* @license http://www.opensource.org/licenses/mit-license.php (The MIT License)
*/
'use strict';
@think49
think49 / to-absolute-url.js
Last active December 1, 2015 03:56
to-absolute-url.js: URL文字列を絶対URLに変換 (※DOM L2 HTML の HTMLAnchorElement#href 依存)
/**
* to-absolute-url.js
*
* @version 1.0.1
* @author think49
* @url https://gist.github.com/think49/1e8944a19a36dd57c829
* @license http://www.opensource.org/licenses/mit-license.php (The MIT License)
*/
'use strict';
@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)
*/
@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 / 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 / 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 / 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 / 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 / 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 () {