Skip to content

Instantly share code, notes, and snippets.

View SangHakLee's full-sized avatar
🦄
https://stackshare.io/SangHakLee

Sanghak,Lee SangHakLee

🦄
https://stackshare.io/SangHakLee
View GitHub Profile
@SangHakLee
SangHakLee / isEmpty.js
Created December 28, 2015 16:31
check some value is empty ( include empty array, empty object and exclude number 0
// 넘어온 값이 빈값인지 체크합니다.
// !value 하면 생기는 논리적 오류를 제거하기 위해
// 명시적으로 value == 사용
// [], {} 도 빈값으로 처리
var isEmpty = function(value){
if( value == "" || value == null || value == undefined || ( value != null && typeof value == "object" && !Object.keys(value).length ) ){
return true
}else{
return false
}
@SangHakLee
SangHakLee / gist.md
Last active May 18, 2023 02:33
git ecosystem

gist

gist 코드를 블로그에 넣기

Copy! <script src="https://gist.github.com/SangHakLee/f3bdee00e6bcbb1965c235840eb43034.js"></script>

and Paste where you want to put.

JavaScript

@SangHakLee
SangHakLee / svn_commit.md
Last active August 17, 2022 07:26
How to commit project files to svn repo

SVN 커밋 과정

Step 0. 코드 수정

현재 개발 중인 서버에 ssh 접속 후 코드 수정

주의사항

  • 개발, 운영 서버의 DB 정보도 꼭 확인한다.

@SangHakLee
SangHakLee / tab.html
Created December 24, 2015 01:29
Focus current tab after reload page in Bootstarp tab.
<!--simple bootstarp tab example-->
<div>
<!-- Nav tabs -->
<ul class="nav nav-tabs" role="tablist">
<!--class="active" means now focusing. 현재 첫번째 home으로 가는 li 태그가 기본-->
<li role="presentation" class="active"><a href="#home" aria-controls="home" role="tab" data-toggle="tab">Home</a></li>
<li role="presentation"><a href="#profile" aria-controls="profile" role="tab" data-toggle="tab">Profile</a></li>
<li role="presentation"><a href="#messages" aria-controls="messages" role="tab" data-toggle="tab">Messages</a></li>
<li role="presentation"><a href="#settings" aria-controls="settings" role="tab" data-toggle="tab">Settings</a></li>
</ul>
@SangHakLee
SangHakLee / Prim.java
Created June 9, 2016 11:49
p142 프림 알고리즘
// 슈도코드
set_of_edges prim (int n, number[][] W){
index i, vnear;
number min;
edge e;
set_of_edges F;
index[] nearest = new index[2..n];
number[] distance = new number[2..n];
F = 0; // 공집합;
@SangHakLee
SangHakLee / isEmpty.js
Last active June 24, 2020 06:37
v2019 - check some value is empty
const empty = (value) => {
if (value === null) return true
if (typeof value === 'undefined') return true
if (typeof value === 'string' && value === '') return true
if (Array.isArray(value) && value.length < 1) return true
if (typeof value === 'object' && value.constructor.name === 'Object' && Object.keys(value).length < 1 && Object.getOwnPropertyNames(value) < 1) return true
if (typeof value === 'object' && value.constructor.name === 'String' && Object.keys(value).length < 1) return true // new String()
return false
}
// 슈도 코드
class heap{
keytype[] S; // S의 인덱스는 1부터 n까지
int heapsize; // heapsize는 0~n 사이
}
void heapsort( int n, heap H ){
makeheap(n, H);
removekeys(n, H, H.S);
}
from flask import Flask
app = Flask(__name__)
import model
sim = None
data = '1'
@app.route('/')
def hello_world():
openapi: 3.0.0
servers:
- url: //10.222.222.227/api/v1
description: Dev server
- url: //gcloud.gabia.com/v1
description: Prod server
info:
title: gCloud API
description: gCloud API 입니다.
contact:
@SangHakLee
SangHakLee / .eslintrc.yml
Last active July 2, 2018 00:50
Service Dev eslint
---
env:
es6: true
node: true
mocha: true
extends: eslint:recommended
parserOptions:
ecmaVersion: 9 # ECMAScript2018
rules:
no-console: error # deploy 단계에선 console.log를 지우고 올리거나 주석 처리를 한다.