$ xcode-select --install
$ sudo xcode-select -s /Applications/Xcode-beta.app/Contents/Developer
$ xcode-select -p
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import java.io.FileDescriptor; | |
| import java.io.FileOutputStream; | |
| import java.io.IOException; | |
| import java.io.OutputStream; | |
| import java.io.PrintStream; | |
| public class HelloWorld{ | |
| private static HelloWorld instance; | |
| public static void main(String[] args){ | |
| instantiateHelloWorldMainClassAndRun(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| - (NSString *)description { | |
| __block NSMutableString *displayString = [NSMutableString stringWithFormat:@"curl -v -X %@", self.HTTPMethod]; | |
| [displayString appendFormat:@" \'%@\'", self.URL.absoluteString]; | |
| [self.allHTTPHeaderFields enumerateKeysAndObjectsUsingBlock:^(id key, id val, BOOL *stop) { | |
| [displayString appendFormat:@" -H \'%@: %@\'", key, val]; | |
| }]; | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 1. Open Terminal | |
| 2. cd to your Xcode project | |
| 3. Execute the following when inside your target project: | |
| find . -name "*.swift" -print0 | xargs -0 wc -l |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // MARK: - Swizzling | |
| extension UIFont { | |
| class var defaultFontFamily: String { return "Georgia" } | |
| override public class func initialize() | |
| { | |
| if self == UIFont.self { | |
| swizzleSystemFont() | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| extension UIScreen { | |
| class func screenshot() -> UIImage { | |
| let view = mainScreen().snapshotViewAfterScreenUpdates(false) | |
| UIGraphicsBeginImageContext(view.bounds.size) | |
| view.drawViewHierarchyInRect(view.bounds, afterScreenUpdates: true) | |
| let screenshot = UIGraphicsGetImageFromCurrentImageContext() | |
| UIGraphicsEndImageContext() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| sudo yum install autoconf aclocal automake | |
| sudo yum install libtool | |
| sudo yum install libjpeg-devel libpng-devel libtiff-devel zlib-devel | |
| cd ~/downloads | |
| wget http://www.leptonica.com/source/leptonica-1.72.tar.gz | |
| tar -zxvf leptonica-1.72.tar.gz | |
| cd leptonica-1.72 | |
| ./configure | |
| make | |
| sudo make install |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| A view controller cannot segue to another controller without presenting itself. | |
| https://stackoverflow.com/questions/8221787/perform-segue-on-viewdidload | |
| https://stackoverflow.com/questions/10428629/programatically-set-the-initial-view-controller-using-storyboards | |
| func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ''' people export''' | |
| import base64 | |
| import csv | |
| import sys | |
| import time | |
| import urllib # for url encoding | |
| import urllib2 # for sending requests | |
| try: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // | |
| // CURLDebug.swift | |
| // | |
| // Created by apple on 02/06/16. | |
| // Copyright © 2016 Rodrigo Reis. All rights reserved. | |
| // | |
| import Foundation | |