Skip to content

Instantly share code, notes, and snippets.

@crongro
crongro / es6_template_literal.js
Last active April 3, 2017 08:38
es6_template_literal
function fn(val, name, hour) {
var ampm = (hour > 11) ? "pm" : "am";
console.log(val[0], name, val[1], hour, ampm, val[2]);
}
var data = {
hour : new Date().getHours(),
name : "solvin"
}
@crongro
crongro / a.html
Last active March 21, 2017 13:01
kakaocorp.com_html 제작중
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>카카오</title>
<link rel="stylesheet" href="main.less.css">
</head>
<body>
@crongro
crongro / newstandmvc.js
Last active March 20, 2017 06:37
newstandmvc
var ns = {};
//utility
ns.util = {
sendAjax: function(url, fn) {
const oReq = new XMLHttpRequest();
oReq.addEventListener("load", function() {
var jsonObj = JSON.parse(oReq.responseText);
fn(jsonObj);
(function(count) {
var resultSet = [];
function getRandom() {
var randomNumber = Math.floor(Math.random()*count)+1;
if(resultSet.indexOf(randomNumber) === -1) {
resultSet.push(randomNumber);
if(resultSet.length < count) getRandom();
return;
}
getRandom();
@crongro
crongro / bugcode.js
Last active January 4, 2017 05:10
bugcode
function checkargs(a,b,type) {
var checkResult;
if(typeof a !== type || typeof b !== type) return false;
else return;
}
function multiplyDouble(num2,num2) {
var DOUBLE = 2;
var sum = num1 * num2 * 2;
var result = sum * DOUBLE;
@crongro
crongro / data.js
Last active December 30, 2016 08:43
object data sample
[
{"id" : 23, "name" : "honux", "content" : "오늘의 커피는 왜 항상 맛있지?", "like" : 2, "comment" : ["^^", "i like this"]},
{"id" : 55, "name" : "nigayo", "content" : "드디어 출근!", "like" : 4, "comment" : ["이직 하셨나봐요? "]},
{"id" : 93, "name" : "jk", "content" : "어제 읽은 책이 아직도 ", "like" : 20, "comment" : ["잠자기 전에 만화책은 금물..", "그게 뭘까?"]},
{"id" : 4, "name" : "crong", "content" : "코드스쿼드가 정말 좋은 곳일까? 믿을 수가 없다..", "like" : 0, "comment" : ["누가 그러디"]}
]
@crongro
crongro / tabUI.css
Last active July 1, 2016 06:34
tabUI
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 / 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>
@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 / 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>