DEV

    docker compose 설치

    CentOS 7 sudo curl -L "https://github.com/docker/compose/releases/download/1.29.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose sudo chmod +x /usr/local/bin/docker-compose docker-compose --version

    Error: "The sandbox is not in sync with the Podfile.lock..." after installing RestKit with cocoapods

    xCode project target 선택 후 Build Phases -> [CP] Check Pods Manifest.lock 에서 수정. Go to Build Phases -> Check Pods Manifest.lock and replace diff "${PODS_ROOT}/../Podfile.lock" "${PODS_ROOT}/Manifest.lock" > /dev/null to diff "${SRCROOT}/Podfile.lock" "${SRCROOT}/Pods/Manifest.lock" > /dev/null 출처 : https://stackoverflow.com/questions/21366549/error-the-sandbox-is-not-in-sync-with-the-podfile-lock-..

    EACCES: permission denied, unlink '~/src-cordova/platforms/ios/www/.gitignore'

    npm run cordova-prepare EACCES: permission denied, unlink '/Users/jaeuk/_works/ngstudy-student-v2-1006/src-cordova/platforms/ios/www/.gitignore' 위 오류 발생시 sudo chown -R $USER

    크롬 모바일 터치시 파란색 배경 제거

    크롬 모바일에서 터치, 클릭시 생기는 파란색 배경 제거 -webkit-tap-highlight-color: transparent;

    iOS iframe height

    iOS 특정 버전에서 iframe이 부모 엘리먼트의 height 보다 커지는 현상이 있음.

    한글을 포함하고 있는지 검사

    function has_hangul($str) { return preg_match('![\x{1100}-\x{11FF}\x{3130}-\x{318F}\x{AC00}-\x{D7AF}]+!u', $str)?true:false; } # bool(true) var_dump( has_hangul('Hello 친구들!') ); var_dump( has_hangul('1234 ㄱㄴㄷ') ); var_dump( has_hangul('ㅏㅑㅓㅕ') ); # bool(false) var_dump( has_hangul('Hello World!') ); var_dump( has_hangul('日') ); var_dump( has_hangul('に') ); var_dump( has_hangul('★') ); 출처 : https:..

    자바스크립트 큰 수 팩토리얼

    자바스크립트에서 큰 수 표현시 e+, e- 등 지수 표현됨. extraLongFactorials(n) { let memoization = [BigInt(0), BigInt(1)]; const factorial = num => (typeof memoization[num] !== 'number') ? ((num - BigInt(1)) > 0 ? (num * factorial(num - BigInt(1))) : BigInt(1) ) : memoization[num] return String(factorial(BigInt(n))); }, 100! = 9332621544394415268169923885626670049071596826438162146859296389521759999322991560894146397..

    flutter doctor

    flutter doctor

    android studio (not installed) >> android studio 설치 폴더 경로 지정 flutter config --android-studio-dir="C:\Program Files\Android\Android Studio" android toolchain - develop for android devices >> sdk tools 설치 android licenses flutter doctor --android-licenses y 계속 눌러준다 y y y y y y

    테이블별 로우 수, 용량

    SELECT table_name, table_rows, round(data_length/(1024*1024),2) as 'DATA_SIZE(MB)', round(index_length/(1024*1024),2) as 'INDEX_SIZE(MB)' FROM information_schema.TABLES WHERE table_schema = 'DB_name' GROUP BY table_name ORDER BY data_length DESC LIMIT 10; 출처 : https://nexthops.tistory.com/27

    마지막 update ID 구하기

    SET @update_id := null; UPDATE users SET name = 'value', id = (SELECT @update_id := id) WHERE name = 'blah' LIMIT 1; SELECT @update_id;

    select 태그 placeholder 효과

    Select your option Durr 출처: stackoverflow.com/questions/5805059/how-do-i-make-a-placeholder-for-a-select-box

    scrollbar 숨기기 (기능은 유지)

    ::-webkit-scrollbar { display: none; }

    배열에 값이 있는지 확인

    1. array_search // array_search는 index 반환 $arr = ["a", "b", "c"]; echo array_search("a", $arr); // return 0 echo array_search("c", $arr); // return 2 function test($val) { $arr = ["a", "b", "c"]; if (array_search($val, $arr)) { $res = 1; } else { $res = 2; } return $res; } echo test("b"); // return 1 echo test("c"); // return 1 echo test("a"); // return 2 -> a는 arr의 index 0, if(0)은 false이기 때문에 2..

    auto_increment 초기화

    ALTER TABLE [table] AUTO_INCREMENT = 1;

    SELECT 결과 INSERT 하기

    모든 컬럼 복사 (컬럼 구조 일치 해야 함) INSERT INTO test_A SELECT * FROM test_B 지정 컬럼 복사 (where 절 생략 가능) INSERT INTO test_A (id, pw, postdate) SELECT id, pw, now() FROM test_B WHERE id = 'test';

    Crontab php 실행시키기

    crontab -e 사전 설치 yum install wget * * * * * wget -O - -q -t 1 http://주소/파일명.php -------------------------------------------------------------------- * * * * * php 파일명.php

    파비콘 (바로가기 만들기 깨짐 현상)

    1. 192x192 사이즈 / 32x32 사이즈 png 준비. 2. www.xiconeditor.com/ 에서 32사이즈 png -> ico로 변환. 3. www.favicon-generator.org/ 에서 192 사이즈 png -> ico 변환. * 3번 과정에서 다운로드한 favicon.ico 가 육안으로 깨져보일때 2번에서 생성한 favicon.ico로 대체.

    Custom 드롭다운

    //드랍 메뉴var drop_menu_data = "";var drop_menu_num = ""; function drop_menu(obj){ drop_menu_data = $(obj).text();drop_menu_num = $(obj).parent().prev().children().attr('name').replace("crawling_status", ""); var drop_top = $(obj).offset().top - 70;var drop_left = $(obj).offset().left - (($("#drop").outerWidth() - $(obj).width()) / 2); var droparrow_top = drop_top + $("#drop").outerHeight();var dro..

    Safari new Date 형 변환시 NaN

    # 사파리, IE8 이하 var today = new Date(); //현재시간 var sqlday = new Date(result[q]['wr_datetime'].replace(/-/g, '/')); // 글 시간 var timegap = today.getTime()- sqlday.getTime(); // 시간차 var sec_gap = Math.floor(timegap/1000); // 초 차이var min_gap = Math.floor(timegap/60000); // 분 차이var hour_gap = Math.floor(min_gap/60); // 시간 차이var day_gap = Math.floor(timegap / (1000 * 60 * 60 * 24)); // 일수 var result_tim..

    반응형 테이블

    #html 이름 반응형 #css @media all and (max-width: 768px){ .mt thead{display: none;} .mt tbody tr td{display: block;} /* 한 줄 */ /* .mt tbody tr td{display: inline-block; width: 50%;} */ /* 여러 줄 */ .mt tbody tr td:before { content: attr(data-label); float: left; font-weight: bold; text-transform: uppercase; } }https://codepen.io/anon/pen/dZrozW