bonus tip: for more darkness > https://darkreader.org/
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
一 | |
乙 | |
二 | |
十 | |
丁 | |
厂 | |
七 | |
卜 | |
八 | |
人 |
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
// | |
// APIWrapper+Generic.swift | |
// OPTIFY | |
// | |
// Created by Tomas Sykora, jr. on 12/09/2016. | |
// Copyright © 2016 AJTY, s.r.o. All rights reserved. | |
// | |
import RealmSwift | |
import Alamofire |
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 APIProtocol { | |
init(_ j: [String: Any]) | |
} | |
extension APIWrapper { | |
func getAllObjectsOf<T: APIProtocol>(type: T.Type, request: URLRequestConvertible, _ completion: @escaping (_ result: (T.Type, ResultState)) -> Void) { | |
Alamofire.request(request).validate().response { response in | |
do { | |
if let data = response.data { |
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
@property int isTyping; | |
- (BOOL)textView:(UITextView *)textView shouldChangeTextInRange:(NSRange)range replacementText:(NSString *)text { | |
[self startTyping]; | |
[NSObject cancelPreviousPerformRequestsWithTarget:self selector:@selector(stopTyping) object:nil]; | |
[self performSelector:@selector(stopTyping) withObject:nil afterDelay:0.5]; | |
return 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
UIApplicationShortcutIcon * photoIcon = [UIApplicationShortcutIcon iconWithTemplateImageName: @"selfie-100.png"]; // your customize icon | |
UIApplicationShortcutItem * photoItem = [[UIApplicationShortcutItem alloc]initWithType: @"selfie" localizedTitle: @"take selfie" localizedSubtitle: nil icon: photoIcon userInfo: nil]; | |
UIApplicationShortcutItem * videoItem = [[UIApplicationShortcutItem alloc]initWithType: @"video" localizedTitle: @"take video" localizedSubtitle: nil icon: [UIApplicationShortcutIcon iconWithType: UIApplicationShortcutIconTypeCaptureVideo] userInfo: nil]; | |
[UIApplication sharedApplication].shortcutItems = @[photoItem,videoItem]; |
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*)sha256HashFor:(NSString*)input | |
{ | |
const char* str = [input UTF8String]; | |
unsigned char result[CC_SHA256_DIGEST_LENGTH]; | |
CC_SHA256(str, (CC_LONG)strlen(str), result); | |
NSMutableString *ret = [NSMutableString stringWithCapacity:CC_SHA256_DIGEST_LENGTH*2]; | |
for(int i = 0; i<CC_SHA256_DIGEST_LENGTH; i++) | |
{ | |
[ret appendFormat:@"%02x",result[i]]; |
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
for (NSString* family in [UIFont familyNames]) | |
{ | |
NSLog(@"%@", family); | |
for (NSString* name in [UIFont fontNamesForFamilyName: family]) | |
{ | |
NSLog(@" %@", name); | |
} | |
} |
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
// UIWindow+AppSwitchScrollStopper.h | |
// Created by Tim Johnsen on 3/27/16. | |
#import <UIKit/UIKit.h> | |
@interface UIWindow (AppSwitchScrollStopper) | |
/// Call this early on in your app's lifecycle to avoid | |
/// scroll-related flashing when your app resumes from the background | |
- (void)installAppSwitchScrollStopper; |
NewerOlder