Skip to content

Instantly share code, notes, and snippets.

View yungblud's full-sized avatar
๐Ÿ„โ€โ™‚๏ธ

Dong-Ho Choi yungblud

๐Ÿ„โ€โ™‚๏ธ
View GitHub Profile
@yungblud
yungblud / metatag.md
Created October 24, 2019 01:40
Set No Cache in HTML Meta Tag
<meta charset="utf-8" />
<meta content="width=device-width, initial-scale=1, shrink-to-fit=no" name="viewport" />
<meta http-equiv="Expires" content="-1" />
<meta http-equiv="Pragma" content="no-cache" />
<meta http-equiv="Cache-Control" content="No-Cache" />
@yungblud
yungblud / checkboxcss.md
Created October 23, 2019 07:42
CheckBox CSS
.checkbox {
  position: absolute;
  display: none;
}

.label:before {
  box-sizing: border-box;
  content: '';
  float: left;
@yungblud
yungblud / precommit.md
Created September 18, 2019 08:28
Pre Commit

package.json

  "scripts": {
    "precommit": "npm run precommit:client && npm run precommit:server",
    "precommit:client": "cd client && npm run precommit",
    "precommit:server": "cd server && npm run precommit"
  },

server/package.json

@yungblud
yungblud / download-file.js
Created July 10, 2019 09:09 — forked from javilobo8/download-file.js
Download files with AJAX (axios)
axios({
url: 'http://localhost:5000/static/example.pdf',
method: 'GET',
responseType: 'blob', // important
}).then((response) => {
const url = window.URL.createObjectURL(new Blob([response.data]));
const link = document.createElement('a');
link.href = url;
link.setAttribute('download', 'file.pdf');
document.body.appendChild(link);
$ yarn global add pm2
$ export PATH="$PATH:$HOME/.config/yarn/global/node_modules/.bin"
$ pm2 --version
2.10.1

Setup AWS Credentials for sls create

$ serverless config credentials --provider aws --key IAM_ACCESS_KEY --secret IAM_SECRET_KEY

or

with over-write config (~/.aws/credentials)

Access With Password

$ mongo -u username 127.0.0.1/admin

Create Root User

use admin;

AWS๋ฅผ ์“ฐ๋Š” ... (๋ฌด๋ฃŒ๋กœ์“ฐ๋Š” ํ˜น์€ ๋Œ๋ ค๋ง‰๊ธฐ ํ•˜๋Š”...) ์ €๊ฐ™์€ ์‚ฌ์šฉ์ž์—๊ฒŒ ๊ผญํ•„์š”ํ•œ DB๋คํ”„ํ•˜๊ณ  ๋ฎ์–ด์“ฐ๊ธฐ !

์ด ๋ธ”๋กœ๊ทธ ๋˜ํ•œ 10๊ฐœ์›” ๋‚จ์ง“ ๋‚จ์€๊ฒƒ ๊ฐ™์€๋ฐ ํ•œ 9๊ฐœ์›” ์ •๋„ ๋‚จ์•˜์„๋•Œ์— ๋คํ”„ ๊ณผ์ •์ด ํ•„์š”ํ• ๊ฑฐ ๊ฐ™์•„์„œ ์„œํ•‘ ํ›„ ๊ธ€์„ ๋‚จ๊ธด๋‹ค.

๋คํ”„ํ•˜๊ธฐ

์ผ๋‹จ ๋ชฝ๊ณ ๋””๋น„๊ฐ€ ๊น”๋ ค์žˆ๋‹ค๋ฉด, mongodump๋ผ๋Š” ๋ช…๋ น์–ด๋กœ ๋คํ”„๋ฅผ ์‹œ์ผœ์•ผํ•œ๋‹ค.

์•„๋ž˜ ๋ช…๋ น์–ด๋ฅผ ์‹คํ–‰ํ•˜๊ฒŒ ๋˜๋ฉด ๋‚ด ํ˜„์žฌ ์œ„์น˜์— dump๋ผ๋Š” ํด๋”๊ฐ€ ์ƒ๊ธฐ๊ฒŒ๋œ๋‹ค.