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
protected void onDraw(Canvas canvas) { | |
Bitmap bitmap; // set to your bitmap | |
Rect src = new Rect(0, 0, bitmap.getWidth(), bitmap.getHeight()); // Fix for HA | |
canvas.drawBitmap(bitmap, src, new Rect(0, 0, 50, 50), 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
protected void onDraw(Canvas canvas) { | |
Bitmap bitmap; // set to your bitmap | |
canvas.drawBitmap(bitmap, null, new Rect(0, 0, 50, 50), 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
@implementation ExampleCell | |
- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier { | |
if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) { | |
imageView = [[EGOImageView alloc] initWithPlaceholderImage:[UIImage imageNamed:@"placeholder.png"]]; | |
imageView.frame = CGRectMake(4.0f, 4.0f, 36.0f, 36.0f); | |
[self.contentView addSubview:imageView]; | |
} | |
return self; |
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)viewDidLoad { | |
[super viewDidLoad]; | |
float scaleBy = 0.80; | |
id<MKAnnotation> annotation; // Define to yours | |
self.mapView = [[[MKMapView alloc] initWithFrame:CGRectMake(20.0f, 20.0f, 64 / scaleBy, 64 / scaleBy)] autorelease]; | |
[self.mapView addAnnotation:job]; | |
CLLocationCoordinate2D coordinate = annotation.coordinate; | |
coordinate.longitude -= 0.0006; |
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
// Load an Image: | |
UIImage* image = [UIImage imageWithData:[[EGOCache currentCache] dataForKey:@"imageCacheKey"]]; | |
// Store an Image: | |
[[EGOCache currentCache] setData:UIImagePNGRepresentation(image) forKey:@"imageCacheKey" withTimeoutInterval:604800]; |
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
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { | |
static NSString *CellIdentifier = @"EGOTitledTableViewCell"; | |
EGOTitledTableViewCell *cell = (EGOTitledTableViewCell*)[tableView dequeueReusableCellWithIdentifier:CellIdentifier]; | |
if (cell == nil) { | |
cell = [[[EGOTitledTableViewCell alloc] initWithFrame:CGRectZero reuseIdentifier:CellIdentifier] autorelease]; | |
} | |
// Set up the cell... | |
if(indexPath.row == 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
EGODatabase* database = [EGODatabase databaseWithPath:[NSHomeDirectory() stringByAppendingPathComponent:@"Documents/database.db"]]; | |
EGODatabaseResult* result = [database executeQuery:@"SELECT * FROM `posts` WHERE `post_user_id` = ?", [NSNumber numberWithInt:10]]; | |
for(EGODatabaseRow* row in result) { | |
NSLog(@"Subject: %@", [row stringForColumn:@"post_subject"]); | |
NSLog(@"Date: %@", [row dateForColumn:@"post_date"]); | |
NSLog(@"Views: %d", [row intForColumn:@"post_views"]); | |
NSLog(@"Message: %@", [row stringForColumn:@"post_message"]); | |
} |
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
# Disable Access to .svn directories | |
$HTTP["url"] =~ "\.svn" { | |
url.access-deny = ("") | |
} | |
# Disable Access to .git directories | |
$HTTP["url"] =~ "\.git" { | |
url.access-deny = ("") | |
} |
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
# Disable Access to .svn directories | |
RewriteRule \.svn - [F] | |
# Disable Access to .git directories | |
RewriteRule \.git - [F] |
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)someMethod { | |
NSLog(@"Available Memory: %f", [[UIDevice currentDevice] availableMemory]); | |
} |