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
// | |
// UIImageRounded.h | |
// BDD Restaurantes | |
// | |
// Created by Sendoa Portuondo on 03/10/11. | |
// Copyright 2011 Qbikode Solutions, S.L. All rights reserved. | |
// | |
#import <UIKit/UIKit.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
// Disable the idle timer | |
[[UIApplication sharedApplication] setIdleTimerDisabled: YES]; | |
// Or for those who prefer dot syntax: | |
[UIApplication sharedApplication].idleTimerDisabled = 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
<?php | |
if ( strpos( $_SERVER['HTTP_USER_AGENT'], 'Googlebot' ) !== false ) { | |
mail('tu_direccion@correo.com','Aviso: Googlebot ha visitado tu web','El Googlebot ha visitado tu página: http://tu_dominio.com'. $_SERVER['REQUEST_URI']); | |
} | |
?> |
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
// Hay que añadirlo a additional-methods.js | |
jQuery.validator.addMethod("horahhmm", function(value, element) { | |
var res = false; | |
// Formato hh:mm | |
res = this.optional(element) || /^\d{2}[:]\d{2}$/.test(value); | |
var hora = value.split(':'); | |
var hh = parseInt(hora[0],10); | |
var mm = parseInt(hora[1],10); |
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
#ifdef DEBUG | |
# define DLog(fmt, ...) NSLog((@"%s [Line %d] " fmt), __PRETTY_FUNCTION__, __LINE__, ##__VA_ARGS__); | |
#else | |
# define DLog(...) | |
#endif | |
#define ALog(fmt, ...) NSLog((@"%s [Line %d] " fmt), __PRETTY_FUNCTION__, __LINE__, ##__VA_ARGS__); | |
#ifdef DEBUG | |
# define ULog(fmt, ...) { UIAlertView *alert = [[UIAlertView alloc] initWithTitle:[NSString stringWithFormat:@"%s\n [Line %d] ", __PRETTY_FUNCTION__, __LINE__] message:[NSString stringWithFormat:fmt, ##__VA_ARGS__] delegate:nil cancelButtonTitle:@"Ok" otherButtonTitles:nil]; [alert show]; } | |
#else | |
# define ULog(...) |
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
SELECT email, COUNT(email) as total_registros | |
FROM clientes | |
GROUP BY email | |
HAVING COUNT(email)>1 | |
# http://webintenta.com/seleccionar-registros-repetidos-en-mysql.html | |
# Consulta SQL que nos permite seleccionar una serie de registros repetidos de un campo e-mail, nif o cualquiero otro campo que debería ser único en nuestra tabla. En el siguiente ejemplo se ha consultado la tabla "clientes" para seleccionar los correos electrónicos repetidos y la cantidad de veces que aparecen en la tabla. |
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
// http://mobiledevelopertips.com/debugging/print-cgrect-and-cgpoint-using-nslog.html | |
struct CGPoint { | |
CGFloat x; | |
CGFloat y; | |
}; | |
typedef struct CGPoint CGPoint; | |
struct CGRect { | |
CGPoint origin; |
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
# http://mobiledevelopertips.com/core-services/read-info-plist-key-value-pairs.html | |
NSNumber *prefSet = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"PreferencesSet"]; | |
NSLog(@"PreferencesSet: %@", prefSet); | |
NSString *version = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleVersion"]; | |
NSLog(@"CFBundleVersion: %@", version); | |
NSArray *customURL = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleURLTypes"]; | |
debug(@"Custom URL: %@", customURL); |
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
//http://mobiledevelopertips.com/core-services/create-universally-unique-identifier-uuid-the-ios-6-way.html | |
//The class NSUUID implements RFC 4122 creating values that are 128 bits long and guaranteed to be unique across space and time by using a unique value on the device as well as a value representing the elapsed time since October 15, 1582 at 00:00:00. | |
// iOS 6 | |
NSUUID *uuid = [NSUUID UUID]; | |
NSLog(@"UUID: %@", [uuid UUIDString]); | |
// Output: UUID: A84AFC3C-B3A7-31C7-B3E9-234AF423C6B1 |
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
#import <UIKit/UIKit.h> | |
#define ApplicationDelegate ((QBKAppDelegate *)[UIApplication sharedApplication].delegate) | |
@interface QBKAppDelegate : UIResponder <UIApplicationDelegate> | |
@property (strong, nonatomic) UIWindow *window; | |
@property (copy, nonatomic) NSString* unaCadena; | |
@end |
OlderNewer