Copy!
<script src="https://gist.github.com/SangHakLee/f3bdee00e6bcbb1965c235840eb43034.js"></script>
and Paste where you want to put.
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: |
--- | |
env: | |
es6: true | |
node: true | |
mocha: true | |
extends: eslint:recommended | |
parserOptions: | |
ecmaVersion: 9 # ECMAScript2018 | |
rules: | |
no-console: error # deploy 단계에선 console.log를 지우고 올리거나 주석 처리를 한다. |
{ | |
"env": { | |
"es6": true, | |
"node": true, | |
"mocha": true | |
}, | |
"extends": "eslint:recommended", | |
"rules": { | |
"no-console": 0, | |
"indent": [ |
{ | |
"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" |
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", | |
} |
const crypto = require('crypto') | |
/** | |
* | |
* @param {String} plaintext (64bit 8Byte) | |
* @param {String} key (56bit 7Byte) | |
* | |
* @return {String} ciphertext | |
*/ |
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', |