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
// Debug log \o/ | |
HKNormal(@"normal log without color, but whit the format of HK"); | |
HKVerbose(@"normal log with Verbose in gray"); | |
HKDebug(@"this line is with a debug word in %@",@"blue"); | |
HKInfo(@"a info log"); | |
HKWarning(@"oh, no, oh no, this is not happening"); | |
HKError(@"aahhhhh, help!!!!!!"); | |
HKAlt(@"alternative color"); | |
HKOpt(@"optional color"); |
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
<?php | |
query_posts( array( | |
'post_type' => array( 'post', 'postType1', 'postType2', 'other_post_type' ), | |
'showposts' => 5 ) | |
); | |
?> | |
<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?> | |
<p><?php the_title(); ?></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
// https://github.com/hunk/Kit-iOS/tree/master/rotation | |
//para iniciar la animación | |
// el primer parametro es el tiempo en segundos de cada ciclo (vuelta completa) | |
// el segundo parametro es la dirección de la rotación | |
[my_button spinInfinityButtonWithTime:2 direction:-1]; | |
[my_image spinInfinityImageWithTime:5 direction:1]; | |
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
var deviceAgent = navigator.userAgent.toLowerCase(); | |
var iOS = deviceAgent.match(/(iphone|ipod|ipad)/); | |
if (iOS) { | |
// iOS | |
} else { | |
// not iOS | |
} |
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
NSString *path = [[NSBundle mainBundle] bundlePath]; | |
NSURL *baseURL = [NSURL fileURLWithPath:path]; | |
int numFrase = arc4random() % 3; | |
NSString *html = [NSString stringWithFormat:@"<html><body style=\"background-color: transparent;\" ><img src='%d.gif'></body></html>",numFrase]; | |
if (cual == 2) { | |
[homero loadHTMLString:html baseURL:baseURL]; |
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
//remove the ugly shadow of uiwebview | |
for(UIView *wview in [[[myCustomWebView subviews] objectAtIndex:0] subviews]) { | |
if([wview isKindOfClass:[UIImageView class]]) { | |
wview.hidden = YES; | |
} | |
} |
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
// | |
// ViewController.m | |
// sale | |
// | |
// Created by Edgar Garcia on 2/21/12. | |
// Copyright (c) 2012 E. All rights reserved. | |
// | |
#import "ViewController.h" |
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
- (void)viewDidLoad | |
{ | |
[super viewDidLoad]; | |
self.title = @"Root view"; | |
UIButton *backImage = [UIButton buttonWithType:UIButtonTypeCustom]; | |
backImage.frame = CGRectMake(0, 0, 24, 24); | |
backImage.backgroundColor = [UIColor clearColor]; | |
[backImage setBackgroundImage:[UIImage imageNamed:@"back.png"] forState:UIControlStateNormal]; | |
[backImage addTarget:self action:@selector(back) forControlEvents:UIControlEventTouchDown]; |
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
UIImage *gradientImage44 = [[UIImage imageNamed:@"nav44"] | |
resizableImageWithCapInsets:UIEdgeInsetsMake(0, 0, 0, 0)]; | |
UIImage *gradientImage32 = [[UIImage imageNamed:@"nav32"] | |
resizableImageWithCapInsets:UIEdgeInsetsMake(0, 0, 0, 0)]; | |
[[UINavigationBar appearance] setBackgroundImage:gradientImage44 | |
forBarMetrics:UIBarMetricsDefault]; | |
[[UINavigationBar appearance] setBackgroundImage:gradientImage32 | |
forBarMetrics:UIBarMetricsLandscapePhone]; | |
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
[my_image spinImageWithTime:2 direction:1]; | |
[my_button spinButtonWithTime:4 direction:-1]; |