express를 import하면 아래와 같이 import 했을 겁니다. import * as Express from 'express'; 하지만 tsconfig.json 파일에 아래 내용을 추가 하면.. { "compilerOptions": { "allowSyntheticDefaultImports": true, "esModuleInterop": true, } } 이렇게 import가 가능해 집니다. import Express from 'express'
SPA를 개발하다 보면, 앱의 버전을 올려서 서버에 반영을 했는데, 웹은 캐시를 타버려서 업데이트가 되지 않는 경우가 빈번합니다. 웹 서버와 웹 어플리케이션의 버전이 맞지 않아서 이상하게 동작도 하고.. 대략적으로 난감한 경우가 발생해서, 캐시를 지우고 리로드 하는 코드를 간단하게 만들어 봤습니다. caches .keys() .then(c => { for (const i of c) { caches.delete(i); } }).then(() => { location.reload(true); }); 그리고 아래는 axios를 이용해서 버전을 확인하고 업데이트를 진행하는 코드 입니다. import * as axios from 'axios' console.log('current version :', versio..
소스를 관리 하다가.. master가 branch와 간격이 많이 버러졌는데.. branch를 master로 써야 할 경우 입니다. git checkout newFunction git merge -s ours master git checkout master git merge newFunction 방법은 새로운 브렌치에 master를 ours로 머지해 버리고 maser에 다시 머지하는 방법입니다. -s ours 는 —strategy=ours 의 단축 된 표현 입니다.
먼저 node_modules에 ts-node와 typscript를 추가해 준다. $ npm install --save-dev ts-node typescript .vscode/launch.json 파일에 아래와 같이 추가.. { "version": "0.2.0", "configurations": [ { "name": "Debug Current ts file", "type": "node", "request": "launch", "program": "${workspaceRoot}/node_modules/ts-node/dist/bin.js", "args": ["${relativeFile}"], "cwd": "${workspaceRoot}", "protocol": "inspector", "env": { "stag..
node에서 어쩌다 보니.. euc-kr을 인코딩 디코딩 할 일이 생겨서 해 보고 고생한 김에.. 메모를 남긴다. 우선 iconv-lite 패키지를 설치해야 한다. $ npm install iconv-lite 아래는 euc-kr인 문서를 읽어서 utf-8로 바꾸고 euc-kr로 바꾸는 예제이다. let iconv = require('iconv-lite'); let fs = require('fs'); // 처음 로딩시 enc-kr 파일 let content = fs.readFileSync('content-kr.txt'); console.log(content.toString()); let utf8Str = iconv.decode(content, 'euc-kr'); console.log(utf8Str); //..
먼저 띄운 화면을 보고 가시죠~캐릭터 얼굴이 마우스 움직이는 방향으로 움직입니다.너무 귀엽죠?그러면, 설치를 해 볼까요?먼저, 확장프로그램에서 live2d를 검색해서 설치해 줍니다.그리고 재실행을 해주시면, 아무것도 안 나옵니다. -_-;F1 또는 Ctrl+Shit+P을 누르고 live2d install을 해 줍니다. 그리고 다시 VSCode를 실행 해 줍니다.그러면, 고양이가 왼쪽 하단에 나옵니다.그리고, 나오는 경고… 살포시 무시하기 위해서 고양이를 살짝 옮기시고, 기어 버튼을 누릅니다.그리고 그만볼래(Don't Show Again)을 눌러 줍니다.우리는 고양이에 만족 할 순 없으니.. 다른 캐릭터를 찾아 봅니다.https://github.com/summerscar/live2dDemo위 주소를 이동해..
17.10부터 네트워크 인터페이스 설정이 netplan이라는 새로운 네트워크 설정이 생겼다. 기존에 인터페이스 설정(/etc/network/interfaces)보다는 간결해 보입니다. 변경 할 파일은 아래와 같습니다. sudo vi /etc/netplan/50-cloud-init.yaml 기본적으로 dhcp로 설치 했을 경우 아래와 같이 나옵니다. network: ethernets: enp4s0f2: addresses: [] dhcp4: true version: 2 그 내용을 아래와 같이 ip와 정보를 넣고 설정 해 주면 됩니다. network: ethernets: enp4s0f2: dhcp4: no addresses: [192.168.1.200/24] gateway4: 192.168.1.1 namese..
먼저 터미널에서 아래와 같은 파일을 열어 줍니다. sudo vi /etc/systemd/logind.conf 파일에서 #HandleLidSwitch=suspend로 되어 있는 곳의 샵(#) 주석을 제거 하고 HandleLidSwitch=ignore 이렇게 변경해 줍니다. # This file is part of systemd. # # systemd is free software; you can redistribute it and/or modify it # under the terms of the GNU Lesser General Public License as published by # the Free Software Foundation; either version 2.1 of the License, o..