Skip to content

Instantly share code, notes, and snippets.

View YounglanHong's full-sized avatar
๐Ÿ™
Focused

YounglanHong

๐Ÿ™
Focused
View GitHub Profile
// local state
let [results, setResults] = useState("");
// useEffect: mount, update -- ๐Ÿ˜ˆInfinite Loop
useEffect(() => {
axios
.get(`${API_URL}movie/${props.id}?api_key=${API_KEY}`)
.then((res) => {
console.log(res.data);
// ์˜ํ™” id๋กœ ์š”์ฒญํ•œ ๊ฒฐ๊ณผ ๋กœ์ปฌ state๋กœ ๊ด€๋ฆฌ
let formerDate = new Date("1970-01-01")
let latterDate = new Date("2020-08-01")
let currentDate = new Date()
formerDate < latterDate
// true
formerDate.valueOf() < latterDate.valueOf()
// true
let current = new Date()
// 1. ๋…„๋„
let year = current.getFullYear() // 2020
current.setFullYear(1970)
year = current.getFullYear() // 1970
// 2. ์›” (*๏ธโƒฃ ์‹ค์ œ ์›” - 1 (1์›”: 0, 2์›”: 1 ... 12์›”: 11))
let month = current.getMonth() // 7 (8์›”)
current.setMonth(11)
// ๋งค๊ฐœ๋ณ€์ˆ˜ ์—†์Œ(์ดˆ๊ธฐํ™”) => ํ˜„์žฌ ๋‚ ์งœ์™€ ์‹œ๊ฐ„ ๊ฐ€์ง€๋Š” Date ๊ฐ์ฒด
let date = new Date();
// ๋งค๊ฐœ๋ณ€์ˆ˜ ๋ฐ€๋ฆฌ์ดˆ => UTC๋กœ๋ถ€ํ„ฐ ๋ฐ€๋ฆฌ์ดˆ๋งŒํผ ๊ฒฝ๊ณผ๋œ Date ๊ฐ์ฒด
// 1day = 86400000ms
let date0 = new Date(0) // Thu Jan 01 1970 09:00:00 GMT+0900
let date1 = new Date(86400000) // Fri Jan 02 1970 09:00:00 GMT+0900
// ๋งค๊ฐœ๋ณ€์ˆ˜ dateString => dateString์— ํ•ด๋‹นํ•˜๋Š” Date ๊ฐ์ฒด
let dateStr0 = new Date("Thu Jan 01 1970 00:00:00 UTC") // UTC
// index.js
<div className="home_container" data-tooltip="Github">
<a
href="https://github.com/YounglanHong"
target="_blank"
rel="noreferrer"
>
<img className="home_github" src={github} alt="github"></img>
</a>
</div>
@YounglanHong
YounglanHong / aws-study-resource.md
Created June 23, 2020 05:45 — forked from serithemage/aws-study-resource.md
AWS ํ•™์Šต ์ž๋ฃŒ์ง‘

AWS ํ•™์Šต ๋งํฌ์ง‘ ์‹œ๋ฆฌ์ฆˆ

  • AWS ํ•™์Šต ์ž๋ฃŒ์ง‘ http://bit.ly/aws-study-resource
  • AWS ๊ณต์ธ ์†”๋ฃจ์…˜์Šค ์•„ํ‚คํ…ํŠธ - ์–ด์†Œ์‹œ์—์ดํŠธ ์ˆ˜ํ—˜ ๊ฐ€์ด๋“œ http://bit.ly/sacertguide
  • AWS ๊ณต์ธ ๊ฐœ๋ฐœ์ž - ์–ด์†Œ์‹œ์—์ดํŠธ ์ˆ˜ํ—˜ ๊ฐ€์ด๋“œ http://bit.ly/devcertguide
  • AWS ๋ณด์•ˆ ๊ด€๋ จ ์ปจํ…์ธ  ๋ชจ์Œ์ง‘ http://bit.ly/secontents
  • AWS ๋”ฅ๋Ÿฌ๋‹ ํ•™์Šต ์ž๋ฃŒ ๋ชจ์Œ์ง‘ http://bit.ly/dlonaws

AWS ํ•™์Šต ์ž๋ฃŒ์ง‘ (http://bit.ly/aws-study-resource)

AWS ์ดˆ๋ณด์ž์šฉ ๊ต์œก ์ž๋ฃŒ

function bubble(arr) {
let result = arr.slice(); // ์›๋ณธ ๋ฐฐ์—ด ๋ณต์‚ฌ
for (let i = 0; i < result.length - 1; i++) {
for (let j = 0; j < result.length - i; j++) {
if (result[j] > result[j + 1]) {
let temp = result[j];
result[j] = result[j+1];
result[j+1] = temp;
}
/*
* 1. ๋ฆฌ์ŠคํŠธ์˜ ๊ธธ์ด๊ฐ€ 0 ๋˜๋Š” 1์ด๋ฉด ์ด๋ฏธ ์ •๋ ฌ๋œ ๊ฒƒ์œผ๋กœ ๋ณธ๋‹ค. ๊ทธ๋ ‡์ง€ ์•Š์€ ๊ฒฝ์šฐ์—๋Š”
* 2. ์ •๋ ฌ๋˜์ง€ ์•Š์€ ๋ฆฌ์ŠคํŠธ๋ฅผ ์ ˆ๋ฐ˜์œผ๋กœ ์ž˜๋ผ ๋น„์Šทํ•œ ํฌ๊ธฐ์˜ ๋‘ ๋ถ€๋ถ„ ๋ฆฌ์ŠคํŠธ๋กœ ๋‚˜๋ˆˆ๋‹ค.
* 3. ๊ฐ ๋ถ€๋ถ„ ๋ฆฌ์ŠคํŠธ๋ฅผย ์žฌ๊ท€์ ์œผ๋กœ ํ•ฉ๋ณ‘ ์ •๋ ฌ์„ ์ด์šฉํ•ด ์ •๋ ฌํ•œ๋‹ค.
* 4. ๋‘ ๋ถ€๋ถ„ ๋ฆฌ์ŠคํŠธ๋ฅผ ๋‹ค์‹œ ํ•˜๋‚˜์˜ ์ •๋ ฌ๋œ ๋ฆฌ์ŠคํŠธ๋กœย ํ•ฉ๋ณ‘ํ•œ๋‹ค.
*/
function mergeSort(arr){
if (arr.length <= 1){
const numbers = {
์ผ: 1,
์ด: 2,
์‚ผ: 3,
์‚ฌ: 4,
์˜ค: 5,
์œก: 6,
์น : 7,
ํŒ”: 8,
๊ตฌ: 9,
const numbers = {
"1": 1,
"2": 2,
"3": 3,
"4": 4,
"5": 5,
"6": 6,
"7": 7,
"8": 8,
"9": 9,