Auto Hot Key

by frank on August 15, 2006

in Tools

Thought I would write a post about one of the most useful tools I have come across – Auto Hot Key. This is an awesomely useful and powerful tool and I haven’t even scratched the surface, but it really comes in handy when programming, so that you can bust out the syntax for that foreach loop/switch statement/do-while just like nothing.

But my favourite use is for debugging. I can just jump to anywhere in my code, write site test;[enter] and I’m all ready to output that database result/globals array/object. With the following entry…

 :oc:site test;::
(
echo "[pre tag] style='color: red' ";
print_r($);
echo "[pre tag]";
) 

It will insert…

echo "[pre tag] style='color: red' ";
print_r($);
echo "[pre tag]"; 

Of course, this is the most simple use of this tool, you just need to browse the website a little to recognise the potential. Enjoy!

(replace the [pre] tags with actual pre tags by the way)

Share and Enjoy:
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • email
  • Reddit
  • StumbleUpon

Profile:  Frank has been programming for the web using PHP, Javascript and numerous libraries and frameworks for the past 6 years. More articles.

{ 2 comments… read them below or add one }

timmowNo Gravatar February 26, 2008 at 3:18 pm

Randomly googled your website… could you just use a function to do this? I have a function called debug() which does what you have mentioned…

franktankNo Gravatar February 26, 2008 at 8:56 pm

Correct! You can, the advantage of this technique would be not having to include that function in your code base I guess.

Leave a Comment

Previous post:

Next post: