Skip to content

Instantly share code, notes, and snippets.

View gracefullight's full-sized avatar
👍

Eunkwang Shin gracefullight

👍
View GitHub Profile
(function (global, factory) {
if (typeof define === 'function' && define.amd) {
// AMD 환경
define(['exports', 'jquery'], factory);
} else if (typeof exports === 'object' && typeof exports.nodeName !== 'string') {
// CommonJS 환경
factory(exports, require('jquery'));
} else {
// 일반 브라우저
factory((global.module1 = global.module1 || {}), global.$);
(function (global, factory) {
if (typeof define === 'function' && define.amd) {
define(['exports'], factory);
} else if (typeof exports === 'object' && typeof exports.nodeName !== 'string') {
factory(exports);
} else {
factory((global.module1 = global.module1 || {}));
}
}(this, function (exports) {
exports.action = function () {};
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
typeof define === 'function' && define.amd ? define(['exports'], factory) :
(factory((global.module1 = global.module1 || {})));
}(this, (function (exports) {
exports.action = function () {};
}));
var throttleFunction = (function() {
'use strict';
var timeWindow = 500; // 여기에 시간(ms)을 지정한다
var lastExecution = new Date((new Date()).getTime() - timeWindow);
// ES6 이하일 경우 ...args에 호출할 parameter 만큼 준다 function(arg1, arg2...)
var throttleFunction = function(...args) {
// 여기에 로직을 구현한다
};
var debounceFunction = (function() {
'use strict';
var timeWindow = 500; // 여기에 시간(ms)을 지정한다
var timeout;
// ES6 이하일 경우 ...args에 호출할 parameter 만큼 준다 function(arg1, arg2...)
var debounceFunction = function(...args) {
// 여기에 로직을 구현한다
};
var obj = {
hasOwnProperty : function(){
return false;
},
data1 : 1
};
for (prop in obj) {
// obj.hasOwnproperty(prop) 의 결과는 항상 false
if (obj.hasOwnproperty(prop)){
for (prop in obj) {
// 첫번째 방법
if ({}.hasOwnProperty.call(obj, prop)) {
}
// 두번째 방법
if (Object.prototype.hasOwnProperty.call(obj, prop)) {
}
var jsonReplace = function(j){
if(j){
j = j.replace(/\"\[/g,"\[").replace(/\]\"/g,"\]").replace(/\"\{/g,"\{").replace(/\}\"/g,"\}");
}
return j;
};
SELECT SQL_CALC_FOUND_ROWS @RNUM:=@RNUM+1 AS ROWNUM, R.* FROM (
SELECT @RNUM:=0, Q.* FROM (
SELECT * FROM TABLE1
WHERE ID = '1'
ORDER BY REG DESC
LIMIT 18446744073709551615
) Q
) R
SELECT SQL_CALC_FOUND_ROWS @RNUM:=@RNUM+1 AS ROWNUM, R.* FROM (
SELECT @RNUM:=0, Q.* FROM (
SELECT * FROM TABLE1
WHERE ID = '1'
ORDER BY REG DESC
) Q
) R
LIMIT 0,10