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
#!/bin/sh | |
# Create a RAM disk with same perms as mountpoint | |
# Script based on http://itux.idev.pro/2012/04/iservice-speed-up-your-xcode-%D0%BD%D0%B5%D0%BA%D0%BE%D1%82%D0%BE%D1%80%D1%8B%D0%B5-%D1%81%D0%BF%D0%BE%D1%81%D0%BE%D0%B1%D1%8B/ with some additions | |
# Usage: sudo ./xcode_ramdisk.sh start | |
USERNAME=$(logname) | |
TMP_DIR="/private/tmp" | |
RUN_DIR="/var/run" | |
SYS_CACHES_DIR="/Library/Caches" |
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)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationType |
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
#if TARGET_IPHONE_SIMULATOR | |
#pragma clang diagnostic push | |
#pragma clang diagnostic ignored "-Wundeclared-selector" | |
[NSClassFromString(@"WebView") performSelector:@selector(_enableRemoteInspector)]; | |
#pragma clang diagnostic pop | |
#endif |
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
#!/bin/sh | |
GOOGLE_DRIVE_DEFAULT_PATH=/Applications/Google\ Drive.app/Contents/Resources | |
# backup | |
find "$GOOGLE_DRIVE_DEFAULT_PATH"/ -type f -name 'mac-normal*.png' -exec cp -v '{}' '{}'.backup \; | |
# copy all needed files to tmp | |
cp -f -v "$GOOGLE_DRIVE_DEFAULT_PATH"/mac-normal*.png /tmp/ |
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
--- 123.html | |
+++ (clipboard) | |
@@ -183,7 +183,7 @@ | |
.main { | |
- | |
+ background:url(/i/login/field.jpg) 50% 64%; | |
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)saveArrayOfImages:(NSMutableArray *)arrayOfImages | |
{ | |
for (UIImage *imageObject in arrayOfImages) | |
{ | |
dispatch_queue_t backgroundQueue = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_HIGH, 0); | |
dispatch_async(backgroundQueue, ^{ | |
NSManagedObjectContext *context = [appDelegate managedObjectContext]; | |
NSData *dataFromImage = UIImagePNGRepresentation(imageObject); | |
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 *string = [NSString stringWithUTF8String: @"http://президент.рф"]; | |
NSURL *url = [NSURL URLWithString:[string stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]]; | |
After this operations I check NSURL with: | |
[[UIApplication sharedApplication] canOpenURL:url] | |
canOpenURL return true. Then I open this NSURL at build-in browser Safari, | |
Safari told me that this page cannot be opened | |
(encoded URL seems like: http://xn--d1abbgf6aiiy.xn--p1ai), | |
after this I just press Refresh at browser without any additional actions |
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
set volume_path_to_disable to POSIX path of "/Volumes/Macintosh HD/" | |
set volume_path_to_enable to POSIX path of "/Volumes/OS X Mountain Lion" | |
set command to "mdutil -d " & quoted form of volume_path_to_disable & "&&" & "mdutil -i on " & quoted form of volume_path_to_enable | |
do shell script command with administrator privileges |
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
/* 1 - непосредственно в интерфейсе класса (*.h) */ | |
@interface IVExample : NSObject { | |
NSString *string; | |
int number; | |
} | |
@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
/* 2 - в class extension */ | |
@interface IVExample () { | |
NSString *string; | |
int number; | |
} | |
@end |
OlderNewer