Author Archives: deanoj

Custom checkbox and select element styling in webkit browsers.

You can fully customise the style of checkboxes, radio buttons, select elements etc.. in webkit browsers. An example of a custom checkbox is show below. The key CSS rule is -webkit-appearance: none;. This then allows you style the element as a normal block element. Been webkit only, its safari and chrome browsers only at the [...]

Posted in Web Development | Tagged , , | Leave a comment

File and folder permissions using Access Control Lists

Access Control Lists allow you to define user permissions on files in a fine grained way. For example, if Apache needs write permission on a folder – but you want to retain your own permissions for also writing to that folder from command line scripts – ACL is the answer. chmod +a For systems that [...]

Posted in Shell | Tagged , , | Leave a comment

GIT ignore file for xcode4 projects

My current GIT ignore file for xcode4 projects   .DS_Store *.swp *~.nib build/ *.pbxuser *.perspective *.perspectivev3 *.xcodeproj/xcuserdata/* *.xcodeproj/project.xcworkspace/xcuserdata/*

Posted in Git | Tagged , | Leave a comment

GIT ignore file for Symfony2

My current GIT ignore file for symfony2 projects: # symfony files .DS_Store vendor/* app/cache/* app/logs/* *~   # config files to ignore app/config/parameters.ini   # eclipse PDT files .buildpath .project .settings

Posted in Git | 1 Comment

ExtJS 3.3 error this.addEvents is not a function ‘statesave’

If you get something similar to the above error message in firebug while developing with Ext 3.3, a common cause if you have tried to create a component when omitting the new keyword. var dv = Ext.DataView({…}); // incorrect   var dv = new Ext.DataView({…}); // correct

Posted in Web Development | Tagged , | 1 Comment

Custom text in the back button for a UINavigationController

The simple way to customise the back button text in the navigation bar. Add this code in your parent view controller. – (void)viewDidLoad { [super viewDidLoad];   UIBarButtonItem *backButton = [[UIBarButtonItem alloc] initWithTitle:@"Back" style:UIBarButtonItemStyleBordered target:nil action:nil]; self.navigationItem.backBarButtonItem = backButton; [backButton release]; }

Posted in iOS Development | Tagged , , | Leave a comment

UITableView static background image

The easy way to achieve a static background image with a scrolling UITableView: – (void)viewDidLoad { [super viewDidLoad];   self.parentViewController.view.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@"background.png"]]; self.tableView.backgroundColor = [UIColor clearColor]; }

Posted in iOS Development | Tagged , , | Leave a comment

Application crashing with “NSCFType controllerWillChangeContent” when using NSFetchedResultsController

I was using a UITableViewController that implemented the NSFetchedResultsControllerDelegate protocol. When navigating to this view, and then to another my application would crash with an error message something like: Terminating app due to uncaught exception ‘NSInvalidArgumentException’, reason: ‘-[__NSCFType controllerWillChangeContent:]: unrecognized selector sent to instance I finally tracked down the problem to be that I was [...]

Posted in iOS Development | Tagged , , , , | Leave a comment

Flush the DNS Cache in Snow Leopard OS X 10.6 and above

To clear your DNS cache typpe in terminal dscacheutil -flushcache

Posted in Shell | Tagged , | Leave a comment

Delete all test order data from Magento

These commands can be pasted into PHPMyAdmin, or some similar client. Tested on Magento version 1.4.2.0 SET FOREIGN_KEY_CHECKS=0;   TRUNCATE sales_flat_order; TRUNCATE sales_flat_order_address; TRUNCATE sales_flat_order_grid; TRUNCATE sales_flat_order_item; TRUNCATE sales_flat_order_status_history; TRUNCATE sales_flat_quote; TRUNCATE sales_flat_quote_address; TRUNCATE sales_flat_quote_address_item; TRUNCATE sales_flat_quote_item; TRUNCATE sales_flat_quote_item_option; TRUNCATE sales_flat_order_payment; TRUNCATE sales_flat_quote_payment; TRUNCATE sales_flat_shipment; TRUNCATE sales_flat_shipment_item; TRUNCATE sales_flat_shipment_grid; TRUNCATE sales_flat_invoice; TRUNCATE sales_flat_invoice_grid; TRUNCATE sales_flat_invoice_item; [...]

Posted in Magento | Leave a comment