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
dispatch_queue_t _noFutureQueue; | |
//... | |
_noFutureQueue = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_BACKGROUND, 0); | |
dispatch_sync(_noFutureQueue, ^{ | |
//... | |
}); |
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
#import "NSString+MD5.h" | |
#import <CommonCrypto/CommonDigest.h> | |
@implementation NSString (MD5) | |
- (NSString *)MD5String { | |
const char *cstr = [self UTF8String]; | |
unsigned char result[16]; | |
CC_MD5(cstr, strlen(cstr), result); | |
return [NSString stringWithFormat: |
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
@property (SDDispatchQueueSetterSementics, nonatomic) dispatch_queue_t ioQueue; | |
//... | |
_ioQueue = dispatch_queue_create("com.currycat.files", DISPATCH_QUEUE_SERIAL); | |
//... | |
if (path) { | |
dispatch_async(self.ioQueue, ^{ | |
[[NSFileManager defaultManager] removeItemAtPath:path error:nil]; | |
}); | |
} |
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
## | |
## Shell script to batch convert all files in a directory to caf sound format for iPhone | |
## Place this shell script a directory with sound files and run it: 'sh afconvert_wavtocaf.sh' | |
## Any comments to '[email protected]' | |
## | |
for f in *.wav; do | |
if [ "$f" != "afconvert_wavtocaf.sh" ] | |
then | |
afconvert -f caff -d ima4 $f |
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
sudo ln -s /System/Library/Frameworks/JavaScriptCore.framework/Resources/jsc /usr/bin |
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
$fechaFromUI = $req->post('selected_date'); | |
$date = DateTime::createFromFormat('d/m/Y', $fecha); | |
$fechaToStoreOnDatabase = $date->format('Y-m-d'); |
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
if ([[UIScreen mainScreen] respondsToSelector:@selector(displayLinkWithTarget:selector:)] && | |
([UIScreen mainScreen].scale == 2.0)) { | |
// Retina display | |
} else { | |
// non-Retina display | |
} |
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
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation | |
{ | |
if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) | |
{ | |
return YES; | |
} | |
else | |
{ | |
return (interfaceOrientation == UIInterfaceOrientationPortrait); | |
} |
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
<?php | |
// header('Cache-Control: no-cache, must-revalidate'); | |
// header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); | |
// header('Content-type: application/json'); | |
define('PETICION_OK' , 200); | |
define('PETICION_NO_AUTORIZADO' , 401); | |
//Login |
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
//Hacemos dismiss si el menú está visible y se pulsó fuera | |
$(document).mouseup(function (e) | |
{ | |
var container = null; | |
if($('#menu_settings').is(":visible")) | |
{ | |
container = $('#menu_settings'); | |
} | |
if (container!=null && !container.is(e.target)) |