Skip to content

Instantly share code, notes, and snippets.

View sthorne's full-sized avatar

Sean Thorne sthorne

View GitHub Profile
@sthorne
sthorne / gist:71b272b35e55dceb3ac6
Created February 20, 2015 17:06
Copy iOS AddressBook into NSArray
CFErrorRef error = NULL;
ABAddressBookRef addressBook = ABAddressBookCreateWithOptions(nil, &error);
if (error != NULL) {
NSLog(@"Error reading AddressBook: %@", error);
}
CFArrayRef contacts = ABAddressBookCopyArrayOfAllPeople(addressBook);
NSArray contactArray = CFBridgingRelease(contacts);
@sthorne
sthorne / gist:122106bcdaec62c695cc
Created February 20, 2015 16:56
Read a file and Escape each line
package main
import (
"os"
"fmt"
"bufio"
"strconv"
)