Skip to content

Instantly share code, notes, and snippets.

View ahmattox's full-sized avatar
🍤

Anthony Mattox ahmattox

🍤
View GitHub Profile
@ahmattox
ahmattox / NSObjectDescription.m
Created March 6, 2012 14:08
Extend Description for NSObject Subclasses
- (NSString *)description {
return [NSString stringWithFormat:@"<%@: %p; name = %@; location = (%f, %f)>", NSStringFromClass([self class]), self, name, loc.x, loc.y];
}
@ahmattox
ahmattox / TouchThroughView.h
Created March 6, 2012 14:13
UIViewSubclass which lets touches pass through it but not it's subviews.
//
// TouchThroughView.h
// Created by Anthony Mattox on 3/5/12.
//
#import <UIKit/UIKit.h>
@interface TouchThroughView : UIView
@property (nonatomic) BOOL touchThrough;
@ahmattox
ahmattox / script.js
Created May 22, 2012 15:49
Smooth scroll all links with internal anchors.
$(document).ready(function() {
$('a[href^="#"]').click(function(event) {
$('body').animate({
'scrollTop': $($(this).attr('href')).position().top - 20
}, 300);
event.preventDefault();
return false;
});
});
#!/bin/sh
# addDebugSettingsChild.sh
#
# Simple script to inject a Debug menu in an iPhone Settings plist.
#
# created 10.15.2008 by Andy Mroczkowski, mrox.net
THIS="`basename $0`"
PLISTBUDDY="/usr/libexec/PlistBuddy -x"
//
// AnimatedView.h
//
// Created by Anthony Mattox on 6/18/12.
// Copyright (c) 2012 Friends of The Web. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface ParticleView : UIView {
@ahmattox
ahmattox / SharedObject.h
Created July 30, 2012 19:18
GCD Shared Instance
#import <Foundation/Foundation.h>
@interface SharedObject : NSObject
+ (SharedObject *) sharedInstance;
@end
@ahmattox
ahmattox / UIColor+Additions.h
Created September 28, 2012 14:42
UIColor Additions
//
// UIColor+Additions.h
//
// Created by Anthony Mattox on 9/28/12.
// Copyright (c) 2012 Friends of The Web. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface UIColor (Additions)
@ahmattox
ahmattox / ListFonts.m
Created October 30, 2012 15:56
List all fonts and styles available on an iOS device.
- (void) listFonts {
NSArray *familyNames = [UIFont familyNames];
for (NSString *family in familyNames) {
NSLog(@"family: %@", family);
NSArray *styles = [UIFont fontNamesForFamilyName:family];
for (NSString *style in styles) {
NSLog(@" - %@", style);
}
}
}
@ahmattox
ahmattox / UITextField+SelectionRanges.h
Created January 5, 2013 19:35
UITextField category to handle selections with NSRanges. Adds methods to get an NSRange representing the current selection and to select a range of characters with an NSRange.
//
// UITextField+SelectionRanges.h
// Kitchen Unit Converter
//
// Created by Anthony Mattox on 1/5/13.
// Copyright (c) 2013 Friends of The Web. All rights reserved.
//
#import <UIKit/UIKit.h>
@ahmattox
ahmattox / FTWDropCapTextView.h
Last active September 16, 2016 16:36
Text View with Drop Caps UIView subclass which renders text using core text with an enlarged, floating first character.
//
// FTWDropCapTextView.h
//
// Created by Anthony Mattox on 1/22/13.
// Copyright (c) 2013 Friends of The Web. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface FTWDropCapTextView : UIView