Dirty Game Development Tricks

Ratchet and Clank: Up Your Arsenal was an online title that shipped without the ability to patch either code or data. Which was unfortunate. The game downloads and displays an End User License Agreement each time it’s launched. This is an ascii string stored in a static buffer. This buffer is filled from the server […]

Custom UINavigationController back buttons under iOS7

When you first create / get a reference to the navigation controller, set a global custom back image (replaces the chevron) with: [self.navigationController.navigationBar setBackIndicatorImage: [UIImage imageNamed:@”CustomerBackImage”]]; [self.navigationController.navigationBar setBackIndicatorTransitionMaskImage: [UIImage imageNamed:@”CustomerBackImage”]]; The title of the back button is owned by the view that it points to, not the current view. You can make it blank by […]

Programmatically adding a PagerTabStrip or PagerTitleStrip to a ViewPager on Android

The Lanyrd Android app does the majority of its layout programatically, because the views are described by a JSON file sent from the server. There aren’t a lot of resources on how to build a set of swipe-able views with a PagerTabStrip programmatically, so here’s what I’m doing: pager = new ViewPager(context); // ViewPagers must […]

renewing ACAccount credentials on iOS

An iOS 5/6 device can have system-level Twitter/Facebook accounts that become disassociated from the underlying service accounts. This means that the ACAccountStore framework will return you ACAccount objects that can be used to sign requests and get access tokens, but NONE OF THE REQUESTS WILL WORK and you’ll get MYSTERIOUS OAUTH ERRORS and LOTS OF […]

Automatically activating a Python virtualenv

I have a lot of different python projects in a lot of different directories, and like them all to have their own virtualenv. Because I can’t even be bothered to type a single line of code to activate them, I’ve ended up with this (slightly insane) setup: Every project folder has a ./venv/ which is […]