Skip to content

Instantly share code, notes, and snippets.

View acf's full-sized avatar

Alan Francis acf

View GitHub Profile
@acf
acf / gist:3756431
Created September 20, 2012 15:00
Alans Office Lego
Lego
Set No, Name, Brick Count
Ultimate Collector Series
-------------------------
10019 UCS Blockade Runner 1747
10030 UCS Star Destroyer 3096
10179 UCS Millenium Falcon 5195
10188 UCS Death Star 3803
[MagicalRecord saveWithBlock:^(NSManagedObjectContext* localContext) {
LSUser* currentUser = nil;
NSDictionary* apiKeyDic = [[ACSimpleKeychain defaultKeychain] credentialsForIdentifier:@"api_key" service:@"MerchantCenter"];
if( apiKeyDic != nil ) {
NSString* email = [apiKeyDic objectForKey:ACKeychainUsername];
if( email != nil ) {
currentUser = [LSUser MR_findFirstByAttribute:LSUserAttributes.email withValue:email inContext:localContext];
NSLog(@"USER HAS VOUCHERS: %ld", [LSVoucher MR_countOfEntitiesWithPredicate:[NSPredicate predicateWithFormat:@"user = %@", currentUser]]);
}
}
@acf
acf / dnsimple-rename.rb
Created December 9, 2011 19:30
s/old.ip/new.ip/g in a DNSimple account
require 'rubygems'
require 'dnsimple'
DNSimple::Client.username = 'randall@rstvideo.com'
DNSimple::Client.password = 'd34thst4r'
DNSimple::Client.debug = false
user = DNSimple::User.me
puts "#{user.domain_count} domains"
@interface MyCellController : NibBasedCellController {
Class _controllerClass;
GithubAccount* _githubAccount;
}
@end