Skip to content

Instantly share code, notes, and snippets.

View dohoons's full-sized avatar

dohoons dohoons

View GitHub Profile
// 프리로딩
(function () {
var imgArr = [];
var loaded = 0;
var total = 0;
var progress = 0;
$("*").each(function(index, el) {
if(this.tagName == "IMG") {
imgArr.push($(this).attr("src"));
@dohoons
dohoons / cssCombSortOrder.txt
Last active April 28, 2017 04:01
css comb sort order
"sort-order": [
// 흐름, 표시
[
"content",
"quotes",
"counter-reset",
"counter-increment",
"clear",
"float",
"display",
@dohoons
dohoons / _media.scss
Last active November 26, 2021 08:54
SCSS Media Query MIXIN (Desktop First)
//
// 미디어 쿼리 MIXIN
// --------------------------------------------------
// Break Point (Desktop First 기준 내림차순 설정)
$desktop-l-width : 1440px;
$tablet-l-width : 1024px;
$tablet-s-width : 768px;
$mob-l-width : 640px;
$mob-m-width : 425px;
@dohoons
dohoons / gulpfile.js
Created October 6, 2017 11:23
gulp-webserver charset euc-kr
var gulp = require('gulp');
var webserver = require('gulp-webserver');
var mime = require('mime-types');
gulp.task('default', function() {
gulp.src('./').pipe(webserver({
host: '0.0.0.0',
port: 3000,
livereload: false,
directoryListing: false,
@dohoons
dohoons / addDocumentEvent.js
Last active November 3, 2017 05:29
addDocumentEvent
// document 이벤트
var addDocumentEvent = function(eventList) {
return function(types, cb) {
var typeList = types.split(' ');
var type = '';
if(typeof cb !== 'function') return false;
for(var i = typeList.length; i--;) {
type = typeList[i];
@dohoons
dohoons / gulpfile.js
Last active March 19, 2018 05:31
gulp-webserver : middleware for support post
var gulp = require('gulp'),
fs = require('fs'),
path = require('path'),
webserver = require('gulp-webserver');
gulp.task('server', function() {
var dist = './dist';
return gulp.src(dist).pipe(webserver({
host: '0.0.0.0',
@dohoons
dohoons / base.css
Last active June 23, 2020 01:19
Basic Style
/* Basic Style START (dohoons, 200803, 200908, 201011, 201106, 201305, 201607, 201802, 201908, 202006) */
html, body { height:100%; -webkit-text-size-adjust:none; font-family:dotum,"돋움",Arial,Sans-serif; font-size:12px; }
body, input, select, button, textarea, h1, h2, h3, h4, h5, h6, table { line-height:1.5; font:inherit; color:inherit; }
html, body, div, form, input, select, button, textarea, legend, fieldset, figure, h1, h2, h3, h4, h5, h6, ul, ol, dl, li, dt, dd, blockquote, address, p, th, td, caption { margin:0; padding:0; }
ol, ul, li { list-style:none; }
img, fieldset { vertical-align:middle; border:0 none; }
input, select, textarea { vertical-align:middle; resize:none; }
input[type=text], input[type=password], input[type=submit], input[type=tel], input[type=number], input[type=email], input[type=url], input[type=search], textarea { -webkit-appearance:none; border-radius:0; }
button { border:0 none; background:transparent; cursor:pointer; }
button::-moz-focus-inner { border: 0; }
@dohoons
dohoons / getSafeArea.js
Last active April 20, 2020 03:33
getSafeArea()
function getSafeArea() {
var result, computed, div = document.createElement('div');
div.style.padding = 'env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left)';
document.body.appendChild(div);
computed = getComputedStyle(div);
result = {
top: parseInt(computed.paddingTop) || 0,
right: parseInt(computed.paddingRight) || 0,
bottom: parseInt(computed.paddingBottom) || 0,
@dohoons
dohoons / memorySizeOfObject.js
Created April 4, 2018 13:27
calculate memory size of javascript object, it is not a accurate value!
function memorySizeOf(obj) {
var bytes = 0;
function sizeOf(obj) {
if(obj !== null && obj !== undefined) {
switch(typeof obj) {
case 'number':
bytes += 8;
break;
case 'string':
@dohoons
dohoons / .stylelintrc.json
Last active May 8, 2018 04:16
style lint
{
"rules": {
"color-no-invalid-hex": true,
"declaration-block-no-duplicate-properties": [
true,
{
"ignore": [
"consecutive-duplicates-with-different-values"
]
}