본문 바로가기

[tistory] Github - Gist를 이용한 소스코드 올리기 1 Gist 한참전만해도 Syntax Highlighter를 사용해서 소스코드를 올리고는 했어요. 그런데 잘되가다도 한번씩은 꼭 태그가 삑이 나서 전체 코드가 깨지는 현상도 발생했었는데 그게 너무 짜증나서 요즘은 Gist를 사용합니다. Gist의 장점은 우선 쉽다! 코드입력 후 Gist를 생성하면 자동으로 해당코드의 Embed 주소가 부여되는데, 그 주소를 티스토리의 글쓰기상에서 외부컨텐츠 메뉴를 이용해 붙여넣기만 하면 끝납니다. 우선 Gist 사이트로 이동! Gist : https://gist.github.com/ 위 링크로 이동하면 다음과같은 화면을 볼수있어요. 나는 Github도 사용하기 때문에 로그인 되어있는 상태이지만 Gist만을 사용할 것이라면 굳이 회원가입을 할 필요는 없습니다. 링크를 타고.. 더보기
[swift3] convert Dictionary to Data, Data to String in swift3 1. Dictionary to Datalet dataExample: Data = NSKeyedArchiver.archivedData(withRootObject: dictionaryExample)2. Data to Dictionarylet dictionary: Dictionary? = NSKeyedUnarchiver.unarchiveObject(with: dataExample) as! [String : Any]3. String to Datavar somedata = testString.data(using: String.Encoding.utf8)4. Data to Stringvar backToString = String(data: somedata!, encoding: String.Encoding.utf8) .. 더보기
[iOS]Pods framework not found ... error 1. CocoaPods 다운로드 - sudo gem install cocoapods 2. CocoaPods 설치 - pod setup 3. CocoaPods profile 생성 - pod init 4. 생성된 CocoaPods profile 에 라이브러리 설정# platform :ios, '6.0' 더보기
[android] JSONObject 형식의 String에 탭 넣기. _ Insert tab into JSONObject String parsing된 data가 JSONObject 형식 또는 JSONObject 형식의 String 일 경우. 또는 JSONObject로 변환 가능한 모든 데이터 클레스. 일단 어떤 형식이든 JSONObject 형으로 변환이 먼저 필요하다. GSON Library가 있으면 변환가능. https://github.com/google/gson 참조 JSON String -> new JSONObject(JSON String); data class -> new JSONObject(new Gson().toJson(data class)); 변환된 JSONObejct 구분자에 탭을 포함한 String 으로 변환. JSONObject.toString(4); // 일반적으로 Tab Size는 4 변환 전 {"key":{"ke.. 더보기
자주 사용하는 Android Studio for Mac 단축키 모음 자주 사용하는 Android Studio for Mac 단축키 모음 ---------------------------------------------------------- 이동/복사/수정 ----------------------------------------------------------관련부분 전체 변수/메서드/클래스 명 변경 : shift + F6한줄주석 : command + / 블럭주석 : control + shift + /라인복사 : command + D라인삭제 : command + delete라인이동 : option + shift + 화살표(위, 아래)이전 작업/다음 작업 : command + option + 화살표변수명 전체 변경 : shif + F6 --------------------.. 더보기