Skip to content

Instantly share code, notes, and snippets.

@dpettigrew
dpettigrew / carthage.sh
Created June 3, 2015 21:18
Script for conditionally calling "carthage update" or "carthage copy-frameworks" based upon modifications to the Cartfile
#!/bin/sh
export PATH=/opt/local/bin/:/opt/local/sbin:$PATH:/usr/local/bin:
carthagePath=`which carthage`
if [[ ! -f ${carthagePath} ]]; then
echo "ERROR: You need to install Carthage first, you can use brew to simplify process:
brew install carthage, OR,
download package from https://github.com/Carthage/Carthage"
exit 0;
@dpettigrew
dpettigrew / gist:9591636
Created March 16, 2014 23:53
Log UIInterfaceOrientation and StatusBarOrientation
- (void)logInterfaceOrientation {
if (self.interfaceOrientation == UIInterfaceOrientationPortrait) {
NSLog(@"UIInterfaceOrientationPortrait");
}
if (self.interfaceOrientation == UIInterfaceOrientationPortraitUpsideDown) {
NSLog(@"UIInterfaceOrientationPortraitUpsideDown");
}
if (self.interfaceOrientation == UIInterfaceOrientationLandscapeLeft) {
NSLog(@"UIInterfaceOrientationLandscapeLeft");
}
@dpettigrew
dpettigrew / UIButton+AFNetworking.h
Created June 13, 2012 19:11
UIButton Category for AFNetworking adds - (void)setImageWithURL:(NSURL *)url placeholderImage:(UIImage *)placeholderImage forState:(UIControlState)state
//
// UIButton+AFNetworking.h
//
// Created by David Pettigrew on 6/12/12.
// Copyright (c) 2012 ELC Technologies. All rights reserved.
//
// Based upon UIImageView+AFNetworking.h
//
// Copyright (c) 2011 Gowalla (http://gowalla.com/)