I hereby claim:
- I am shepting on github.
- I am stevenhepting (https://keybase.io/stevenhepting) on keybase.
- I have a public key whose fingerprint is 8148 34C8 3A9B E695 9FB2 D301 5FED 5668 FAF9 8F49
To claim this, I am signing this object:
| #import <TwitterKit/TwitterKit.h> | |
| @implementation ViewController | |
| - (void)viewDidLoad { | |
| [super viewDidLoad]; | |
| self.view.backgroundColor = [UIColor lightGrayColor]; | |
| // Standard TWTRTimelineViewController setup |
| // | |
| // main.swift | |
| // NodeTraversal | |
| // | |
| // Created by Steven Hepting on 11/16/15. | |
| // Copyright © 2015 Steven Hepting. All rights reserved. | |
| // Algorithm from http://bit.ly/1kSdSvc | |
| // | |
| import Foundation |
| // When using Charles, the network requests will always fail unless you can bypass ATS. | |
| public class NetworkEnabler: NSObject, NSURLSessionDelegate { | |
| public func URLSession(session: NSURLSession, didReceiveChallenge challenge: NSURLAuthenticationChallenge, completionHandler: (NSURLSessionAuthChallengeDisposition, NSURLCredential?) -> Void) { | |
| completionHandler(.UseCredential, NSURLCredential(trust: challenge.protectionSpace.serverTrust!)) | |
| } | |
| } | |
| // Then later when making a request: | |
| let enabler = NetworkEnabler() | |
| let session = NSURLSession(configuration: NSURLSession.sharedSession().configuration, delegate: enabler, delegateQueue: nil) |
| [[Twitter sharedInstance] logInWithCompletion:^(TWTRSession *session, NSError *error){ | |
| // Ensure the auth worked | |
| if (session) { | |
| NSLog(@"Twitter Session %@ / %@ found", session.authToken, session.authTokenSecret); | |
| } else { | |
| NSLog(@"Login error: %@", error); | |
| } | |
| // Get a random image | |
| UIImage *corgiImage = [UIImage imageNamed:@"Corgis_Small.jpeg"]; |
I hereby claim:
To claim this, I am signing this object:
| // Playground - noun: a place where people can play | |
| import UIKit | |
| let lettersArray = Array("ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz") | |
| func rot13(input: String) -> String { | |
| return reduce(input, "", { result, letter in | |
| if let i = find(lettersArray, letter) { | |
| return result + String(lettersArray[i + 13]) |
| git log --author=Steven --since=2.weeks --no-merges --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' |
| // Playground - noun: a place where people can play | |
| let lettersArray = Array("ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz") | |
| func rot13(input: String) -> String { | |
| return reduce(input, "") { result, letter in | |
| if let i = find(lettersArray, letter) { | |
| return result + lettersArray[i + 13] | |
| } else { | |
| return result + letter |
| # Print all the views in the window | |
| command regex rd 's/^[[:space:]]*$/po [[[UIApplication sharedApplication] keyWindow] recursiveDescription]/' 's/^(.+)$/po [%1 recursiveDescription]/' | |
| # Print all the view controllers in the window | |
| command regex rvc 's/^[[:space:]]*$/po [[[UIApplication sharedApplication] keyWindow] recursiveDescription]/' 's/^(.+)$/po [%1 _viewControllerForAncestor]/' | |
| # Print an autolayout trace | |
| command alias at expr -o -- [[UIWindow keyWindow] _autolayoutTrace] | |
| # Load the dynamic code for Reveal |