Skip to content

Instantly share code, notes, and snippets.

View command-tab's full-sized avatar

Collin Allen command-tab

View GitHub Profile
#import <Foundation/Foundation.h>
#import "AFNetworking.h"
int main(int argc, const char *argv[])
{
@autoreleasepool {
NSURL *url = [NSURL URLWithString:@"https://api.github.com/users/AFNetworking/repos"];
NSURLRequest *request = [NSURLRequest requestWithURL:url];
AFJSONRequestOperation *operation = [AFJSONRequestOperation JSONRequestOperationWithRequest:request success:^(NSURLRequest *request, NSHTTPURLResponse *response, id JSON) {
NSLog(@"success: %@", JSON);
@command-tab
command-tab / gist:2370710
Created April 12, 2012 20:17
Extract Certificate Subject from a Provisioning Profile
# Parse a provisioning profile
# Extract the first DeveloperCertificates <data> entry
# Remove any leading whitespace
# Remove any blank lines
# Base64 decode the blob
# Parse the .cer with OpenSSL
# Extract the first line, which is the certificate subject (the rest is the cert blob)
# End up with a string like: subject= /UID=AABBCCDDEE/CN=iPhone Developer: First Last (FFGGHHIIJJ)/C=US
# Note: Uses xmlstarlet to parse the plist, but you could probably use PlistBuddy or grep, too