Sublime Text 2는 subl(왜 sublime이 아닌지는 의문)이라는 CLI(Command-lime interface)을 갖고있다. 이 유틸리티는 디폴트로 설치되는 다음과 같은 폴더에 위치한다.
open /Applications/Sublime\ Text\ 2.app/Contents/SharedSupport/bin/subl
물론 저 폴더에 있는 subl을 바로 사용하면 되겠지만 편리하게 사용할 수 있는 두가지 방법을 적어본다.
| find . -type f -exec wc -l {} + | sort -n |
| extension URLRequest { | |
| var curlDescription: String { | |
| get { | |
| var displayString = "curl -v -X \(self.httpMethod!)" | |
| if let absoluteUrl = self.url?.absoluteString { | |
| displayString += " '\(absoluteUrl)'" | |
| } | |
| if let allHTTPHeaderFields = self.allHTTPHeaderFields { | |
| let allHeadersKeys = Array(allHTTPHeaderFields.keys) | |
| let sortedHeadersKeys = allHeadersKeys.sorted() |
| openssl pkcs12 -clcerts -nokeys -out cert.pem -in cert.p12 | |
| openssl pkcs12 -nocerts -out key.pem -in key.p12 | |
| openssl rsa -in key.pem -out key.unencrypted.pem | |
| cat cert.pem key.unencrypted.pem > apns.pem |
| git config --global alias.lg "log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit" |
| // line | |
| @"line://msg/text/%@" | |
| // band | |
| @"bandapp://create/post/?text=%@ | |
| // kakao story | |
| @"storylink://posting?post=%@& // 글내용 | |
| appid=%@& // KAKAO_APP_KEY | |
| appver=%@& // 앱버전 |
| NSArray *locArgs = // from alert "loc-args" | |
| NSRange range = NSMakeRange(0, [locArgs count]); | |
| NSMutableData* data = [NSMutableData dataWithLength: sizeof(id) * [locArgs count]]; | |
| [locArgs getObjects: (__unsafe_unretained id *)data.mutableBytes range:range]; | |
| NSString *message = [[NSString alloc] initWithFormat:NSLocalizedString(locKey, nil) arguments:data.mutableBytes]; |
| NSString * encodedString = (NSString *)CFBridgingRelease(CFURLCreateStringByAddingPercentEscapes(NULL, | |
| (CFStringRef)queryString, | |
| NULL, | |
| (CFStringRef)@"!*'();:@&=+$,/?%#[]", | |
| kCFStringEncodingUTF8 )); |
| #import <CommonCrypto/CommonDigest.h> | |
| + (NSString*)sha256HashFor:(NSString*)input | |
| { | |
| const char* str = [input UTF8String]; | |
| unsigned char result[CC_SHA256_DIGEST_LENGTH]; | |
| CC_SHA256(str, (unsigned int)strlen(str), result); | |
| NSMutableString *ret = [NSMutableString stringWithCapacity:CC_SHA256_DIGEST_LENGTH*2]; | |
| for(int i = 0; i<CC_SHA256_DIGEST_LENGTH; i++) |
| # xcode-build-bump.sh | |
| # @desc Auto-increment the build number every time the project is run. | |
| # @usage | |
| # 1. Select: your Target in Xcode | |
| # 2. Select: Build Phases Tab | |
| # 3. Select: Add Build Phase -> Add Run Script | |
| # 4. Paste code below in to new "Run Script" section | |
| # 5. Drag the "Run Script" below "Link Binaries With Libraries" | |
| # 6. Insure that your starting build number is set to a whole integer and not a float (e.g. 1, not 1.0) |