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
### Keybase proof | |
I hereby claim: | |
* I am akupetskiy on github. | |
* I am andriykupetskyy (https://keybase.io/andriykupetskyy) on keybase. | |
* I have a public key ASD34btuZph4eOOaXO9iVP_pb_7adQAkTWAbvSuImH130wo | |
To claim this, I am signing this object: |
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 Foundation | |
import ObjectiveC.runtime | |
let myString = "foobar" as NSString | |
println(myString.description) | |
let myBlock : @objc_block (AnyObject!) -> String = { (sself : AnyObject!) -> (String) in | |
"✋" | |
} |
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. Generate public/private keys pair (Hit enter to skip questions): | |
openssl req -x509 -nodes -days 100000 -newkey rsa:2048 -keyout privatekey.pem -out publickey.pem | |
//2. Encrypt file using public key: | |
openssl smime -encrypt -aes256 -in LargeFile.zip -binary -outform DEM -out LargeFile_encrypted.zip publickey.pem | |
//3. Decrypt file using private key: | |
openssl smime -decrypt -in LargeFile_encrypted.zip -binary -inform DEM -inkey privatekey.pem -out LargeFile.zip |
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
/// Kind of ugly hack to make the text refresh after the toggle. The size of the secure fonts are different than the normal ones and it shows trailing white space | |
[self resignFirstResponder]; | |
NSString *text = self.text; | |
self.text = @" "; | |
self.text = text; | |
[self becomeFirstResponder]; |
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
#!/usr/bin/env bash | |
rm -rf "${HOME}/Library/Caches/CocoaPods" | |
rm -rf "`pwd`/Pods/" | |
pod update |
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
NSDate *date = [NSDate date]; | |
NSDateFormatter *monthDayFormatter = [NSDateFormatter new]; | |
[monthDayFormatter setDateFormat:@"F"]; | |
int date_day = [[monthDayFormatter stringFromDate:date] intValue]; | |
NSString *suffix_string = @"|st|nd|rd|th|th|th|th|th|th|th|th|th|th|th|th|th|th|th|th|th|st|nd|rd|th|th|th|th|th|th|th|st"; | |
NSArray *suffixes = [suffix_string componentsSeparatedByString: @"|"]; | |
NSString *suffix = [suffixes objectAtIndex:date_day]; | |
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)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { | |
CGPoint offset = tableView.contentOffset; | |
[tableView beginUpdates]; | |
// do something | |
[tableView endUpdates]; //<- this method causes scrolling | |
[tableView.layer removeAllAnimations]; | |
[tableView setContentOffset:offset animated:NO]; //<- Voilà! Now it works perfect :] | |
} |