Development Archives

  1. WordPress Code Snippet to Detect “Main” Loop

    Cribbed from the WP-Hackers list, the following sample code should give you a good way to test if the current “in the loop” action is within the main loop or a different loop: function main_loop_test($query) { global $wp_the_query; if ($query === $wp_the_query) { echo “main loop”; } } add_action(‘loop_start’, ‘main_loop_test’); Thanks Nacin and Konrad. This…

  2. Passthrough File Download Tip

    At some point you’re going to need to do the following in your web app: Receive a request to download a file. Authenticate the user/validate the request using some information stored in a database. Upon successful authentication/validation, deliver the file to the requestor (but deny access to the general public). This is a pretty standard…

  3. SimpleMath

    I have to do basic arithmetic on a fairly regular basis. My tool of choice for the last few years has been LeanCalc. It does the job well for the most part, but it doesn’t ignore non 0-9 characters, I would commonly use it to calculate a percentage of a dollar value. I’d paste in…

  4. Developer Expectations

    Old developers are wary of frameworks and assume something about them will end up biting them in the end; they are wary of using features they haven’t created. Young developers assume that frameworks and tools work, use them without hesitation, and are surprised when things go wrong. The truth, as usual, rests somewhere in between.

  5. Samsung Galaxy Tab User Agent

    If you’re trying to sniff the Samsung Galaxy Tab, here is the current User Agent string1: Mozilla/5.0 (Linux; U; Android 2.2; en-us; SCH-I800 Build/FROYO) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1 It looks like SCH-I800 may be the best thing to look for. Would it have killed them to add “Android Tablet (7 inch)” in…

  6. Ahead of My Time

    This past weekend I’ve been on East Coast time (in North Carolina). This is the third time in the past few months I’ve been on East Coast time for a few days. I kind of like being 2 hours ahead of local time at the office. For one thing, the stream of email is merely…

  7. Above the Fold

    For everyone who believes their entire website has to be “above the fold”, here’s the thing: people know how to scroll a web page. Don’t believe me? Believe Apple.

  8. Advice on Mitigating Piracy

    I received an email asking my advice about how to deal with software piracy when selling downloadable PHP applications. Here is my (slightly edited) response: It boils down to a choice between which is more important: making things easier for paying customers making it harder for people to use without paying Once you decide which…

  9. Using WordPress Transients with External Data

    The transients feature of WordPress is a very useful tool for local data cache when pulling from a remote data source (web service/API). A typical workflow goes something like this: Get remote data. Store it locally as transient data with a timeout. Once the data times out, get remote data again. That’s the basics and…

  10. Chrome’s Incognito Mode

    I’m finding that the Incognito windows in Google Chrome (I actually us Chromium) are becoming a daily tool in my standard browsing and development toolset. When I first heard about the concept of private browsing I had a more narrow view of it’s usefulness; but I’m finding lots of legitimate uses for it. A few…

  11. Introducing Carrington Build

    Over the last few years I’ve loved building a team and creating great things for our clients, but I’ve missed building products. A little more than a year ago, we started work on a system that I’ve had in the back of my mind for (quite literally) years. This work has resulted our first commercial…

  12. HTML5 Tip: input type=”date” and Webkit

    If you’re using HTML5 (like we are on the Crowd Favorite website), you may run into an issue of forms not submitting in Webkit browsers (Safari, Chrome). If the form is failing silently with no JavaScript errors and you have an <input type=”date” /> in the form, that may be the issue. It appears that…

  13. Twitter Tools and OAuth Continued

    I didn’t post many details in my previous update, and I’d like to visit some of them now. At the time that post was written, it looked like the user experience for Twitter Tools was going to look something like this: Download, install and activate Twitter Tools. Click a link to twitter.com where you would…

  14. Retina Changes iPhone Development

    I believe the super-dense pixels in the Retina display of the forthcoming iPhone are going to have an interesting effect on iPhone developers. While most are probably chomping at the bit to get new hardware anyway, we’re back to the landscape of the original iPhone release: if you want to see how your app really…