전체 글

Node.js/TypeScript

[TypeScript] 함수 타입 표현(Function Type Expressions) vs 메소드 선언(Method Declaration)

서론 함수 선언문(Function Declarations)과 함수 표현식(Function Expressions) 에 대한 내용이 아닙니다.관련 내용은 검색 해보시면 많이 나와있다보니 이 글에서는 다루지 않습니다. 함수(Function) 와 메서드(Method) 의 차이점을 알고 있다는 점을 전제로 둡니다.  함수 타입 표현 (Function Type Expressions)(...args: ArgTypes[]) => ReturnType위와 같은 형태로 Call Signature 를 정의하는 데 사용. 주로 함수를 변수에 할당하거나, 다른 함수의 매개변수로 전달할 때 사용됨. [예시]interface 인터페이스_예시 { foo: () => void;}type 타입_예시 = { foo: () => ..

Node.js/React Native

[RN - iOS] APNs Token 발급 에러

SettingsReact Native 0.73.4@react-native-firebase 20.0.0 Problem FCM 으로 앱 push 알림을 구현하기 위해 아래와 같이 사용하고 있었는데useEffect(() => { if (!messaging().isDeviceRegisteredForRemoteMessages) { await messaging().registerDeviceForRemoteMessages(); } if (Platform.OS === 'ios') { await messaging().getAPNSToken(); } const token = await messaging().getToken(); updateDeviceToken(token);},..

Tool

[Postman] 폴더별 path 설정

Notice참고 시점이나 상황에 따라 차이가 발생할 수 있습니다.혹시나 더 좋은 방안이 있으신 분들이 보시게 된다면, 공유해 주시면 감사하겠습니다. SettingsPostman 11.1.25 서론 각 request 별 URL 에 모든 path 를 작성하게 된다면, 중간 path 가 변경되는 등에 대처하는 것이 매우 귀찮다.뭐, 보통은 그런 경우가 없어야겠지만 개인 프로젝트 진행하는 등에 나름 잘 써먹고 있는 방안이다. 다음과 같이, RESTFul 한 API 에서각 endpoint 별 URL 을 전부 작성하는 대신, 마지막 path 하나만 작성할 수 있도록 하기 위한 방법이다.  endpoint 가 '/user/profile' 일 경우를 가정했으며,URL 에는 공백을 넣어줬다(아예 설정하지 않으면..

Node.js/TypeScript

[TypeScript] eslint-plugin-import - There should be no empty line between import groups

SettingsNode: 20.11.17@typescript-eslint/eslint-plugin: 7.0.1@typescript-eslint/parser: 7.0.1eslint: 8.56.0eslint-config-prettier: 9.1.0eslint-import-resolver-typescript: 3.6.1eslint-plugin-import: 2.29.1eslint-plugin-prettier: 5.1.3prettier: 3.2.5더보기// .eslintrc.jsmodule.exports = { parser: '@typescript-eslint/parser', parserOptions: { project: 'tsconfig.json', tsconfigRootD..

Linux

[Linux] pip install - No space left on device

SettingsAWS EC2 ( Amazon Linux / t2.micro)30 GB (swap 2 GB)Python 3.9.16pip 24.0 Problem AI 모델을 사용하고자 deepface 를 다운받는데 No space left on device 오류가 발생했다.# $ pip install deepface$ pip3 install deepface 해결 시도 더보기오류 내용만 봐도 용량이 부족하다 하니, 확인을 안 해볼 수가 없었다. $ df -hT 더보기검색을 해보니 대다수가 용량이 부족하지 않은 경우라면, inode 가 부족한 경우라고 한다. 그래서 확인을 해보았다.$ df -iH 더보기일부 글에서, cache 문제일 수도 있다고 해서 cache 를 삭제하고$ pip cache purge ..

Node.js/React Native

[RN] Image upload

SettingsXcode 15.3IOS Deplyment Target: 17.0multer: 1.4.4-lts.1axios: 1.6.8typescript: 5.4.5react-native: 0.72.5react-native-image-crop-picker: 0.40.3react-native-vision-camera: 3.6.4 서론 Node 서버에서 multer 로 이미지 업로드를 받아야 하는 상황. 여러 글들을 보면서 대충 다음과 같은 코드를 작성했다.const client = Axios.create(/* axios options */);const image = await ImageCropPicker.openPicker(/* crop options */);const fd = new FormData()..

BlockHead
BlockHead