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
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
}
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를 지우고 올리거나 주석 처리를 한다.
@SangHakLee
SangHakLee / .eslintrc.json
Last active June 28, 2018 02:45
Service Dev
{
"env": {
"es6": true,
"node": true,
"mocha": true
},
"extends": "eslint:recommended",
"rules": {
"no-console": 0,
"indent": [
@SangHakLee
SangHakLee / package.json
Last active April 4, 2018 02:08
NPM private registry my-module.js
{
"name": "my-module",
"version": "1.1.0",
"description": "NPM private registry my-module.js",
"main": "index.js",
"scripts": {
},
"repository": {
"type": "git",
"url": "https://gist.github.com/SangHakLee/9513672e133c1027bc06a80c993d7025"
@SangHakLee
SangHakLee / test.py
Created October 31, 2017 08:37
test created by ryan0425 - https://repl.it/N4Xz/1
import requests # learn more: https://python.org/pypi/requests
url = "http://sanghaklee.tistory.com/rss"
headers = {
'content-type': "application/x-www-form-urlencoded",
'cache-control': "no-cache",
}
@SangHakLee
SangHakLee / DES.js
Last active June 27, 2017 16:49
DES 암호화
const crypto = require('crypto')
/**
*
* @param {String} plaintext (64bit 8Byte)
* @param {String} key (56bit 7Byte)
*
* @return {String} ciphertext
*/
@SangHakLee
SangHakLee / isMobilePhone.js
Last active June 13, 2017 16:04
isMobilePhone
const isMobilePhone = /^((\+?82)[ \-]?)?0?1([0|1|6|7|8|9]{1})[ \-]?\d{3,4}[ \-]?\d{4}$/;
valid: [
'+82-010-1234-5678',
'+82-10-1234-5678',
'82-010-1234-5678',
'82-10-1234-5678',
'+82 10 1234 5678',
@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