Skip to content

Instantly share code, notes, and snippets.

@think49
think49 / chiebukuro_q1247699647.html
Created September 26, 2010 13:34
Yahoo知恵袋 (q1247699647)
<!DOCTYPE html>
<html lang="ja">
<head>
<meta charset="UTF-8" />
<title>getMapDivAttribute for chiebukuro (q1247699647)</title>
<style type="text/css"><!--
html { margin: 0; padding: 0; }
body { margin: 0; padding: 1em; }
pre { font-family: monospace; }
#PRINT { background-color: #ddd; }
@think49
think49 / PuzzleTable_js.html
Created September 28, 2010 13:00
PuzzleTable.js : mouseover したり、click すると画像が切り替わるパズル的な何か
<!DOCTYPE html>
<html lang="ja">
<head>
<meta charset="UTF-8" />
<title>PuzzleTable</title>
<style type="text/css"><!--
table { padding: 0; border-collapse: collapse; border-style: none; border-width: 0; }
tbody, tr, td { margin: 0; padding: 0; }
td img { margin: 0; padding: 0; vertical-align: bottom; }
@think49
think49 / overlapInputTextValue.html
Created October 1, 2010 05:06
overlapInputTextValue.js : input[type="text"] の値を重複チェックします。
<!DOCTYPE html>
<html lang="ja">
<head>
<meta charset="UTF-8" />
<title>テキストボックスの重複チェック</title>
<style><!--
/* default */
body { margin: 0; padding: 1em; }
h1,h2,h3,h4,h5,h6 { font-weight: bold; color: #202020; }
h1 { margin: 1em 0; padding: 0; font-size: 150%; }
@think49
think49 / URIParameter.js
Created October 1, 2010 07:56
URIParameter.js : URI のGETパラメータをオブジェクトに展開します。
/**
* URIParameter.js
*
* @version 1.0.2
* @author think49
*/
var URIParameter = (function () {
/**
@think49
think49 / dumpObject.js
Created October 1, 2010 08:39
dumpObject.js : オブジェクトを整形文字列にして返します。
// dumpObject.js
// オブジェクトを整形文字列にして返します
function dumpObject (obj) {
var p, result;
result = [];
for (p in obj) {
if (obj.hasOwnProperty(p)) {
@think49
think49 / rfc4180.js
Created October 1, 2010 17:06
rfc4180.js : CSV文字列を二次元配列やtable要素ノードに変換する (RFC 4180 準拠)
/**
* rfc4180.js
* CSV parser.
*
* @version 1.0.1
* @author think49
* @url https://gist.github.com/606500
* @license http://www.opensource.org/licenses/mit-license.php (The MIT License)
* @see <a href="http://www.ietf.org/rfc/rfc4180.txt">http://www.ietf.org/rfc/rfc4180.txt</a>
*/
@think49
think49 / rfc4180plus.js
Created October 1, 2010 17:11
rfc4180plus.js : この gist は http://gist.github.com/606500 に統合されました
function RFC4180Plus () {
var
CRLF = '(?:\r\n|[\r\n])',
escaped = '"(?:""|[^"])*"',
non_escaped = '[^\n\r",]*',
field = '(?:' + escaped + '|' + non_escaped + ')',
record = field + '(?:,' + field + ')*',
file = record + '(?:' + CRLF + record + ')*' + CRLF + '?';
@think49
think49 / getFormElements.html
Created October 4, 2010 09:37
getFormElements.js : HTMLFormElement.elements をオブジェクトに変換して返す
<!DOCTYPE html>
<html lang="ja">
<head>
<meta charset="UTF-8" />
<title>getFormElements.js</title>
<style type="text/css"><!--
/* default */
body { margin: 0; padding: 1em; }
h1,h2,h3,h4,h5,h6 { font-weight: bold; color: #202020; }
@think49
think49 / setLineElementByBRElement.html
Created October 7, 2010 11:30
setLineElementByBRElement.js : br要素区切りのノードを <span class="l"> で括る。大学ノート風のデザインを実現できる。
<!DOCTYPE html>
<html lang="ja">
<head>
<meta charset="UTF-8" />
<title>setLineElementByBRElement.js</title>
<style type="text/css"><!--
/* default */
body { margin: 0; padding: 1em; line-height: 100%; }
h1, h2, h3, h4, h5, h6 { font-weight: bold; color: #202020; }
h1 { margin: 1em 0; padding: 0; font-size: 150%; }
@think49
think49 / tableEditor.js
Created October 8, 2010 05:05
TableEditor.js : table要素をフィルタリング
// TableEditor.js
var TableEditor = (function () {
var prototype;
function TableEditor () {
this.init.apply(this, arguments);
return this;
}