Skip to content

Instantly share code, notes, and snippets.

View devheedoo's full-sized avatar
☺️
React + TypeScript

heedo devheedoo

☺️
React + TypeScript
  • Seoul, South Korea
View GitHub Profile
@devheedoo
devheedoo / checkUserMobile.js
Created September 23, 2016 04:41
Check user's agent is mobile or not.
var UserAgent = navigator.userAgent;
if (UserAgent.match(/iPhone|iPod|Android|Windows CE|BlackBerry|Symbian|Windows Phone|webOS|Opera Mini|Opera Mobi|POLARIS|IEMobile|lgtelecom|nokia|SonyEricsson/i) != null || UserAgent.match(/LG|SAMSUNG|Samsung/) != null) {
location.href = "/mobile/index.html";
}
@devheedoo
devheedoo / checkboxOptionAll.js
Created September 23, 2016 04:47
Checkboxs which contain 'All' checkbox
/**
* If you click 'All' checkbox, other checkboxs are cancelled.
*/
/* HTML Sample Code: Checkboxs which contains 'All' checkbox. */
// <input type="checkbox" name="hdBox" id="hdBoxAll" value="30000" onclick="checkHdBoxes(this);" checked /><label for="hdBoxAll">전체</label>
// <input type="checkbox" name="hdBox" id="hdBox1" value="30110" onclick="checkHdBoxes(this);" /><label for="hdBox1">지역1</label>
// <input type="checkbox" name="hdBox" id="hdBox2" value="30140" onclick="checkHdBoxes(this);" /><label for="hdBox2">지역2</label>
// <input type="checkbox" name="hdBox" id="hdBox3" value="30170" onclick="checkHdBoxes(this);" /><label for="hdBox3">지역3</label>
// <input type="checkbox" name="hdBox" id="hdBox4" value="30200" onclick="checkHdBoxes(this);" /><label for="hdBox4">지역4</label>
@devheedoo
devheedoo / forEach.jsp
Created September 23, 2016 04:51
Pratice JSTL c tag - forEach
<c:forEach items="${list}" var="item" varStatus="stat">
<!-- varStatus has index attribute that counts automatically -->
<c:if test="${stat.index == 0}">the first item</c:if>
<a href="${item.link}" <c:if test="${(item.prop1 == 'A') || (empty item.prop1)}"> attr1="val1" </c:if>>
<!-- src can use the value -->
<img src="/file/${item.prop2}" alt="${item.prop3}" />
</a>
</c:forEach>
/*
File Upload
on Spring project
*/
/*
<form> in jsp need enctype attribute. For example:
<form name="formA" id="formA" method="post" enctype="multipart/form-data" action="[your_address]">
...
</form>
@devheedoo
devheedoo / oracleJoin.sql
Created October 26, 2016 04:26
oracle join
/* COMMON */
SELECT *
FROM Person
JOIN Worker
ON Person.id = Worker.id;
/* Oracle (Same as above) */
SELECT *
FROM Person,
Worker
@devheedoo
devheedoo / restoreHtml.js
Created November 8, 2016 01:05
Restore HTML
function restoreHtml(content){
if(content == "" || $.trim(content) == ""){
return content;
}
content = content.replace(/\&lt;/gi,"<");
content = content.replace(/\&gt;/gi,">");
content = content.replace(/\&amp;lt;/gi,"&lt;");
content = content.replace(/\&amp;gt;/gi,"&gt");
content = content.replace(/\[\\\"\\\'][\\s]*javascript:(.*)[\\\"\\\']/gi, "\"\"");
@devheedoo
devheedoo / hideHref.html
Created December 1, 2016 07:08
Hide html on status bar
<!DOCTYPE html>
<html>
<head>
<title>hideHref</title>
</head>
<body>
<a href="javascript:;" onclick="javascript:linkFunc('http://www.google.com');">www.hiddenHref.com</a>
<script>
function linkFunc(link) {
window.open(link, '_self');
@devheedoo
devheedoo / terms.md
Created December 2, 2016 00:27
term studynote
  • protected URL: URL allowed only for those in whitelist
  • Entry URL: URL allowed only by hyperlink
@devheedoo
devheedoo / detectIE.html
Last active October 14, 2017 13:14
Total IE Detection using conditional comments (<10) and JavsScript (10, 11)
<!-- Tested on 2016. 12. 5. -->
<body>
<!-- IE8 -->
<!--[IF IE 8]>
<p>isIE8</p>
<![endif]-->
<!-- IE9 -->
<!--[IF IE 9]>
<p>isIE9</p>
@devheedoo
devheedoo / compability.md
Last active December 8, 2016 01:02
Notes for compability among browsers

JavaScript

.includes()

// IE8 : custom declaration of indexOf()
if(!Array.indexOf){
  Array.prototype.indexOf = function(obj){
    for(var i=0; i<this.length; i++){
      if(this[i]==obj){
        return i;
 }