Skip to content

Instantly share code, notes, and snippets.

View augustj's full-sized avatar

August Jaenicke augustj

  • Bay1
  • San Francisco
View GitHub Profile
@augustj
augustj / gist:4f2e0db660aec78150fa
Created November 25, 2014 23:42
A script to build, sign and upload to TestFlight
#!/bin/bash
#
# testflightapp.com tokens
# This one is per user (and is August's)
API_TOKEN="XXX"
TEAM_TOKEN="XXX"
PRODUCT_NAME="myAppName"
@augustj
augustj / gist:15ead6a7484b02748cd5
Created July 23, 2014 16:47
Category on UIView to enable accessibility on DEBUG builds for KIF testing
-(void)enableAccessibilityForIdentifier:(NSString *)identifier {
//This is only used to help with KIF testing, so we don't need/want them in production
#ifdef DEBUG
[self setValue:identifier forKey:@"accessibilityIdentifier"];
self.accessibilityLabel = identifier;
self.isAccessibilityElement = TRUE;
#endif
}
@augustj
augustj / gist:aff821523a4393eac136
Created July 23, 2014 16:45
KIF TestActor utils
-(void)stuffText:(NSString*)text intoViewWithAccessibilityLabel:(NSString*)label {
UITextField *field = (UITextField*)[tester waitForViewWithAccessibilityLabel:label];
field.text = text;
}
-(void)resetPersistentStore {
RKManagedObjectStore *objectStore = [[JSObjection defaultInjector] getObject:[RKManagedObjectStore class]];
NSError *error = nil;
[objectStore resetPersistentStores:&error];
if(error) {
@augustj
augustj / gist:66a416cb549a59db0cf8
Created July 23, 2014 16:44
KIF accessibilityElementExists
- (BOOL)accessibilityElementExists:(NSString *)label {
/* OK, so KIF doesn't have a built in "optional" test, nor does it have a friendly "If element exists".
* It was possible to wait for an element to exist and catch the exception, however if the element didn't exist the test would fail.
* This code is almost a direct copy/paste from UIAccessibilityElement-KIFAdditions, however it doesn't use errors
* - Max Chuquimia
*/
__block UIView *view = nil;
BOOL showing = TRUE;
@augustj
augustj / CFStoryboard.h
Last active August 29, 2015 14:03
CFStoryboard.h - UIStoryboard subclass that injects Objection dependcies
// The CFStoryboard header just declares that CFStoryboard extends UIStoryboard
#import <UIKit/UIKit.h>
@interface CFStoryboard : UIStoryboard
@end
@augustj
augustj / CFStoryboard.m
Last active August 29, 2015 14:03
CFStoryboard.m - UIStoryboard subclass that injects Objection dependcies
#import "Objection.h"
#import "CFStoryboard.h"
@implementation CFStoryboard
- (id)instantiateViewControllerWithIdentifier:(NSString *)identifier
{
NSLog(@"Injecting objects into UIViewController with identifier %@", identifier);
UIViewController *controller = [super instantiateViewControllerWithIdentifier:identifier];
[[JSObjection defaultInjector] injectDependencies:controller];
@augustj
augustj / CFStoryboard Usage
Last active August 29, 2015 14:03
Objection/DI Compatible Storyboard
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
JSObjectionInjector *injector = [JSObjection createInjector];
[JSObjection setDefaultInjector:injector];
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
self.window.backgroundColor = [UIColor whiteColor];
UIStoryboard *storyboard = [CFStoryboard storyboardWithName:@"Main" bundle:nil];
self.window.rootViewController = [storyboard instantiateViewControllerWithIdentifier:@"Splash"];
[self.window makeKeyAndVisible];
@augustj
augustj / gist:7833025
Created December 6, 2013 22:12
Sidekiq New Relic Plugin
#
#
# This is a sample newrelic_plugin.yml file. Please move this file
# to the following location if it is not already there:
#
# ./config/newrelic_plugin.yml
#
# Where the current directory is the directory where your main program resides and is your current
# directory when you run the main program.
#
@augustj
augustj / gist:7833010
Created December 6, 2013 22:10
Redis New Relic Plugin
# Please make sure to update the license_key information with the license key for your New Relic
# account.
#
# This configuration file holds examples for all plugins. You only need to uncomment
# the lines for the product you are using.
#
# Example configuration is shown below. Uncomment (remove #) the needed lines for
# your environment.
#
#
@augustj
augustj / gist:7832982
Created December 6, 2013 22:09
Upstart script for New Relic Redis agent
#
# This is provided as an example of a Ubuntu style upstart script
# You'll want to give it a more useful name
#
# pivotal_agent - myservice job file
description "Pivotal Monitoring Agent for New Relic"
author "Pivotal - https://github.com/gopivotal/newrelic_pivotal_agent/"
# Change this to the user running the agent