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
<?php | |
session_start(); | |
define("MAPS_HOST", "maps.google.com"); | |
define("KEY", "YOURGOOGLEMAPSAPIKEY"); //Personal Google Maps API key | |
//Get address from which we will geocode the coordinates | |
$address=$_GET['address']; | |
if( $address!=NULL) |
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
//https://nshipster.com/device-identifiers/ | |
//Besides identifierForVendor.. | |
/* | |
Locale information is the greatest source of identifying information on Apple platforms. | |
The combination of your preferred languages, region, calendar, time zone, | |
and which keyboards you have installed say a lot about who you are | |
especially if you have less conventional preferences. | |
*/ |
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
var i=0; | |
function timedCount() | |
{ | |
i=i+1; | |
postMessage(i); //posts a message back to the HTML page. | |
setTimeout("timedCount()",500); | |
} | |
timedCount(); |
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
<?php | |
//How to use it | |
//Just call timthumb.php with appropriate arguments, For example: | |
<img src="/script/timthumb.php?src=/some/path/myimage.png&w=100&h=80" alt="resized image" /> | |
/* http://viralpatel.net/blogs/resize-image-dynamically-php/ */ | |
?> |
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
//Create the xib CustomView.xib and add the View class as CustomView (this one) | |
override func awakeAfter(using aDecoder: NSCoder) -> Any? { | |
if self.subviews.isEmpty { | |
let nib = UINib(nibName: "CustomView", bundle: nil) | |
let viewArray = nib.instantiate(withOwner: nil, options: nil) | |
guard let view = viewArray.first as? CustomView else { | |
return self | |
} | |
view.translatesAutoresizingMaskIntoConstraints = false |
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) applicationDidEnterBackground:(UIApplication *) application | |
{ | |
// You will also want to check if the user would like background location | |
// tracking and check that you are on a device that supports this feature. | |
// Also you will want to see if location services are enabled at all. | |
// All this code is stripped back to the bare bones to show the structure | |
// of what is needed. | |
[locationManager startMonitoringSignificantLocationChanges]; |
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
//Class will be declared later | |
@class CustomClass; | |
//Define the protocol for the delegate | |
@protocol CustomClassDelegate | |
@required | |
//Required methods go here | |
//If there are optional functions, they go here |
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
https://github.com/apple/swift-evolution |
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 quickSort(int arr[], int left, int right) { | |
int i = left, j = right; | |
int tmp; | |
int pivot = arr[(left + right) / 2]; | |
/* partition */ | |
while (i <= j) { | |
while (arr[i] < pivot) | |
i++; | |
while (arr[j] > pivot) |
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://www.innofied.com/implementing-image-masking-in-ios/ | |
- (UIImage*) maskImage:(UIImage *) image withMask:(UIImage *) mask | |
{ | |
CGImageRef imageReference = image.CGImage; | |
CGImageRef maskReference = mask.CGImage; | |
CGImageRef imageMask = CGImageMaskCreate(CGImageGetWidth(maskReference), | |
CGImageGetHeight(maskReference), | |
CGImageGetBitsPerComponent(maskReference), |
NewerOlder