»It works!« is a state any piece of code needs to achieve. It's the goal most developers have in order to get the job done. But sadly »It works!« is more often than not, simply insufficient. It's a state that's only true for the moment. This post explains a few problems found in your average jQuery-based code.
Continue reading "jQuery - The Little Things"
For the release of Smarty 3.1.0 I refactored most of Smarty's disk access. As this optimization from September 2011 kept popping up questions on the Smarty forums, I finally felt the need to explain what I did. Although Smarty is the reason I discovered this, this post applies to PHP in general, not Smarty in particular. This post is all about laying the groundwork for you to realize two things:
- Your operations are not atomic
- Avoid accessing the hard disk unnecessarly
Continue reading "Improving Disk I/O in PHP Apps"
You probably know all about rolling your own plugins for jQuery. But did you know that some core jQuery functions have their own "plugin API" called "hooks"?
Continue reading "jQuery Hooks"
Many tools come with an installation / setup / configuration procedure. At this stage directories needed by the tool or its components usually don't yet exist. For Smarty based systems this poses a problem, as Smarty writes compiled templates to a designated directory. So if the installer is built upon Smarty, the developer is presented a hen/egg problem.
Continue reading "Prevent Smarty from writing compiled templates"
Click events are a godsend from hell. Here's how you can avoid at least one of the many problems they bring to the table: the end of a drag is not a click.
Continue reading "Click Events From Hell"