Skip to content

Instantly share code, notes, and snippets.

View kcharwood's full-sized avatar

Kevin Harwood kcharwood

View GitHub Profile
@kcharwood
kcharwood / gist:4739785
Last active December 12, 2015 07:49
Custom AFOperation
-(void)setCompletionBlockWithSuccess:(void (^)(AFHTTPRequestOperation *, id))success
failure:(void (^)(AFHTTPRequestOperation *, NSError *))failure {
void (^newSuccessBlock)(AFHTTPRequestOperation*, id) =
^(AFHTTPRequestOperation *operation, id responseObject){
NSError * customError = nil;
//Do some custom error processessing
if(customError){
if(nil != failure)
@kcharwood
kcharwood / gist:6139806
Created August 2, 2013 13:18
Post Install
post_install do |installer_representation|
installer_representation.project.targets.each do |target|
target.build_configurations.each do |config|
if (config.name.match(/[Dd]ebug/))
config.build_settings['GCC_OPTIMIZATION_LEVEL'] = 0
config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] = 'DEBUG=1 $(inherited)'
end
end
end
end
#import "MMNavigationController.h"
#import <MMDrawerController/UIViewController+MMDrawerController.h>
@interface MMNavigationController ()
@end
@implementation MMNavigationController

Keybase proof

I hereby claim:

  • I am kcharwood on github.
  • I am kevinharwood (https://keybase.io/kevinharwood) on keybase.
  • I have a public key whose fingerprint is 3536 90A1 571F 0DF3 6506 DE79 D24F 5B9B 0409 1B58

To claim this, I am signing this object:

@kcharwood
kcharwood / UITestExtension.swift
Last active August 29, 2015 14:26
With Xcode 7 Beta 4, Apple gave us a way to wait asynchronously during UI tests. This gist lets you wait on an Activity Indicator to finish.
import Foundation
import XCTest
extension XCTestCase {
func waitForActivityIndicatorToStartAndFinishSpinning(activityIndicatorElement: XCUIElement, timeout: NSTimeInterval = 30.0) {
let inProgressPredicate = NSPredicate(format: "label = 'In progress'")
self.expectationForPredicate(inProgressPredicate, evaluatedWithObject: activityIndicatorElement, handler: nil)
self.waitForExpectationsWithTimeout(timeout, handler: nil)
@kcharwood
kcharwood / CarthageBuildError.log
Created September 14, 2015 16:00
Carthage Error from AlamoFireImage
Build settings from command line:
ONLY_ACTIVE_ARCH = NO
=== BUILD TARGET Alamofire OSX OF PROJECT Alamofire WITH CONFIGURATION Release ===
Check dependencies
Write auxiliary files
write-file /Users/kevin.harwood/Library/Developer/Xcode/DerivedData/Alamofire-acpuopyuaoxdkqdlgoskjqujijav/Build/Intermediates/Alamofire.build/all-product-headers.yaml
@kcharwood
kcharwood / upload_to_simplemdm.rb
Created October 10, 2017 18:31
SimpleMDM Fastlane Action
require "SimpleMDM"
module Fastlane
module Actions
module SharedValues
end
class UploadToSimplemdmAction < Action
def self.run(params)
SimpleMDM.api_key = "#{params[:api_key]}"