This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#define ARTICLE_IMAGE_BORDER_SIZE 4.0f | |
@implementation LOArticleContentView | |
@synthesize text = _text; | |
@synthesize image = _image; | |
- (id)initWithFrame:(CGRect)frame | |
{ | |
self = [super initWithFrame:frame]; | |
if (self) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// WCAttributedString.h | |
// iOS | |
// | |
// Created by Wess Cope on 3/19/12. | |
// | |
// Special Thanks to Erica Sadun's Cookbook For the following, updated just a bit. | |
// | |
#import <Foundation/Foundation.h> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
NSColor *topBorderColor = WHITE; | |
NSColor *btmBorderColor = HEX_COLOR(@"aaa"); | |
NSBezierPath *topBorder = [NSBezierPath bezierPath]; | |
[topBorder moveToPoint:CGPointMake(0.0f, 0.0f)]; | |
[topBorder lineToPoint:CGPointMake(dirtyRect.size.width, 0.0f)]; | |
[topBorder setLineWidth:1.0f]; | |
[topBorderColor setStroke]; | |
[topBorder stroke]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#define SINGLETON(classname) \ | |
+(classname *)instance { \ | |
static dispatch_once_t onetime; \ | |
static classname *shared = nil; \ | |
dispatch_once(&onetime, ^{ \ | |
shared = [[classname alloc] init]; \ | |
}); \ | |
return shared; \ | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (UIImage *)withNewSize:(CGSize)newSize | |
{ | |
CGRect newRect = CGRectIntegral(CGRectMake(0.0f, 0.0f, newSize.width, newSize.height)); | |
CGImageRef imageRef = self.CGImage; | |
UIGraphicsBeginImageContextWithOptions(newSize, NO, 0.0f); | |
CGContextRef context = UIGraphicsGetCurrentContext(); | |
CGContextSetInterpolationQuality(context, kCGInterpolationHigh); | |
CGAffineTransform flipVertical = CGAffineTransformMake(1, 0, 0, -1, 0, newSize.height); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This is a bit messy right now, wanted to get it looking like i wanted before subclassing | |
// UIButton and making it proper like. | |
// Uses macros and categories from: http://github.com/wess/Additions | |
// | |
CGRect buttonFrame = CGRectInset(SCREEN_BOUNDS, 12.0f, 0.0f); | |
buttonFrame.size.height = 60.0f; | |
buttonFrame.origin.y = fieldFrame.size.height + fieldFrame.origin.y + 20.0f; | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# forms.coffee | |
# | |
# Created by Wess Cope on 2012-02-07. | |
# | |
window.document.getValuesOfFormWithId = (id)-> | |
tags = ['input', 'select', 'textarea'] | |
nonTypes = ['reset', 'submit', 'button'] | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# request.coffee | |
# | |
# Created by Wess Cope on 2012-01-30. | |
# | |
# Just a start. The basics in place and working | |
# to expand as elements are needed. | |
# | |
class Request |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This is my first full blow coffeescript class Im working on | |
# thoughts? | |
class Request | |
constructor: -> | |
@xhrObjects = [ | |
-> new XMLHttpRequest() | |
-> new ActiveXObject("Msxml2.XMLHTTP") | |
-> new ActiveXObject("Microsoft.XMLHTTP") | |
] |