Skip to content

Instantly share code, notes, and snippets.

View zlrlo's full-sized avatar
🐥

jieunee zlrlo

🐥
  • Seoul, Republic of Korea
View GitHub Profile
@zlrlo
zlrlo / hello.js
Created July 24, 2020 12:40
hello gist
function hello() {
console.log('hello');
}
hello();
@zlrlo
zlrlo / commands.md
Last active August 30, 2022 09:09
자주쓰는 명령어 모음
@zlrlo
zlrlo / guide.md
Last active August 15, 2021 09:40
Git 커밋 메세지

📌 Git 커밋 메세지 스타일 가이드

feat : 새로운 기능 추가
fix : 버그 수정
docs : 문서의 수정
style : (코드의 수정 없이) 스타일(style)만 변경(들여쓰기 같은 포맷이나 세미콜론을 빼먹은 경우)
refactor : 코드를 리펙토링
test : Test 관련한 코드의 추가, 수정
chore : (코드의 수정 없이) 설정을 변경(빌드 업무 수정, 패키지 매니저 수정 등)

@zlrlo
zlrlo / nginx.md
Last active August 16, 2021 04:51
nginx 사용법

nginx

동시접속 처리에 특화된 웹 서버 프로그램이다.

1. 설치(Ubuntu)

sudo apt-get update // 저장소 업데이트
sudo apt-get install -y nginx // nginx 설치
nginx -v // nginx 버전 확인
@zlrlo
zlrlo / pm2.md
Last active October 18, 2020 13:58
PM2 사용법

PM2

  • PM2를 적용해 Node.js 애플리케이션을 무중단으로 운영할 수 있다.
  • 클러스터 모듈을 통해 단일 프로세스를 멀티 프로세스로 늘릴 수 있는 방법을 제공한다.

1. 설치

sudo apt-get update // 저장소 업데이트
npm install pm2@latest -g // pm2 전역 설치
@zlrlo
zlrlo / fetchWithTimeout.js
Last active November 15, 2022 08:58
fetch를 통한 요청 중 오래 걸리는 요청일 경우 timeout을 두고 중단이 필요한 경우가 있을 수 있다. 이럴 때 AbortController를 이용해 처리가 가능하다.
async function fetchWithTimeout(resource, options = {}) {
const { timeout = 8000 } = options;
const controller = new AbortController();
const id = setTimeout(() => controller.abort(), timeout);
const response = await fetch(resource, {
...options,
signal: controller.signal
});
@zlrlo
zlrlo / singlyLinkedList.js
Last active July 26, 2023 09:41
[JS] singlyLinkedList javascript
class Node {
constructor(value) {
this.value = value;
this.next = null;
}
}
class SinglyLinkedList {
constructor() {
this.head = null;
@zlrlo
zlrlo / swap.js
Created November 15, 2022 09:25
javascript trick - swap
let a = 5, b = 8;
[a, b] = [b, a];
@zlrlo
zlrlo / sum.js
Last active November 15, 2022 09:54
javascript trick - 함수형 프로그래밍 방식 범위 루프
// for (let i = 5; i < 10; i += 1) { sum += i }
const sum = Array.from(new Array(5), (_, i) => i + 5).reduce((acc, cur) => acc + cur, 0);
@zlrlo
zlrlo / uniqueNamesWithSpread.js
Created November 15, 2022 09:52
javascript trick - 배열 중복 제거
const names = ['Lee', 'Kim', 'Park', 'Lee', 'Kim'];
const uniqueNamesWithSpread = [...new Set(names)];