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
-(void) performFakeMemoryWarning { | |
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; | |
SEL memoryWarningSel = @selector(_performMemoryWarning); | |
if ([[UIApplication sharedApplication] respondsToSelector:memoryWarningSel]) { | |
[[UIApplication sharedApplication] performSelector:memoryWarningSel]; | |
NSLog(@"Memory Warning!!"); | |
} | |
[pool release]; | |
} |
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
- (id)initWithFrame:(CGRect)frame { | |
if ((self = [super initWithFrame:frame])) { | |
UIImage *image = [[SMImageCacher instance] imageWithName:@"sectionHeader"]; | |
self.textPadding = UIEdgeInsetsMake(0, 10, 0, 90); | |
self.font = [UIFont boldSystemFontOfSize:17]; | |
self.textColor = [UIColor whiteColor]; | |
self.backgroundColor = [UIColor colorWithPatternImage:image]; | |
self.shadowOffset = CGSizeMake(0, 1); | |
self.shadowColor = [[UIColor blackColor] colorWithAlphaComponent:0.5]; | |
self.userInteractionEnabled = YES; |
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
Making right turns on red signals after stopping (and ensuring the path is clear of pedestrians and oncoming traffic) is allowed in most states, unless there is a specific restriction posted at the intersection or the traffic lights show a red arrow in place of the standard red light. Some areas will allow you to make a left turn on red going from a one-way street onto another one-way street. (Note: There is no "Right on Red" in New York City.) |
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
+ (void)initialize | |
{ | |
NSError *error = nil; | |
[[self class] jr_swizzleClassMethod:@selector(imageNamed:) withClassMethod:@selector(gk_imageNamed:) error:&error]; | |
} | |
+ (UIImage *)gk_imageNamed:(NSString *)str | |
{ | |
UIImage *image = [UIImage gk_imageNamed:str]; | |
if (!image && [str rangeOfString:@".jpg"].location == NSNotFound) { |
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
ladidas test |
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 the perfect gist |
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
--- | |
layout: default | |
--- | |
<h2 class="tag">{{ page.title }}</h2> | |
{% for post in site.tags[page.tag] %} | |
<div class="tag_entry"> | |
<h3> | |
<a class="content_head" href="{{ post.url }}">{{ post.title }}</a> | |
</h3> | |
<div> |
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
What I want to have is the following layout | |
-5-[label with flexible width]->=5-[uiimageview with fix width]-5- | |
the problem is the >= 5 in the middle is always treated as a 5 instead of a flexible width which should be bigger than 5. | |
My visual constraint looks like this: | |
@"|-(5)-[_usernameLabel]-(>=5)-[_userImageView(34)]-5-|" | |
Anyone any ideas how to achive the layout I want? |
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
const char *attributes = "T@\"DeliveryPlatform\",&,D,N"; | |
const char *ret; | |
char buffer[1 + strlen(attributes)]; | |
strcpy(buffer, attributes); | |
char *state = buffer, *attribute; | |
while ((attribute = strsep(&state, ",")) != NULL) { | |
if (attribute[0] == 'T') { | |
ret = (const char *)[[NSData dataWithBytes:(attribute + 3) length:strlen(attribute) - 4] bytes]; | |
} | |
} |
OlderNewer