๐ฅ
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<style> | |
@keyframes fadeout { | |
from { opacity:1; } | |
to { opacity:0; } | |
} | |
.toast { | |
position:fixed; left:0; bottom:0; padding:10px; | |
font-size:50px; color:red; font-weight:900; | |
animation: fadeout 1s ease-in forwards; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// if you put isHTML parameter true you'll get newline char as br HTML tag, or just get "\n" | |
function jsonBeautifier(jsonTxt, isHTML) { | |
let result = JSON.stringify(JSON.parse(jsonTxt), null, 4); | |
if(isHTML) result = result.replaceAll("\n", "<br />"); | |
return result; | |
} | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// String ์ฑ์ฐ๊ธฐ(padding) | |
// ์ฌ์ฉ๋ฒ: getPaddedStr(์๋ณธ๋ฌธ์์ด, ํจ๋ฉ์ด ํฌํจ๋ ์ด ๊ธธ์ด, ์ฑ์ธ ๋ฌธ์์ด, ์ฑ์ธ ๋ฐฉํฅ) | |
// ex) getPaddedStr("1135j", 10, "#", "left") = "#####1135j" | |
function getPaddedStr(strOrg, width, to, direction) { | |
if(!strOrg) return ""; | |
var strOrg = new String(strOrg), len = strOrg.length; | |
if(len >= width) return strOrg; | |
var strPad = new Array(width - len + 1).join(to); | |
return (direction == "left" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ํ์ ์ ๋ณด๋ฅผ ๋ด์ ๊ฐ์ฒด๋ฅผ ์ ๋ ฅํ๋ฉด ํ์ด์ง ์ ๋ณด๋ฅผ ์ถ๊ฐํด์ ๋ฐํํด ์ฃผ๋ ํจ์ | |
// ํ์ ์ ๋ณด: ๊ฐ์ฒด. currPage(ํ์ฌํ์ด์ง), totalArticles(์ ์ฒด ๊ธ ์), rowsPerPage(1ํ์ด์ง ๋น ๊ธ ์), pagesPerView(1๋ทฐ ๋น ํ์ด์ง ์) | |
// IE 11 CAPABLE | |
function getPagingProps(p) { | |
// Chksum | |
if(typeof p === "undefined") throw new Error("'p' object required"); | |
if(typeof p != "object") throw new Error("'p' must be an object"); | |
["currPage", "totalArticles", "rowsPerPage", "pagesPerView"].forEach(function(i) { | |
if(!p.hasOwnProperty(i) || isNaN(parseFloat(p[i]))) throw new Error("'" + i + "' has an error"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function getDateByString(dateStr) { | |
// String ๋ฏธ์ ๋ ฅ ์ return | |
if(dateStr == undefined || !dateStr || typeof dateStr != "string" || dateStr.length < 10) return; | |
console.log(dateStr); | |
// YMD | |
var year = parseInt(dateStr.substring(0, 4)); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.io.File; | |
import java.util.Scanner; | |
public class Debug { | |
// ๋๋ฒ๊ทธ์ฉ ๋ก๊ทธ์ธ์ฌ๋ถ ์ง์ ํ์ผ ๋ด์ฉ์ด true์ธ์ง ์๋์ง, | |
// ์ฆ ๊ฐ์ ๋ก๊ทธ์ธ์ ์ง์ํ๋์ง ์๋์ง๋ฅผ ์์๋ด์ด ํ์ | |
// Open a file which indicates about the debug mode, | |
// get the debug mode is true or not, and return it | |
public static boolean getDebug() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function downloadExecute(downloadURL) { | |
fetch(downloadURL) | |
.then(function(response) { | |
return response.blob(); | |
}).then(function(blob) { | |
var fileBlob = new Blob([blob], {type: blob.type}); | |
var aLink = document.createElement("a"); | |
aLink.href = window.URL.createObjectURL(fileBlob); | |
aLink.download = decodeEntity(pageData.fileName); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- | |
I made this to use spinner with the simplest way and with reduced code. | |
Usage โ Simple | |
โ CSS code โ Edit the size/color in :root{} and paste all to ur page. | |
โก HTML โ Just type <div class="spinner"></div> at the location u want. | |
โข Want to turn on the spinner? just add ".loading" class to the spinner element. | |
Want to turn off? remove ".loading" class. | |
Done. That's all. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Get the names & values of one specific form by the name in the page | |
// limitations: can be used only for simple form (no relation with other tags) | |
// ํน์ ์ด๋ฆ์ form ๋ด์ญ ์ถ๋ ฅ | |
function showFormStr(name) { | |
var str = ""; | |
document.forms[name].childNodes.forEach((el) => { | |
if(el.name !== undefined && el.name.length > 0) str += el.name + " = " + el.value + "\n"; | |
}); | |
console.log(str); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
์ฝ๋ ๋จ์ถ ๋ฐ ๊ธฐ๋ฅ ํ์ฅ์ ์ํด ๋ง๋ค์ด๋ณธ ๋ผ์ด๋ธ๋ฌ๋ฆฌ์ ๋๋ค. | |
1. $.pr / $.pn / $.pf : ์ฝ๋๋จ์ถ์ฉ ๋ฉ์๋ | |
// System.out.print โ $.pr ์ฝ๋๋จ์ถ | |
// System.out.println โ $.pn ์ฝ๋๋จ์ถ | |
// System.out.printf โ $.pf ์ฝ๋๋จ์ถ | |
public static void pr (Object o) { System.out.print(o); } |