Skip to content

Instantly share code, notes, and snippets.

View shnhrrsn's full-sized avatar

Shaun Harrison shnhrrsn

View GitHub Profile
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);
}
protected void onDraw(Canvas canvas) {
Bitmap bitmap; // set to your bitmap
canvas.drawBitmap(bitmap, null, new Rect(0, 0, 50, 50), null);
}
@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;
- (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;
// Load an Image:
UIImage* image = [UIImage imageWithData:[[EGOCache currentCache] dataForKey:@"imageCacheKey"]];
// Store an Image:
[[EGOCache currentCache] setData:UIImagePNGRepresentation(image) forKey:@"imageCacheKey" withTimeoutInterval:604800];
- (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) {
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"]);
}
# Disable Access to .svn directories
$HTTP["url"] =~ "\.svn" {
url.access-deny = ("")
}
# Disable Access to .git directories
$HTTP["url"] =~ "\.git" {
url.access-deny = ("")
}
# Disable Access to .svn directories
RewriteRule \.svn - [F]
# Disable Access to .git directories
RewriteRule \.git - [F]
- (void)someMethod {
NSLog(@"Available Memory: %f", [[UIDevice currentDevice] availableMemory]);
}