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 CoreGraphics | |
// MARK: - Function Documentation | |
/// Calculates the difference between given points | |
/// - Parameter pointA: first point | |
/// - Parameter pointB: second point | |
/// - Returns: Distance of 2 points as CGFloat | |
func calculateDistance(from pointA: CGPoint, to pointB: CGPoint) -> CGFloat? { nil } | |
// TODO: - Add more functions as sample |
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 -x | |
CURRENT=`git branch | grep "*" | awk '{print $2}'` | |
git checkout master | |
git fetch | |
git merge origin/master | |
git checkout ${CURRENT} | |
git merge master ${CURRENT} |
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)askUserAQuestion{ | |
UIAlertView *alert = [[UIAlertView alloc] | |
initWithTitle : @"Question Time" | |
message : @"What do you want to do ?" | |
delegate : self | |
cancelButtonTitle : @"Cancel" | |
otherButtonTitle : @"Continue", | |
nil]; | |
[alert show]; | |
} |
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
typedef NS_ENUM (NSUInteger,PostType){ | |
PostTypeVideo, | |
PostTypePhoto, | |
PostTypePlain, | |
}; | |
@interface Post:NSObject | |
@property (copy) NSString *title; | |
@property NSDate *createdDate; | |
// helper for creating Post Object | |
+ (Post*) postWithType:(PostType)type; |
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 *compareableString = @“This is a String”; | |
NSString *comparedString = @“This is a String”; | |
BOOL *isEqual = (*comparableString == *comparedString); | |
// this will return NO because it refers to two different objects | |
/* | |
So we have to use equality methods from their objects to compare them. | |
If we want to use our custom equality functions | |
we also should be sure that the function checks for the pointer equality as a first step of equality function.*/ | |
if(self == object) return YES; | |
//we also should be sure to have a hash function to check the second equality step. |
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
@interface Person:NSObject{ | |
@public | |
NSString *_firstName; | |
NSString *_lastName; | |
@private | |
NSString *_someInternalData; | |
} | |
@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
// NSString | |
NSString *someAllocInitString = [[NSString alloc] initWthString: @“The String”]; | |
NSString *someLiteralDeclaredString = @"The String"; | |
// NSArray | |
NSArray *someAllocInitArray = [NSArray arrayWithObjects:@“firstObject”,@“secondObject”,@“thirdObject”]; | |
NSArray *someLiteralDeclaredArray = @[@“firstObject”,@“secondObject”,@”thirdObject”]; | |
// NSDictionary | |
NSDictionary *someAllocInitDictionary = [NSDictionary dictionaryWithObjectAndKeys : @“firstValue”,@“firstKey” |
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
UIFont: family Thonburi | |
UIFont: font Thonburi-Bold | |
UIFont: font Thonburi | |
UIFont: font Thonburi-Light | |
UIFont: family Khmer Sangam MN | |
UIFont: font KhmerSangamMN | |
UIFont: family Snell Roundhand | |
UIFont: font SnellRoundhand-Black | |
UIFont: font SnellRoundhand-Bold | |
UIFont: font SnellRoundhand |
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
from bs4 import BeautifulSoup | |
import urllib.request | |
import os, ssl | |
import re | |
import pandas as pd | |
def getDataFromUrl(text,tagForData=None,idForData=None | |
,classForData=None,isSoup=False): | |
#this creates an SSL Cerificate | |
if (not os.environ.get('PYTHONHTTPSVERIFY', '') and | |
getattr(ssl, '_create_unverified_context', None)): |
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
from bs4 import BeautifulSoup | |
import urllib.request | |
import os, ssl | |
import re | |
import pandas as pd | |
def getDataFromUrl(text,tagForData=None,idForData=None | |
,classForData=None,isSoup=False): | |
#this creates an SSL Cerificate | |
if (not os.environ.get('PYTHONHTTPSVERIFY', '') and | |
getattr(ssl, '_create_unverified_context', None)): |
NewerOlder