This file contains hidden or 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/Foundation.h> | |
@interface UDPEchoClient : NSObject | |
- (BOOL) sendData:(const char *)msg; | |
@end |
This file contains hidden or 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/Foundation.h> | |
// | |
// HISTORY... | |
// | |
// from ios 10 simillar functionality is given which is initialized | |
// with a block, but we need to support the older version too, | |
// thats why this class is been introduced | |
// |
This file contains hidden or 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
// | |
// UICollectionView+Highlight.h | |
// | |
// Created by Ratul Sharker on 9/18/17. | |
// | |
#import <UIKit/UIKit.h> | |
@interface UICollectionView (Highlight) |
This file contains hidden or 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
#include <map> | |
// | |
// @param number : Of which you want the prime factorization. | |
// @param freq : Where to store the prime factorization result. | |
// | |
void primeFactorization(unsigned long long number, std::map<int, int> &freq) | |
{ | |
// initially divide via 2 | |
// it has a special thing like |
This file contains hidden or 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 UIKit | |
extension UIImage { | |
func base64EncodingString() -> String { | |
let imageData:Data = UIImagePNGRepresentation(self)! | |
return imageData.base64EncodedString() | |
} | |
} |
This file contains hidden or 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
// | |
// URL+PercentEncoding.swift | |
// | |
// Created by ratul sharker on 4/4/18. | |
// | |
import Foundation | |
extension URL { | |
static func initWithPercentEncoding(string : String) -> URL? { |
This file contains hidden or 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 UIKit | |
extension UITextView { | |
func wrapToContent() { | |
self.contentInset = UIEdgeInsets.zero | |
self.scrollIndicatorInsets = UIEdgeInsets.zero | |
self.contentOffset = CGPoint.zero | |
self.textContainerInset = UIEdgeInsets.zero | |
self.textContainer.lineFragmentPadding = 0 | |
} |
This file contains hidden or 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
# | |
# Here it is assumed that you are in osx/linux/windows environment | |
# and you have already installed python3 | |
# | |
# | |
# Creating a virtual environment | |
# | |
# osx/linux |
This file contains hidden or 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 | |
extension String { | |
func getQueryValue(param: String) -> String? { | |
return URLComponents(string: self)?.queryItems?.filter({ (queryItem) -> Bool in | |
return queryItem.name == param | |
}).first?.value | |
} | |
} |
This file contains hidden or 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
extension UIViewController { | |
@objc func analytics() { | |
print("Analytics related implementation") | |
analytics() | |
} | |
static func swizzle() { | |
// We will swizzle here |
OlderNewer