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
@protocol SomeDelegate <NSObject> | |
- (void)someMethod:(id)item; | |
@end | |
@interface SomeInterface : NSObject | |
@property (nonatomic, weak) id <SomeDelegate> delegate; | |
@end | |
@implementation SomeInterface { | |
struct { |
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
# Custom iOS app version | |
# @usage | |
# 1. Select: your Target in Xcode | |
# 2. Select: Build Phases Tab | |
# 3. Select: Add Build Phase -> Add Run Script | |
# 4. Paste code below in to new "Run Script" section | |
# 5. Drag the "Run Script" below "Link Binaries With Libraries" | |
# 6. Insure that LastCommitHash and LastBuildDate are in your app plist file. | |
# 7. Somewhere in your obj-c code paste: | |
# + (NSString *)appVersionCommitHash { |
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://regexone.com/ | |
------------------------------------ | |
task: | |
match text 3.14529 | |
match text -255.34 | |
match text 128 | |
match text 1.9e10 | |
match text 123,340.00 | |
skip text 720p |
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
# Every request to api requires an auth-key in header in this example. | |
# Example of how to perform api testing with such authentication. | |
# django 1.7 | |
from django.apps import apps | |
from django.conf import settings | |
from django.test.client import RequestFactory | |
from api.user.views import UserKeyView |
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
// wait until completion functions get called by method inside loop. | |
for(Object *o in objects) | |
{ | |
__block BOOL block = YES; | |
[self applyMethod:o success:^(id result) { | |
//... | |
block = NO; | |
} failure:^(NSError *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
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, 1 * NSEC_PER_SEC), dispatch_get_main_queue(), ^{ | |
// Delay execution of block for 1 second. | |
}); | |
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{ | |
// Execution of block in the background thread. | |
}); | |
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{ | |
// Execution of block in the background thread. |
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
# coding: utf-8 | |
#----------------------------- | |
# Copyright (c) <Ilya Shoshin> | |
# <2014> | |
#----------------------------- | |
import ui | |
from markdown2 import markdown | |
#----------------------------- | |
# consts |
NewerOlder