Skip to content

Instantly share code, notes, and snippets.

View stevederico's full-sized avatar

Steve Derico stevederico

View GitHub Profile
@stevederico
stevederico / appledocHTML.mdown
Created June 1, 2012 06:45
AppleDoc HTML Only

appledoc --project-name SDKit --project-company "Bixby Apps" --company-id com.bixbyapps --verbose 6 --no-create-docset --create-html --output ./Documentation .

@stevederico
stevederico / LayerCakeScript
Created April 17, 2012 16:49
LayerCake Rename Layers Photoshop Script
//LayerCake Rename PhotoShop Script by Steve Derico http://www.stevederico.com
Credits:
// Rename Layers - Adobe Photoshop Script
// Requirements: Adobe Photoshop CS, or higher
// Description: renames and numbers all layers in the active document (using the supplied name pattern)
// Author: Trevor Morris (trevor@morris-photographics.com)
// Website: http://morris-photographics.com/
// ============================================================================
// Installation:
@stevederico
stevederico / gist:1722199
Created February 2, 2012 07:35
Reachability checkForNetwork
- (BOOL)checkForNetwork {
//Check for Internet
Reachability *wifiReach = [Reachability reachabilityForInternetConnection];
NetworkStatus netStatus = [wifiReach currentReachabilityStatus];
switch (netStatus) {
case NotReachable:{
@stevederico
stevederico / ParseObjectWebForm.html
Created January 28, 2012 23:10
Parse Object Web Form
<!DOCTYPE html>
<!-- This is Simple Create Object Web Form for Parse.com-->
<!-- Step 1 Insert Parse APP ID -->
<!-- Step 2 Insert Parse REST API KEY -->
<!-- Step 3 Insert Parse Class Name -->
<!--Javascript POST Code from Kevin Lacker - http://blog.parse.com/2012/01/19/javascript-and-user-authentication-for-the-REST-API/ -->
<html>
@stevederico
stevederico / gist:1680080
Created January 26, 2012 00:48
UITextField Phone Number Formatter
-(BOOL)textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string{
SDTextFieldCell *phoneCell = (SDTextFieldCell*)[self.tableView cellForRowAtIndexPath:[NSIndexPath indexPathForRow:1 inSection:0]];
if (textField != phoneCell.textField) {
return YES;
}
NSCharacterSet *nonNumberSet = [[NSCharacterSet characterSetWithCharactersInString:@"0123456789."] invertedSet];
if (range.length == 1){
@stevederico
stevederico / gist:1592353
Created January 11, 2012 01:19
Rate in App Store Code
- (void)rateInAppStore {
NSString *idString = @"999999999";
NSString *countrtyString = @"us";
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:[NSString stringWithFormat:@"http://itunes.apple.com/%@/app/id%@?mt=8", countrtyString, idString]]];
}
@stevederico
stevederico / UImage resizeWithRatio
Created October 20, 2011 21:14
Great UIImage Resize Method
// Resizes the image according to the given content mode, taking into account the image's orientation
- (UIImage *)resizedImageWithContentMode:(UIViewContentMode)contentMode imageToScale:(UIImage*)imageToScale bounds:(CGSize)bounds interpolationQuality:(CGInterpolationQuality)quality {
//Get the size we want to scale it to
CGFloat horizontalRatio = bounds.width / imageToScale.size.width;
CGFloat verticalRatio = bounds.height / imageToScale.size.height;
CGFloat ratio;
switch (contentMode) {
case UIViewContentModeScaleAspectFill:
ratio = MAX(horizontalRatio, verticalRatio);