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 | |
cd $1 | |
URL=`git remote -v |grep "fetch)" |awk '{print $2;}'|sed -e's#[email protected]:#http://github.com/#'|sed -e's|\.git||'` | |
open ${URL}/commit/$2 |
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 view draws a partially colored image as a pie chart based on two numeric values | |
* representing the total allowance and the current amount as a percentage of the total, | |
* using color and grayscale versions of an image. | |
* | |
*/ | |
#define PI 3.14159265358979323846 |
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 UITableViewCell (MyAdditions) | |
- (UITableView *)parentTableView { | |
UITableView *tableView = nil; | |
UIView *view = self; | |
while(view != nil) { | |
if([view isKindOfClass:[UITableView class]]) { | |
tableView = (UITableView *)view; | |
break; | |
} |
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
private var fooKey = 0 | |
extension UIViewController { | |
var foo: Bool { | |
set { | |
objc_setAssociatedObject(self, &fooKey, NSNumber(value: newValue), .OBJC_ASSOCIATION_RETAIN_NONATOMIC) | |
} | |
get { |
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 ImageProviderProtocol { | |
func image() -> UIImage? | |
} | |
class ImageProvider { | |
extension ImageProvider: ImageProviderProtocol { | |
func image() -> UIImage? { | |
return nil | |
} | |
} |
OlderNewer