Skip to content

Instantly share code, notes, and snippets.

@nenjiru
nenjiru / jquery.toObject.js
Created October 15, 2010 03:07
クエリーストリングをハッシュに変換 jQuery Plugin
////////////////////////////////////////////////////////////////////////////////
// Query string convert to hash - jQuery Plugin
// クエリーストリングをハッシュに変換
//
// Copyright 2010, Minoru Nakanow
// Licensed under the MIT licenses.
// http://www.opensource.org/licenses/mit-license.html
//
// Usage:
// $.toObject("index.html?width=500&height=auto");
@nenjiru
nenjiru / jquery.rollover.js
Created October 15, 2010 03:06
ロールオーバー jQuery Plugin
////////////////////////////////////////////////////////////////////////////////
// Rollover - jQuery Plugin
// 識別子.拡張子で読込めた画像をロールオーバープラグイン
//
// Copyright 2010, Minoru Nakanow
// Licensed under the MIT licenses.
// http://www.opensource.org/licenses/mit-license.html
//
// Usage:
// $("img").rollover();
@nenjiru
nenjiru / ellipsis.js
Created October 13, 2010 06:10
表示文字数を指定してトリミング
/**
* Trimming strings.
*
* @param {String} string 対象文字列
* @param {Number} size 全角での長さ
* @param {String} ellipsis 省略文字(初期値 "...")
* @return {String} 整形文字列
*
* @example
* ellipsis("表示したい全角文字数を指定", 10);
@nenjiru
nenjiru / toObject.js
Last active September 23, 2015 22:08
クエリーストリングをハッシュに変換
/**
* Query string convert to hash.
*
* @param {String} string ?を含んだ文字列
* @return {Object}
*
* @example
* toObject("index.html?width=500&height=auto");
* {width:500, height:auto}
*/
@nenjiru
nenjiru / uniqueRandom.js
Last active September 23, 2015 22:08
重複しない乱数
/**
* Random numbers that do not overlap.
* @param {Number} length 生成数
* @param {Number} max 閾値
* @return {Array}
*/
function uniqueRandom(length, max)
{
var random, result = [];