프로그래밍 231

윈도우즈 터미널 우클릭 메뉴에 추가

스토어에서 windows terminal 받고 레지스트리 등록하고 Windows Registry Editor Version 5.00 [HKEY_CLASSES_ROOT\Directory\Background\shell\wt] @="명령 창 열기" "Icon"="%USERPROFILE%\\AppData\\Local\\terminal\\terminal.ico" [HKEY_CLASSES_ROOT\Directory\Background\shell\wt\command] @="C:\\Users\\gunil\\AppData\\Local\\Microsoft\\WindowsApps\\wt.exe -d ." wt.exe 다음에 -d . 이게 있어야 현재 우클릭한 폴더에서 열린다. 아이콘 위치 주의 첨부파일 참조

프로그래밍 2020.06.26

node.js 비동기 모듈 작업

/* 1. start 2. end 3. abc_async 순으로 동작하도록 짜려고함 */ var mymodule = require('./mymodule'); console.log("start"); mymodule.abc_async(); console.log("end"); 모듈쪽내용 /* mymodule.js 내용 */ async function abc_async() { console.log("abc_async start"); await sleep(1000); console.log("abc_async end"); } const sleep = async (ms) => { return new Promise(resolve=>{ setTimeout(resolve,ms) }) } module.exports.abc_..

golang 전역변수 ? 다른 패키지의 변수 사용하기 (global variable)

golang 은 잘모르는게 많이 정해져있나보다. 전역변수 같은걸 사용하려고 이것저것 하다 한가지 실수를 했는데 그게 대소문자구문이였다. 전역변수만 모아두려고 myglobal.go 파일을 만들었다. // myglobal.go 파일 package myglobal //var urlShm = "UrlShm"; // 소문자는 안됨 var UrlShm = "UrlShm"; 사용하기위한 main.go // main.go 파일 package main import ( "fmt" "./myglobal" ) func main() { fmt.Println(myglobal.UrlShm ) } 그리고 다른 방식의 초기화 방법도 있다. package myglobal import ( "fmt" ) var UrlShm string; ..

프로그래밍 2020.03.10

윈도우즈 커맨드 결과를 변수에 넣기

출처: https://stackoverflow.com/questions/6359820/how-to-set-commands-output-as-a-variable-in-a-batch-file 자동화 때문에 결과를 보관하고 연산하고 해야해서 찾아봤습니다. FOR /F "tokens=* USEBACKQ" %%F IN (`커맨드`) DO (SET var=%%F)echo %var%커맨드 부분에 쓸내용을 쓰고 (예를 들어 time /T 같은거)커맨드가 끝날때 까지 var 에 내용이 들어갑니다.