Skip to content

Instantly share code, notes, and snippets.

@crongro
crongro / compare Array using Join Function
Created February 2, 2015 01:04
compare Array using Join Function
var a = [1,2,3,4,5];
var b = [1,2,3,4,5];
a === b //false
a.join('_') === b.join('_'); //true
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>testcode</title>
<style type="text/css" media="screen">
.testButton{width:400px;height:50px;}
.showLayer{width:400px;height:400px;background:pink}
.showLayer > div {padding: 10px; box-sizing: border-box; }
</style>
@crongro
crongro / 0316_2
Created March 16, 2015 11:42
0315_2
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>testcode</title>
<style type="text/css" media="screen">
.testButton{width:400px;height:50px;}
.showLayer{width:400px;height:400px;background:pink}
.showLayer > div {padding: 10px; box-sizing: border-box; }
</style>
@crongro
crongro / test.html
Last active September 11, 2015 04:55
In System.js, react module unit test using Qunit
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>qunit test</title>
<link rel="stylesheet" href="../node_modules/qunitjs/qunit/qunit.css"/>
</head>
<body>
<div id="qunit"></div>
@crongro
crongro / advanced.css
Last active October 20, 2015 09:02
ADVANCED
header,nav,section,div,footer,ul,dd {margin:0;padding:0;}
li{list-style: none;}
dt {
font-weight: bold;
font-size: 1.2em;
margin-bottom: 5px;
}
dl {
float: left;
@crongro
crongro / debug.js
Created October 13, 2015 05:41
debugError
function execCalc(aData) {
var nMin = Number.MAX_VALUE;
var nMax = Number.MIN_VALUE;
for(var i = 0 ; i < aData.length; i++) {
if(aData[i] < nMin) {
nMin = aData[i];
}else if(aData[i] > nMax) {
nMax = aData[i];
}else{}
@crongro
crongro / wsclient.html
Created December 11, 2015 05:10
websocket client ex
<html>
<head>
<style>
#log{
width : 600px;
height : 400px;
border : 1px solid red;
margin-bottom : 10px;
}
</style>
@crongro
crongro / debug1.html
Last active February 15, 2016 04:41
debug_ex_1
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>1.html</title>
<style>
section{margin:50px}section ul{width:450px;margin:0 auto;overflow:hidden}section ul li{list-style:none;width:100px;height:100px;border:1px solid gray;line-height:100px;text-align:center;margin-right:5px;float:left}section ul li:nth-child(2){cursor:pointer}.log{width:100px;margin:0 auto}.log button{height:30px;width:100%;font-size:1em}.board{font-size:1.5em;font-weight:700;text-align:center;margin-top:10px}
</style>
</head>
@crongro
crongro / debug2.html
Last active February 15, 2016 04:41
debug2.html
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>1.html</title>
<style>
section{margin:50px}section ul{width:450px;margin:0 auto;overflow:hidden}section ul li{list-style:none;width:100px;height:100px;border:1px solid gray;line-height:100px;text-align:center;margin-right:5px;float:left}section ul li:nth-child(2){cursor:pointer}.log{width:100px;margin:0 auto}.log button{height:30px;width:100%;font-size:1em}.board{font-size:1.5em;font-weight:700;text-align:center;margin-top:10px}
</style>
</head>
@crongro
crongro / debug3.html
Last active February 15, 2016 04:41
debug3.html
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>1.html</title>
<style>
section{margin:50px}section ul{width:450px;margin:0 auto;overflow:hidden}section ul li{list-style:none;width:100px;height:100px;border:1px solid gray;line-height:100px;text-align:center;margin-right:5px;float:left}section ul li:nth-child(2){cursor:pointer}.log{width:100px;margin:0 auto}.log button{height:30px;width:100%;font-size:1em}.board{font-size:1.5em;font-weight:700;text-align:center;margin-top:10px}
</style>
</head>