반응형

분류 전체보기 429

moment는 역사속으로 (지원중단)

개인적으로 JavaScript에서 날짜 관련해서 moment를 꽤나 신뢰하고 오랫동안 사용했습니다만, 최근에 moment가 더 이상의 지원은 없다라는 사실을 접하고 많이 슬펐습니다. ㅠㅠ 물론 moment를 사용하면서도 불편한 점도 없이 않아 있었지만, 나름 훌륭하다고 생각했고 무엇보다도 손에 익다보니 편했던 것이 사실입니다. 그래서 더더욱 슬프게 느껴졌습니다. 그러면 왜 지원을 중단했는지, 대안으로는 무엇이 있는지 살펴보도록 하겠습니다. 일단, npm에 들어가보면 마지막 업데이트가 2020-10-06으로 되어 있습니다. 그리고 주간 다운로드 수가 1,800만... 물론 업데이트가 중단된 것이지 기존의 moment 라이브러리는 계속 사용할 수 있습니다. https://momentjs.com/docs/#/..

Programming/Etc 2022.02.08

[node.js] slack bot 만들기 + typescript

제가 속한 연구개발실은 매일 오전 10시에 slack에서 온라인 스크럼을 진행하고 있습니다. 매번 시간에 맞춰서 slack에 글을 쓰는 것도 번거롭고 깜빡할 때도 있어서 이번 기회에 slack bot을 만들어서 알림을 보내도록 만들어봤습니다. slack에 bot을 추가하는 방법이나 node-schedule, typescript 등등에 대한 내용은 인터넷에 찾아보면 자료가 많으니 여기서는 제가 구현한 소스코드를 공유해드리는 것으로 할게요. Development environment. node v14.16.1 typescript node-schedule moment mac package.json { "name": "jarvis", "version": "1.0.0", "description": "", "mai..

Programming/Node.js 2022.02.04

서버 시간 설정하기

간단하게 node-schedule를 적용해서 slack api bot을 만들었습니다. 로컬에서 테스트할 때는 제가 지정한 시간에 맞춰서 알림이 잘 갔는데 AWS EC2 인스턴스에서는 정해진 시간에 알림이 안가더라구요. 혹시나 해서 서버 시간을 살펴봤더니 UTC 시간 기준으로 되어있더라구요. 그래서 UTC +9 로 맞춰서 다시 실행을 하니 원하는 시간에 알림이 잘 가게 되었습니당. 서버 시간 확인 date 서버 시간 변경 ln -sf /usr/share/zoneinfo/Asia/Seoul /etc/localtime

Programming/Etc 2022.02.04

[vue] mongoose ERROR ServerMiddleware Error: Cannot overwrite User model once compiled.

npm run dev 위의 명령어로 로컬에서 서비스를 띄운 후, 파일을 수정하거나 하면 알아서 hot loading를 해줍니다. 정적인 페이지나 다른 부분은 문제가 없는데 mongoose를 사용중에는 아래와 같은 에러를 만나게 됩니다. ERROR ServerMiddleware Error: Cannot overwrite User model once compiled. 12:23:25 at Mongoose.model (node_modules/mongoose/lib/index.js:506:13) at api/schamas/user.js:42:19 at g (node_modules/jiti/dist/jiti.js:1:55111) at api/routes/signRoute.ts:6:36 at g (node_modu..

Programming/Vue.js 2022.01.22

[ReactNative] iOS, Android 구분하기 (Platform)

ReactNative로 개발을 하다보면 특히 화면을 구성할 때 iOS, Android를 구분해서 다르게 구성하는 경우도 있습니다. 이럴 때 iOS인지 Android인지 구분하는 방법을 알아보겠습니다. import React from 'react'; import {Platform, SafeAreaView, StyleSheet} from 'react-native'; const App = { return ( ); } const styles = StyleSheet.create({ container: { flex: 1, padding: Platform.select({ios: 10, android: 20}) } }); export default App; Platform을 사용하면 운영체제별 다른 값으로 설정하여 운..

[ReactNative] CodePush

2021.07.20 - [Programming/React Native] - [ReactNative] Code push를 위한 App center 연동 [ReactNative] Code push를 위한 App center 연동 CodePush는 MS에서 만든 App Center https://appcenter.ms/ App Center 홈페이지에 가서 가입을 진행한 후 아래와 같이 앱을 등록합니다. 앱을 등록하실 때 본인의 서비스 명칭이 myservice 라고 한다면 꼭 ios는.. marsland.tistory.com 2021.08.03 - [Programming/React Native] - [ReactNative] CodePush 셋팅 [ReactNative] CodePush 셋팅 2021.07.20 ..

[ReaceNative] Expiring Daemon because JVM heap space is exhausted

ReactNative 에서 안드로이드 빌드를하려고 할때 JVM 메모리가 부족해서 빌드에 실패할 경우가 있다. > Task :app:packageRelease FAILED FAILURE: Build failed with an exception. * What went wrong: Execution failed for task ':app:packageRelease'. > A failure occurred while executing com.android.build.gradle.tasks.PackageAndroidArtifact$IncrementalSplitterRunnable > java.lang.OutOfMemoryError (no error message) * Try: Run with --stacktrac..

[ReactNative] CodePush 셋팅

2021.07.20 - [Programming/React Native] - [ReactNative] Code push를 위한 App center 연동 appcenter login ➜ marsland git:(master) ✗ appcenter login Opening your browser... ? Visit https://appcenter.ms/cli-login?hostname=marsland-ui-MacBookPro.local and enter the code: ? Access code from browser: ${token} Logged in as marsland appcenter login 명령어를 입력하면 브라우저 새로운 탭으로 아래와 같이 하나 열린다. 그 화면에 보이는 token을 복사해서 ..

[ReactNative] Code push를 위한 App center 연동

CodePush는 MS에서 만든 App Center https://appcenter.ms/ App Center 홈페이지에 가서 가입을 진행한 후 아래와 같이 앱을 등록합니다. 앱을 등록하실 때 본인의 서비스 명칭이 myservice라고 한다면 꼭 ios는 myservice-ios, android일 경우에는 myservice-android로 앱 이름을 정하도록 합시다. 나중에 헷갈리지 않게요~ Android 앱 등록 저의 경우에는 ReactNative로 Android 앱을 등록하겠습니다. 앱 등록 후 화면 이제 약간의 설정을 해줘야하는데 매우 심플합니다. npm install appcenter appcenter-analytics appcenter-crashes --save-exact npm을 이용해서 ap..

[CentOS] 프로세스 우아하게 죽이기 (graceful shutdown process)

#!/bin/sh if [ -z "$1" ] then echo "사용법 : gracefulShutdown process" exit fi target=$1 loop=1 limitLoop=30 ps -ef | grep $target | grep -v grep | grep -v vi | grep -v sh | awk '{ print $2 }' | \ while read PID do echo "[$PID] 프로세스에 종료 신호를 전송합니다." kill -15 $PID done while [ $loop -le $limitLoop ] do PID_LIST=(`ps -ef | grep $target | grep -v grep | grep -v vi | grep -v sh | awk '{ print $2 }'`) if..

Programming/CentOS 2021.07.16

[CentOS] n일 지난 톰캣 로그 삭제 및 crontab 등록

n일 경과한 로그파일 검색 [marsland@www:/usr/local/tomcat/service/logs/web] find . -type f -mtime +6 ./allat.log.2020-03-18 ./allat.log.2020-03-23 ./allat.log.2020-04-07 ./root.log.2020-02-21 ./allat.log.2020-03-19 ./root.log.2020-04-15 ./root.log.2020-02-22 ./allat.log.2020-03-24 ./root.log.2020-04-09 ./root.log.2020-02-23 ./allat.log.2020-02-21 ./root.log.2020-03-23 ./root.log.2020-04-10 ./root.log.2020-..

Programming/CentOS 2021.07.15
반응형