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
defaults write com.omnigroup.OmniFocus RelativeDateFormatterShowTime 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
static BOOL AccelerationIsShaking(UIAcceleration* last, UIAcceleration* current, double threshold) { | |
double | |
deltaX = fabs(last.x - current.x), | |
deltaY = fabs(last.y - current.y), | |
deltaZ = fabs(last.z - current.z); | |
return | |
(deltaX > threshold && deltaY > threshold) || | |
(deltaX > threshold && deltaZ > threshold) || | |
(deltaY > threshold && deltaZ > threshold) |
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
curl -XDELETE 'localhost:9200/scriptsort' | |
curl -XPOST 'localhost:9200/scriptsort' -d ' | |
{ | |
"mappings": { | |
"test": { | |
"_id": { | |
"index" : "not_analyzed", | |
"stored": "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
// | |
// UIDeviceHardware.h | |
// | |
// Used to determine EXACT version of device software is running on. | |
#import <Foundation/Foundation.h> | |
@interface UIDeviceHardware : NSObject | |
- (NSString *) platform; |
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
+(BOOL) jailBreakCheck{ | |
NSArray *jailbrokenPath = [NSArray arrayWithObjects: | |
@"/Applications/Cydia.app", | |
@"/Applications/RockApp.app", | |
@"/Applications/Icy.app", | |
@"/usr/sbin/sshd", | |
@"/usr/bin/sshd", | |
@"/usr/libexec/sftp-server", | |
@"/Applications/WinterBoard.app", | |
@"/Applications/SBSettings.app", |
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
NSRegularExpression *regex = [NSRegularExpressionregularExpressionWithPattern:@"((@|#)([A-Z0-9a-z(é|ë|ê|è|à|â|ä|á|ù|ü|û|ú|ì|ï|î|í)\u4e00-\u9fa5_]+))|(http(s)?://([A-Z0-9a-z._-]*(/)?)*)" options:NSRegularExpressionCaseInsensitive error:&error]; |
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)pauseLayer:(CALayer*)layer | |
{ | |
CFTimeInterval pausedTime = [layer convertTime:CACurrentMediaTime() fromLayer:nil]; | |
layer.speed = 0.0; | |
layer.timeOffset = pausedTime; | |
} | |
- (void)resumeLayer:(CALayer*)layer | |
{ | |
CFTimeInterval pausedTime = [layer timeOffset]; | |
layer.speed = 1.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
CALayer *capa = [self.navigationController navigationBar].layer; | |
[capa setShadowColor: [[UIColor blackColor] CGColor]]; | |
[capa setShadowOpacity:0.85f]; | |
[capa setShadowOffset: CGSizeMake(0.0f, 1.5f)]; | |
[capa setShadowRadius:2.0f]; | |
[capa setShouldRasterize:YES]; | |
//Round | |
CGRect bounds = capa.bounds; |
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
@interface NSFileManager (DoNotBackup) | |
- (BOOL)addSkipBackupAttributeToItemAtURL:(NSURL *)URL; | |
@end |
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
server { | |
listen 80; | |
server_name www.mysite.com; | |
root /path/to/main_site; | |
# ... | |
location / { | |
proxy_set_header X-Real-IP $remote_addr; | |
# ... |
OlderNewer