This file contains 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
CGRect * windowFrame = // however you find out the frame of your window; | |
UIView * myView = // something you already defined. can be any type of view, but it needs a defined size. | |
// draw a centered frame in this view. (horizontally-centered and vertically centered) | |
CGRect centeredFrame = CGRectMake( | |
// x is horizontal-width minus myView's width / 2 to be centered. | |
(windowFrame.size.width - myView.frame.size.width) / 2.0, | |
// y is the same logic. | |
(windowFrame.size.height - myView.frame.size.height) / 2.0, |
This file contains 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
# courtesy of http://stackoverflow.com/questions/746670/how-to-lose-margin-padding-in-uitextview | |
nameField.contentInset = UIEdgeInsetsMake(-4, -8, 0, 0); |
This file contains 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
- (CGSize)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout*)collectionViewLayout sizeForItemAtIndexPath:(NSIndexPath *)indexPath { | |
return CGSizeMake(200.0, 200.0); | |
} |
This file contains 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
NSArray * images = [NSArray arrayWithObjects: | |
"[email protected]", | |
"[email protected]", | |
"[email protected]", | |
"[email protected]", | |
"[email protected]", | |
"[email protected]", | |
"[email protected]", | |
"[email protected]", | |
"[email protected]", |
This file contains 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
// Not sure what the base url should be, but appending the | |
// callback=? parameter will help use it jsonp-style | |
var api_url = this._settings.baseAPIURL + | |
'/search/venue/' + venue_id + | |
'?callback=?'; | |
// I append things on the end like category=Hamburger&location=Greenpoint | |
var ending_url = $.fn.getQueryParameterString(); | |
// call it! |
This file contains 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
Title Only, | |
Pullquote, | |
Video, | |
Photo Only, | |
Tall (240x390), | |
Wide (390x240), | |
X-Large Feature (900x650), | |
XLarge with Text Below, | |
Tall Feature, | |
Medium Feature with Text Below, |
This file contains 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
// at the bottom of TNConstants.m's @implementation TNConstantsLinechef : NSObject | |
+(NSString*)latest_issue_url { | |
return [NSString stringWithFormat:@"%@/latest_issue.json", [TNConstantsLinechef base_asset_url]]; | |
} | |
// ..in the @interface TNConstantsLinechef : NSObject block: | |
+(NSString*)latest_issue_url; |
This file contains 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
// dateString expected format: "2012-08-08 17:31:01 Etc/GMT" | |
// This value comes from our receipt-verification service, | |
// so it's independent of any of the user's settings | |
+(NSDate*)translateExpirePurchaseStringToDate: (NSString*)dateString { | |
NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init]; | |
// strip the ending | |
NSString *purchaseDateString = [dateString stringByReplacingOccurrencesOfString:@" Etc/GMT" withString:@""]; | |
This file contains 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
<style> .body.poem p { text-indent: 0em !important; padding-left: 0em !important;} </style> | |
<p style="margin:20px 0px 0px 80px !important;"><em>While I am a pilgrim here</em><br><em>let Thy love my spirit cheer</em></p> | |
<br /> | |
<p>In the evening, camped at the mouth of a small creek, a good supper of trout as we discuss whether to name this place Whirlpool Canyon or Craggy Canyon. We cannot decide.</p> | |
<p>A headlong ride, rearing and plunging with the waves. We decide to call it Whirlpool Canyon.</p> |
This file contains 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
//---- in TNConstants.m: | |
// TNConstantsApp block: | |
+(BOOL)hasJQueryDrawnTemplates { | |
return YES; | |
} | |