본문 바로가기

전화번호 체크하기(휴대전화, 유선, 대표번호 등등) if (!function_exists('phone_number_check')) { function phone_number_check($pString) { $is_rule = false; $re_phoneNum = preg_replace('/-/', '', $pString); $mobile = preg_match('/^01[016789]{1}-?([0-9]{3,4})-?[0-9]{4}$/', $pString); $tel = preg_match('/^(02|0[3-6]{1}[1-5]{1})-?([0-9]{3,4})-?[0-9]{4}$/', $pString); $rep = preg_match('/^(15|16|18)[0-9]{2}-?[0-9]{4}$/', $pString); $rep2 = preg_match(.. 더보기
[HTML] Way to remove the arrow button at input tag that number type When you using the input tag with number type, you can see the up/down arrows on the right side of input tag..Like this ..If you don't like this arrows, you would add the styles in css like this ...number-input::-webkit-outer-spin-button,.number-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0;}You can find the manuals here.. https://developer.mozilla.org/en-US/docs/Web/CSS.. 더보기
리눅스에서 PID 로 프로세스 동작 유무 체크 리눅스에서 프로세스가 동작중일 경우해당 정보들이 /proc/[pid] 폴더 내부에 존재하게 됨. 프로그래밍적으로 pid를 이용해서 동일 프로세스가 동작하는지 여부는위 폴더 유무로 체크해 줄 수 있음.$pidFileName = "/tmp/mypid"; if (file_exists($pidFileName)) { $oldPid = file_get_contents($pidFileName); if (file_exists("/proc/$oldPid")) { $this->response("Exists Process"); return false; }} 주 언어가 php인 관계로 간단하게 위와같이 진행해주면해당 스크립트가 다른 프로세스에서 동작중인지 여부를 체크해 줄 수 있음. 물론. 이때 프로세스 진입 단계에 현재 프.. 더보기
Add authorization header in ajax with axios Add authorization header in ajax process. const token = 'eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJpc3MvXC9yZW5ld9fQ.hGyUlcvaRfLhiaaQAqQg'; const authorization = `JWT ${token}`; axios.defaults.headers.common["authorization"] = authorization; const authCodeResult = await axios.post() 더보기
Force file download Force download with axios on vue.js fileDownload = (url, method, req, fileName) => { const axiosConfig = { method: method, url: url, responseType: 'blob', params: req, }; try { const response = await axios(axiosConfig); const url = window.URL.createObjectURL(new Blob([response.data])); const anchor = document.createElement('a'); anchor.href = url; anchor.setAttribute('download', fileName); docum.. 더보기