-
Git 디버깅(git bisect)
Git 디버깅(git bisect) git bisect start // git bisect 시작 git bisect good <rev> // 단어는 good 이지만 의미는 old(과거 시점 or 시작 시점) git bisect bad <rev> // 단어는 bad 이지만 의미는 new(최근 시점 or 종료 시점) git bisect <bad rev> <good rev> // git bisect good <rev>, git bisect bad <rev> 한 번에 실행 git bisect reset // git bisect 종료 git bisect start git bisect good 3a72849 git bisect bad 6aab2f2 or...
jinnnh's profile imagejinnnh
2020-05-11 11:00
-
Git 블로그 시작하기(How to make GitHub Pages)
Git 블로그 시작하기
jinnnh's profile imagejinnnh
2020-03-16 11:00
-
ssh를 사용해서 동일한 컴퓨터에서 GitHub에 여러개의 계정 연결(use multiple ssh-keys for different accounts)
1. 로컬에 SSH 키 생성하기 1) .ssh 폴더로 이동하기(기본적으로 저장되는 디렉토리) -없다면 키를 생성할 때 자동으로 생성된다. (따로 직접 만들어도 된다.) $ cd ~/.ssh 2) .ssh 디렉토리가 존재한다면 기존의 키를 확인하자. $ ls id_rsa.pub id_rsa .pub가 붙은 파일은 공개 키, 아닌 것은 개인 키 3) ssh 키 생성하기 $ ssh-keygen -t rsa -C '{username}@gamil.com' //계정의 이메일 주소 여기서 새로운 키를 저장할 경로를 묻는다. ex) username01_gmail_rsa // 계정_메일호스트_rsa Enter file in which to save the key...
jinnnh's profile imagejinnnh
2020-03-09 17:30
-
jsDelivr Open Source CDN 사용하기
github https://cdn.jsdelivr.net/gh/{사용자 이름}/{repository 이름}/{파일 경로}
jinnnh's profile imagejinnnh
2020-02-05 14:00
-
아이폰X 노치 대응하기
<!-- 기존 --> <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=yes"> <!-- 수정 --> <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=yes, viewport-fit=cover"> /* 공통 헤더 */ .logo { position: absolute; top: 14px; left: 25px; left: calc(25px + env(safe-area-inset-left)); } /* 우측 전체메뉴 버튼 */ .btn-menu-open { position: absolute; top: 0; right: 6px; right: calc(6px + env(safe-area-inset-right)); } /* 본문 내용 */ .common-content { margin: 0 auto; padding: 40px 25px 52px; padding-left: calc(25px + env(safe-area-inset-left)); padding-right: calc(25px...
jinnnh's profile imagejinnnh
2019-09-20 16:00
-
페이지 리소스 로드 후 실행(execute function after complete page load)
document.addEventListener('readystatechange', function () { if (event.target.readyState === "interactive") { // same as: document.addEventListener("DOMContentLoaded"... // same as jQuery.ready console.log("All HTML DOM elements are accessible"); } if (event.target.readyState === "complete") { console.log("Now external resources are loaded too, like css,src etc... "); } }); execute function after complete page load
jinnnh's profile imagejinnnh
2019-08-05 16:00
-
Visual Studio Code 추천 확장프로그램
Visual Studio Code Extension Language Korean Languiage Pack for Visual Studio Code //한글 메뉴 변환 GIT Git Histroy //Git Log 편하게 보기 Git Project Manager //Git 프로젝트 관리 Convinience Setting Sync //VS CODE 환경설정 동기화 Image Preview //에디터에서 이미지 미리보기 Markdown Preview Enhanced //마크다운 문서 미리보기 Beautify //코드 정렬 Prettify JSON //JSON 코드 정렬 jshint //JAVASCRIPT 오류 체크
jinnnh's profile imagejinnnh
2019-03-06 10:30
-
임시 데이터 만들기
function generateData(n) { var tempData = []; var firstNames = [ '지훈', '지혜', '성민', '지은', '현우', '수진', '정훈', '혜진', '동현', '은지', '유진', '수빈', '지원', '준호', '지현', '민준', '서연', '지민', '민서', '준서', '서현', '우진', '서윤', '서준', '주원', '하준', '예준' ]; var lastNames = [ '김', '이', '박', '최', '구', '강', '조', '윤', '장', '임', '한', '신', '오', '서', '권', '황', '송' ]; var productNames = [ "홍차", "녹차", "에스프레소", "에스프레소 더블샷", "카페라떼", "화이트 초콜릿 모카", "카라멜...
jinnnh's profile imagejinnnh
2018-12-13 14:30
-
단위 변환(convert unit)
설정 /** * 숫자 단위 변환 * @param {string} currentUnit 현재 실제 숫자 단위(G, M, k ...) standardUnit 배열에 있는 단위, 없으면 추가해서 사용. 단, 10^3 기준의 단위만 사용 * @param {string} useUnit 사용할 단위(ohm, P, F, Hz ...) * @return {string} ex) {345} + {k} + {ohm} = '345kohm' */ Number.prototype.convertUnit = function (currentUnit, useUnit) { currentUnit = currentUnit || ''; useUnit = useUnit || ''; var convertValue, resultUnit, result; var _v = this;...
jinnnh's profile imagejinnnh
2018-12-13 10:00
-
클로저 패턴(closure pattern)
var closure = (function () { var name = 'jinh'; // private variable var that = this; var exports = { // setter setName: function (name) { that.name = name; }, // getter getName: function () { return that.name; } }; return exports; })();
jinnnh's profile imagejinnnh
2018-11-08 11:00
-
Null Check
Null Check JavaScript에는 ‘없음’를 나타내는 값은 null와 undefined 두 값의 의미는 비슷하지만, 사용되는 목적과 장소가 다름 let foo; foo // undefined const obj = {}; obj.prop; // undefined typeof null // 'object' typeof undefined // 'undefined' 프로그래머의 입장에서 명시적으로 부재를 나타내고 싶다면 항상 null을 사용 function printIfNotNull(input) { if (input !== null && input !== undefined) { console.log(input); } } // 아래 세 개의 식은 완전히 같은 의미입니다. input !== null && input !== undefined;...
jinnnh's profile imagejinnnh
2018-11-08 09:30
-
컬럼 높이 균일하게 맞추기
/** * 배열 분리 * @param {Number} n 나눠야 할 개수 * @return {Array} */ Array.prototype.division = function (n) { var arr = this; var len = arr.length; var cnt = Math.floor(len / n); var tmp = []; for (var i = 0; i <= cnt; i++) { tmp.push(arr.splice(0, n)); } return tmp; }; /* 컬럼 높이 균일 */ var equalHghtCol = { /** * 렌더링 * @param {String} element 대상 컬럼 * @param {Number}...
jinnnh's profile imagejinnnh
2018-08-03 15:30
-
레이어 영역 프린트(modal)
레이어 영역 프린트 var layerPrint = function layerPrint() { var printCont = $('.ly-wrap.active>div').clone(); // 활성화된 레이어 영역 복제 $('body').append('<div class="print-div">'); // 프린트 영역 생성 $('.print-div').append(printCont); // 프린트 영역에 레이어 영역 복사 $('.wrap, .ly-wrap.active').hide(); window.print(); $('.print-div').remove(); // 사용이 끝난 영역 삭제 $('.wrap, .ly-wrap.active').removeAttr('style'); }
jinnnh's profile imagejinnnh
2018-06-28 14:00
-
DATABASE 명령어
명령어 옵션 명령어 DB 생성 CREATE DATABASE {name}; DB 삭제 DROP DATABASE {name}; DB 확인 SHOW DATABASES; DB 사용 USE {name}; TABLE 생성 CREATE TABLE {name}; TABLE 확인 SHOW TABLES; TABLE 상세 DESC {name}; TABLE 이름 변경 RENAME TABLE {name} TO {name2}; 내용 추가 INSERT INTO {name} (title_a, title_b) VALUES('aaa', 'bbb'); 내용 읽기 SELECT * FROM {name} TABLE 생성 CREATE TABLE {tbl}( c1 datatype(length) c2 datatype(length) ... PRIMARY KEY(c1) ); 예시 CREATE TABLE topic( id...
jinnnh's profile imagejinnnh
2018-04-30 14:00
-
dpi에 따른 이미지 파일명과 대응 모바일기기
dpi mdpi 1px = 1dp ldpi mdpi tvdpi hdpi xhdpi xxhdpi xxxhdpi mdpi 0.75 1 1.33 1.5 2 3 4 dpi 120 160 213 240 320 480 640 크기 예 36 x 36 48 x 48 64 x 64 72 x 72 96 x 96 144 x 144 192 x 192 iOS 3GS 4~8, iPad3~ 6+~8+, X Android S2 S3, NOTE3 S4, S5, NOTE4 S6~S9, G3~G6 image...
jinnnh's profile imagejinnnh
2018-04-26 14:00
-
git pull 실패 해결 - You have not concluded your merge (MERGE_HEAD exists)
증상 You have not concluded your merge (MERGE_HEAD exists) 해결방법 1. 머지 취소 git merge --abort 2. 충돌 해결 3. 병합을 추가 하고 커밋 git status git commit -am "커밋 내용" 커밋을 제대로 하지 않았을 경우 아래 메세지가 뜰 수 있음. Pulling is not possible because you have unmerged files 4. 다시 내려 받기 git pull
jinnnh's profile imagejinnnh
2018-04-18 16:00
-
엑셀로 테이블 만들기
엑셀로 테이블 만들기 1. excel2json 활용 link 2. json to table (ajax) json 파일을 테이블로 생성하기 위해서 ajax를 이용 $.ajax({ type: 'GET', url: 'table.json', //파일경로 dataType: 'json', cache: false, success: function (data) { var tableData = data.a0; //a0 = 임의의 카테고리 이름 var _table = []; //테이블 생성 for (var i = 0; i < tableData.length; i++) { _table.push('<tr>'); _table.push(' <th scope="row">'+ tableData[i].year +'</th>'); _table.push(' <td>'+ tableData[i].position +'</td>'); _table.push('</tr>'); } _tableHtml = _table.join('\n'); $('div').append(_tableHtml); //코드...
jinnnh's profile imagejinnnh
2018-02-05 16:00
-
비트맵과 벡터의 차이점
비트맵과 벡터방식 그래픽 도구에는 페인팅을 위한 프로그램과 드로잉을 위한 프로그램으로 나누어 볼 수 있는데 2차적인 평면에서 이미지를 구성하는 방식은 크게 비트맵이미지와 벡터이미지로 나눌 수 있습니다. 비트맵(Photoshop) 정사각형의 픽셀로 구성 되어있다 사진이나 회화 이미지에 적당하다 깊이있는 색조와 부드러운 질감,자연스러움에 적당하다 축소 확대 경우,이미지의 질이 손상이 있다 단위면적당 픽셀수를 결정하는 해상도에의해 용량 영향을 준다 벡터(Illustrator) 베지어 곡선(점과점사이 선)으로 이미지 구성되어있다 글자,로고,캐릭터 디자인에 적합하다 선과 면이 깔끔하고 정갈하다 축소 확대해도 이미지의질에 영향주지 않음 이미지를 변형해도 해상도를 고려할 필요...
jinnnh's profile imagejinnnh
2017-11-13 14:30
-
SSH 권한 설정
SSH 권한 설정 chmod 700 ~/.ssh chmod 600 ~/.ssh/id_rsa chmod 644 ~/.ssh/id_rsa.pub chmod 644 ~/.ssh/authorized_keys chmod 644 ~/.ssh/known_hosts
jinnnh's profile imagejinnnh
2017-07-29 15:40
-
Tomcat 다중 서버 실행
Tomcat 다중 서버 실행하기 1. localhost:xxxx (port 구분으로 연결) example tomcat/conf/server.xml <?xml version="1.0" encoding="UTF-8"?> <Server port="8005" shutdown="SHUTDOWN"> <Listener className="org.apache.catalina.startup.VersionLoggerListener" /> <Listener className="org.apache.catalina.core.AprLifecycleListener" SSLEngine="on" /> <Listener className="org.apache.catalina.core.JreMemoryLeakPreventionListener" /> <Listener className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener" /> <Listener className="org.apache.catalina.core.ThreadLocalLeakPreventionListener" /> <GlobalNamingResources> <Resource name="UserDatabase" auth="Container" type="org.apache.catalina.UserDatabase" description="User database that can be updated and saved" factory="org.apache.catalina.users.MemoryUserDatabaseFactory" pathname="conf/tomcat-users.xml" /> </GlobalNamingResources> <!-- 수정해야 되는 부분 --> <!-- 서비스 1 // http://localhost:5050/ --> <Service name="Catalina"> <Connector port="5050" protocol="HTTP/1.1" connectionTimeout="20000" redirectPort="5443" /> <Connector port="5009" protocol="AJP/1.3" redirectPort="5443" URIEncoding="UTF-8"/> <Engine...
jinnnh's profile imagejinnnh
2017-04-13 10:00
-
VS Code 단축키
Visual Studio Code Keymaps Option Keymaps Multi-Cursor Editing Ctrl + Alt + Shift + → & ← & ↑ & ↓ IntelliSense Ctrl + Space Rename Refactoring F2 Formatting Shift + Alt + F Code Folding Ctrl + Shift + [ & ] Errors and Warnings Ctrl + K , N
jinnnh's profile imagejinnnh
2017-04-10 17:00
-
웹스톰 단축키
WebStorm Keymaps Option Keymaps 설정창 열기 Ctrl + Alt + S 파일 검색 Ctrl + Shift + N 동일 변수 선택 Alt + J / Ctrl + G 일괄 선택 Alt + Ctrl + Shift + J 한줄 복사 Ctrl + D 쓸모없는 공백 삭제 Ctrl + Shift + J 프로젝트 텍스트 검색 Ctrl + Shift + F 들여쓰기 정리 영역선택, Ctrl + Shift + I 프로젝트 검색(All) Shift, Shift 클립보드 선택 붙여넣기 Ctrl +...
jinnnh's profile imagejinnnh
2017-03-24 20:00
-
git 히스토리 삭제하기(초기화)
1. 기존의 히스토리 삭제 $ rm -rf .git 2. 파일정리 후 새로운 git 설정 $ git init $ git add . $ git commit -m "first commit" 3. git 저장소 연결 후 강제 push $ git remote add origin {git remote url} $ git push -u --force origin master
jinnnh's profile imagejinnnh
2017-03-22 22:00
-
자주쓰는 git 명령어
git 명령어 command 전체 설정 확인 git config --global -l 저장소 url 변경 git remote set-url <name> <url> git remote set-url origin https://github.com/gutmate/gutmate.github.io.git 사용자 이름 변경 git config --global user.name <user.name> 사용자 이메일 변경 git config --global user.email <user.email> 상태 확인 git status 파일을 추적 대상에 등록 git add <file name> git add index.html 파일을 추적 대상에 등록(전체) git add . 커밋 git commit -m '<commit message>' git commit -m 'first commit' 서버에 업로드...
jinnnh's profile imagejinnnh
2017-03-21 16:00
-
엘리먼트 속성 가져오기
getComputedStyle() IE9 이상 var style = window.getComputedStyle(Element); console.log(style.width); console.log(style.backgrondColor); IE9 이하 window.onload = function () { if (!window.getComputedStyle) { window.getComputedStyle = function(element) { return element.currentStyle; } } }
jinnnh's profile imagejinnnh
2017-03-20 16:00
-
input file 디자인 입히기
<div class="filebox"> <input class="upload-name" value="파일선택" disabled="disabled"> <label for="ex_filename">업로드</label> <input type="file" id="ex_filename" class="upload-hidden"> </div> .filebox input[type="file"] { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); border: 0; } .filebox label { display: inline-block; padding: .5em .75em; color: #999; font-size: inherit; line-height: normal; vertical-align: middle; background-color: #fdfdfd; cursor: pointer; border: 1px solid #ebebeb; border-bottom-color: #e2e2e2; border-radius: .25em; } /* named upload */ .filebox .upload-name { display: inline-block; padding:...
jinnnh's profile imagejinnnh
2017-03-15 10:30
-
gitk 한글 깨짐 해결방법
gitbash 접속 명령어 입력 git config --global gui.encoding utf-8
jinnnh's profile imagejinnnh
2017-03-09 11:20
-
addEventListener, attachEvent
addEventListener, attachEvent 두 메소드의 기능은 같지만 브라우저마다 지원하는 메소드가 다르기 때문에 분기 처리 해주어야 한다. /** addEventListener * * IE9+, chrome * @param type {string} //이벤트 타입을 구분하기 위한 문자열 (ex click, blur, drag, drop, ...) * @param function {obj} //이벤트를 수신하여 처리할 객체, 해당 객체는 EventListener 인테페이스를 구현하거나 단순한 자바스크립트 함수여야 한다. * @param useCapture {boolean} //true = Capturing, false = Bubling, default = false */ element.addEventListener(type, function[, useCapture]); /** attachEvent * * IE8...
jinnnh's profile imagejinnnh
2017-03-07 10:40
-
iOS position fixed focus event issue
$.fn.mobileFix = function (options) { var $parent = $(this), $fixedElements = $(options.fixedElements); $(document) .on('focus', options.inputElements, function(e) { $parent.addClass(options.addClass); }) .on('blur', options.inputElements, function(e) { $parent.removeClass(options.addClass); // Fix for some scenarios where you need to start scrolling setTimeout(function() { $(document).scrollTop($(document).scrollTop()) }, 1); }); return this; // Allowing chaining }; // Only on touch devices if (Modernizr.touch) { $("body").mobileFix({ // Pass parent to apply to inputElements: "input, textarea", // Pass activation child elements addClass: "fixfixed" // Pass class...
jinnnh's profile imagejinnnh
2017-03-03 18:00
-
자바스크립트 카운트다운
Pure Javascript Countdown Example (Minute&Second Base) function countdown( elementName, minutes, seconds ) { var element, endTime, hours, mins, msLeft, time; function twoDigits( n ) { return (n <= 9 ? "0" + n : n); } function updateTimer() { msLeft = endTime - (+new Date); if ( msLeft < 1000 ) { element.innerHTML = "countdown's over!"; } else { time = new Date( msLeft ); hours = time.getUTCHours(); mins = time.getUTCMinutes(); element.innerHTML = (hours ?...
jinnnh's profile imagejinnnh
2017-02-28 10:55
-
jQuery 이미지 애니메이션
jQuery image animation 이미지 src값의 증가하는 숫자의 범위는 0000~9999 까지로 하며 파일명 또한 0000~9999까지로 만든다. (네자리 숫자) imgname0000.jpg / imgname-0001.gif / imgname_0002.png… 이미지 확장자는 png/jpg/gif 로 한다. @var rePath; [첫번째 문자] ~ [4자리 숫자.] 전까지의 값을 반환 (4자리 숫자.png/jpg/gif ([ex] 0000.jpg)는 반환값에 포함되지 않는다.) ;(function(global, $){ 'use strict'; var plugin_name = 'animationImg'; var run = false; if (!$.fn[plugin_name]) { $.fn[plugin_name] = function(settings) { if(!run) { //실행여부 체크 run = true; var $this = $(this); var...
jinnnh's profile imagejinnnh
2017-02-25 17:00
-
jQuery plugin 만들기
jQuery 플러그인 제작 프로세스 0. 영역 내, $ 별칭 보호 (function(global, $){ 'use strict'; // $ === window.jQuery })(window, window.jQuery); 1. 플러그인 기본형 쉘 작성 (function(global, $){ 'use strict'; var plugin_name = ''; if ( !$.fn[plugin_name] ) { $.fn[plugin_name] = function() { // 플러그인 코드 }; } })(window, window.jQuery); 2. 체이닝 설정 (function(global, $){ 'use strict'; var plugin_name = ''; if ( !$.fn[plugin_name] ) { $.fn[plugin_name] = function() { // jQuery 체이닝 설정 return this;...
jinnnh's profile imagejinnnh
2017-02-24 10:30
-
background-image animation keyframes
background-image로 @keyframes 이용해서 animation 구현하기 (gif) 적용방법 무한반복 (infinite) n = 총 frame 수 STEPS = n PERCENT = ( ( 100 / (n-1) ) + 100) % div { animation: gifAnimation 1s steps(STEPS) infinite; } @keyframes gifAnimation { 0% { background-position: 0 0; } 100% { background-position: PERCENT 0; } } 한번만 실행 (1) n = 총 frame 수 STEPS = n-1 PERCENT = 100% //fix 100% div { animation: gifAnimation 1s steps(STEPS) 1...
jinnnh's profile imagejinnnh
2017-02-21 16:00
-
jquery.fn
애니메이션 (background-image) /** * @param SECTION {number} * @param WIDTH {number} * @param TIME {number} * @param DELAY {number} * @param STOP {number} */ $.fn.aniJin = function (SECTION, WIDTH, TIME, DELAY, STOP){ TIME = TIME || 200; var num = 0; var playing = null; var $this = $(this); var repeat = setInterval(ani, TIME); function ani() { var bpx = parseInt($this.css("backgroundPositionX")); //백그라운드의 현재 위치값 $this.css({ backgroundPositionX: "-=" + SECTION }); //반복되는 구간 만큼 백그라운드 이동...
jinnnh's profile imagejinnnh
2017-02-20 11:00
-
Markdown code tag color
code tag color
jinnnh's profile imagejinnnh
2017-01-01 17:25