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)
Related posts:
No tags for this post.
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…
Correct! You can, the advantage of this technique would be not having to include that function in your code base I guess.