Skip to content

Instantly share code, notes, and snippets.

View coreyfloyd's full-sized avatar

Corey Floyd coreyfloyd

View GitHub Profile
- (IBAction)gotoReviews:(id)sender
{
NSString *str = @"itms-apps://ax.itunes.apple.com/WebObjects/MZStore.woa";
str = [NSString stringWithFormat:@"%@/wa/viewContentsUserReviews?", str];
str = [NSString stringWithFormat:@"%@type=Purple+Software&id=", str];
// Here is the app id from itunesconnect
str = [NSString stringWithFormat:@"%@289382458", str];
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:str]];
}
UIImage* bottomImage = [UIImage imageNamed:@"bottom.png"];  
UIImage* topImage    = [UIImageNamed:@"top.png"];
UIImageView* imageView = [[UIImageView alloc] initWithImage:bottomImage];
UIImageView* subView   = [[UIImageView alloc] initWithImage:topImage];
subView.alpha = 0.5;  // Customize the opacity of the top image.
[imageView addSubview:subView];
UIGraphicsBeginImageContext(imageView.frame.size);
[imageView.layer renderInContext:UIGraphicsGetCurrentContext()];
UIImage* blendedImage = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
@coreyfloyd
coreyfloyd / gist:3369006
Created August 16, 2012 09:55
LIOLI spec

#Summary This app is used to sign in to their loseitorloseit.com account and post weigh ins to a remote API. Data will be formatted as JSON. Only the user's credentials will be persited locally. All other data will be fetched from the API as needed.

###Sign In Users can sign in, but cannot create accounts.

###Pending Weigh In Users are required to post periodic weigh ins. The app will let the user know if they have a pending weigh in or not.

###Weigh Ins

Model Objects should be dumb - minimal logic
Model Controllers should perform model manipulations that are UI independent (like network and processing) exception: user input
No Story Boards
Implement classes with dependency injection - favor providing all data at instantiation
Code for iOS 6 - will back port to iOS 5 as necessary
platform :ios, :deployment_target => '5.0'
set_arc_compatibility_flag!
pod 'MMDrawerController'
#Utilities
pod 'MTDates'
#pod 'NSDate+Helper'
pod 'BlocksKit' #includes alert blocks
platform :ios, :deployment_target => '5.0'
#platform :osx, :deployment_target => '10.8'
#Utilities
pod 'FJCode'
pod 'MTDates'
#pod 'NSDate+Helper'
pod 'BlocksKit' #includes alert blocks
pod 'ObjectiveSugar' #ruby syntax
@coreyfloyd
coreyfloyd / git.txt
Last active December 17, 2015 13:19
git
current commit sha
git rev-list --max-count=1 HEAD
git rev-parse HEAD
keep added files after stash
git stash --keep-index
only stash un-added files
git stash -k

Task create one clase with the 2 methods below. ARC, iOS 7 only

#Class
PQHTMLParser

##Method 1

- (NSString*)plainTextFromHTML:(NSString*) html;
parameter: a string containing html

HTTP/1.1 200 OK
Transfer-Encoding: chunked
Content-Type: text/html; charset=UTF-8
Content-Encoding: gzip
Vary: Accept-Encoding
Server: Microsoft-IIS/7.5
X-Powered-By: ASP.NET
Date: Wed, 09 Apr 2014 13:37:56 GMT
<style>