Hi! Welcome...

AKA Matthew Dunham. I am a British PHP web developer who has been making websites since I was about 15. I currently rock with CakePHP, Wordpress, jQuery and all entailed technologies.

21 September 2011 ~ 0 Comments

Firefox Web Developer Bookmark Searches

I have recently heavily got into a lesser-known feature of Firefox and its bookmarks system, the ability to add a keyword and a parameter to a bookmark to perform searches on any site straight from the address bar. Here is an example of how I can jump straight to a PHP function documentation page just by typing “p function_name“.

These sort of bookmarks can allow you to search certain sites fast and easily with just a few keystrokes, and what’s more, it’s really straight forward to setup.

Setting Up Firefox Bookmark Searches

The basic syntax for setting up these bookmark searches is to introduce the search term in the URL with %s and assign a bookmark keyword in the advanced settings for the bookmark. This will then cause FF to replace whatever words you supply with the keyword with the %s in the URL. For example, below is my PHP bookmark that I used to get the result in the screenshot above:

To get to this menu, you will need to access the main bookmarks manager at Bookmarks > Show All Bookmarks, then add a bookmark (or find an existing one) and highlight it in the right hand pane and click the arrow at the bottom (highlighted in the image above) to display the advanced settings where you can assign a keyword to the bookmark. If you copy the example above it should be more than enough to get you going.

Here are my current web development Firefox bookmarks, the keyword I am using is in brackets:

  • PHP – http://php.net/manual-lookup.php?pattern=%s (p)
  • WordPress Codex – http://wordpress.org/search/%s (w)
  • CakePHP 2.0 Book – http://book.cakephp.org/2.0/en/search.html?q=%s (c)
  • jQuery Docs – http://api.jquery.com/?s=%s (j)
  • Google – http://www.google.com/search?q=%s (g)

The PHP manual search is currently the best use of these bookmarks that I’ve found, as the PHP site takes you straight to the manual page if it finds an exact match, whereas most other sites will take you just to a list of search results – this is still very handy mind. The Google one might seem a bit weird as Firefox searches whatever terms you type into the address bar anyway, but this way allows me to do some of Google’s advanced features without FF complaining about unknown protocols; eg “g define:recursive”.

If you have any good bookmark keywords of your own or an improvement on mine then let me know in the comments.

29 July 2011 ~ 1 Comment

CakePHP 2.0 default routes not working?

In migrating from CakePHP 1.3 to 2.0, one thing you will notice is that CakePHP no longer includes all the default routes in your app. Basic routes like /controller/action will not work without including the default routes yourself in your routes.php config. Thankfully this can be achieved with a couple of lines, here is an excerpt from a freshly baked app:

/**
 * Load all plugin routes.  See the CakePlugin documentation on
 * how to customize the loading of plugin routes.
 */
    CakePlugin::routes();

/**
 * Load the CakePHP default routes. Remove this if you do not want to use
 * the built-in default routes.
 */
    require CAKE . 'Config' . DS . 'routes.php';

03 February 2011 ~ 1 Comment

TF2 Scout Bonk Jacket

TF2
Scout Bonk Jacket

After hearing about the Team Fortress 2 Scout Bonk Jacket in the Valve store on Reddit how could I resist an impulse buy?

Well that was Monday night, and by the following Thursday Valve had managed to ship it with DHL from Seattle to my work office in the UK before lunch time! Things from the same country haven’t arrived that fast! I couldn’t keep up with the online tracking as it kept updating!

I’m pretty chuffed with my purchase and in awe at the speedy delivery straight from Valve HQ. The total cost with international shipping was $76.95 for the jacket and a Sentry mouse mat which I tacked on as part of a pay-day treat. The jacket itself is made by American Apparel and is of very high quality, maybe it’s a bit too red but it’s pretty much exactly what I was expecting. The scout decal on the front is stitch on badge and the Bonk logo is printed on the back.

Here is a few photos of the jacket and me wearing it. To put things into scale I am just over 5’7″ and the jacket I’m wearing is a medium, as you can see it fits just fine.

Also, note the size of the mouse mat! Bigger than an A4 sheet of paper!

Also, FIRST.