Skip to content

Instantly share code, notes, and snippets.

View bradya's full-sized avatar

Brady Archambo bradya

  • Slack
  • San Francisco, CA
View GitHub Profile
import plistlib
# Read Plists
myAppInfoPlist = plistlib.readPlist(“MyApp/Info.plist”)
watchKitExtensionInfoPlist = plistlib.readPlist(“WatchKitExtension/Info.plist”)
watchKitAppInfoPlist = plistlib.readPlist(“WatchKitApp/Info.plist”)
# Update Watch Kit Extension Plist
watchKitExtensionInfoPlist[“NSExtension”][“NSExtensionAttributes”][“WKAppBundleIdentifier”] = watchKitAppInfoPlist[“CFBundleIdentifier”]
watchKitExtensionInfoPlist[“CFBundleVersion”] = myAppInfoPlist[“CFBundleVersion”]
@bradya
bradya / gist:699e0a6250e0a4e2bc41
Created January 28, 2015 05:04
Clearing queues
+ (void)pauseAndEmptyQueues
{
NSOperationQueue *mainOperationQueue = [[SLKDataRepository sharedRepository] mainOperationQueue];
NSOperationQueue *backgroundOperationQueue = [[SLKDataRepository sharedRepository] backgroundOperationQueue];
NSOperationQueue *readOperationQueue = [[SLKDataRepository sharedRepository] readOperationQueue];
[mainOperationQueue setSuspended:YES];
[backgroundOperationQueue setSuspended:YES];
[readOperationQueue setSuspended:YES];
@bradya
bradya / gist:0f17bb779efd92c3f7b5
Created January 28, 2015 02:38
Core Data queue abstraction
#pragma mark - Block Methods
/*
When we team switch, we want to completely stop in-progress data changes
E.g. if we're dumping the cache on Team A and you switch teams, we use
[SLKTeam currentTeam] throughout the app, and when that code executes, it'll
do stuff for the wrong team.
Core Data doesn't provide direct access to the MOC queues, so we implement
our own queues on top of the MOC queues which gives us the ability to
i6b6NJXU7WheXu2MQoYX
https://ratch.slack.com/services/hooks/slackbot?token=dttZCflwdFiFZ95BW8lRkQmy&channel=%23general
@bradya
bradya / gist:1225784
Created September 19, 2011 00:58
Glitch Run - Jump landing animation glitch
Issue:
We run the landing animation once we hit the ground. In Glitch, it doesn't look like we run this animation (from what I can tell, we need to talk to Eric) when we land from a normal height jump.
Observed incorrect behaviors because of this:
- It takes about a third of a second to actually look like we're running again when we're running, resulting in animation inconsistent with Glitch
- Landing on a rock, then falling directly down to the ground causes the character to glitch out a bit
Results of fix:
@bradya
bradya / gist:1225782
Created September 19, 2011 00:57
Glitch Run - Jump lift animation glitch
Issue:
When we jump, we were animating a jump lift, then running, then a jump lift again
Observed incorrect behaviors because of this:
Several frames looked odd during the actual jump
Results of fix: