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
RewriteEngine On | |
RewriteBase / | |
RewriteCond %{REQUEST_FILENAME} !-f | |
RewriteCond %{REQUEST_FILENAME} !-d | |
RewriteRule (.+) bills.php?id=$1 [L] | |
ErrorDocument 404 /404.html |
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 | |
include('bitly.php'); | |
$bitly = new bitly('username', 'apikey'); | |
$expanded = $bitly->expand('http://bit.ly/'.htmlspecialchars($_GET['id'])); | |
if (substr($expanded, 0, 30) == 'http://billr.s3.amazonaws.com/') { | |
echo '<img src="'.$expanded.'" id="sharedbill" width="640px" />'; | |
} else { | |
echo '<img src="/images/missing.png" id="sharedbill" width="640px" />'; | |
} | |
?> |
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
@implementation AppDelegate | |
void SwapMethodImplementations(Class cls, SEL left_sel, SEL right_sel) { | |
Method leftMethod = class_getInstanceMethod(cls, left_sel); | |
Method rightMethod = class_getInstanceMethod(cls, right_sel); | |
method_exchangeImplementations(leftMethod, rightMethod); | |
} | |
+ (void)initialize { | |
if (self == [AppDelegate class]) { | |
#ifdef __IPHONE_6_0 |
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
/* | |
* In practice, what I've found is that ALAssetPropertyDate, which is documented as the "asset creation time" | |
* will return (always in UTC): | |
* | |
* (1) If taken from the native camera, a ms-precision time of when the photo was taken. | |
* (2) If EXIF exists, EXIF time converted to UTC based on the timezone the device was in when | |
* the photo was saved to the camera roll. This is sec-precision. | |
* (3) If EXIF does not exist, the time the photo was written into the camera roll. This is sec-precision. | |
*/ | |
NSDate *timeTaken = [asset valueForProperty:ALAssetPropertyDate]; |
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 is an example provided by Facebook are for non-commercial testing and | |
* evaluation purposes only. | |
* | |
* Facebook reserves all rights not expressly granted. | |
* | |
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS | |
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | |
* FITNESS FOR A PARTICULAR PURPOSE AND NON INFRINGEMENT. IN NO EVENT SHALL | |
* FACEBOOK BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN |