John Cox

Blogs · @wyome

Tagged tutorial · everything

Make Your HTML Email 5½ Times More Mobile Friendly

Josh Rubinstein outlines five practical techniques for creating HTML email templates that work across mobile and desktop devices without requiring multiple versions, emphasizing progressive enhancement rather than relying solely on media queries. The tips cover touch-friendly interface design, optimizing images for Retina displays, providing accessible alt text, controlling unwanted font resizing on mobile browsers, and using percentage-based widths with max-width constraints to scale responsively across different email clients. The article acknowledges the particular challenges of email rendering—especially in Outlook—and provides actual code samples for implementing these solutions at Estately.

Permalink

Signs of a poorly written jQuery plugin

The author identifies common code patterns in jQuery plugins that signal the author doesn't fully understand jQuery's mechanics, using a practical example to demonstrate unnecessary complexity. He walks through four specific antipatterns: creating unused intermediate variables, wrapping jQuery objects twice, including unnecessary returns within iterators, and using `.each()` when a direct method call would suffice, showing how each can be eliminated to write cleaner, more efficient plugin code. The key insight is recognizing that within plugin code `this` already refers to the jQuery instance, not DOM elements, making many common wrapper patterns redundant.

Permalink

Integrating Two-Factor Authentication with CodeIgniter | Nettuts+

This tutorial walks through implementing two-factor authentication in a CodeIgniter application using Duo Security's free service, which requires users to verify their identity with something they have (like a phone) in addition to their password. The guide covers setting up a Duo account and integration, strengthening password hashing with bcrypt, creating a secondary authentication page with Duo's Web SDK, and processing the two-factor verification response to complete login. The implementation allows administrators to enable two-factor authentication selectively for different users while maintaining backward compatibility with single-factor login for less security-critical accounts.

Permalink

An Introduction to Datasets - Dev.Opera

I'm unable to provide summaries of these articles because the content shown only includes titles and publication dates—the actual article text has not been provided. To write meaningful summaries that explain what each piece argues or reports, I would need access to the full article content.

Permalink

MacRuby: The Definitive Guide

This is a marketing page for O'Reilly's learning platform, promoting its training services for organizations seeking to upskill their workforce in technology, AI, and management. The platform offers expert-led content, live events, and AI-powered guidance (through "Expert Intelligence") that connects enterprise clients to practitioner knowledge across various business functions. O'Reilly serves over 5,000 organizations and positions itself as a solution for closing skill gaps and accelerating AI adoption across all employee levels.

Permalink

Ben Alman » jQuery doTimeout: Like setTimeout, but better

doTimeout is a jQuery plugin that simplifies managing delayed code execution, polling loops, and debouncing by maintaining an internal cache of timeout IDs so developers don't have to track them manually. It offers a cleaner API than native setTimeout while remaining fully jQuery chainable, allowing for easy cancellation, forced execution, and complex behaviors like polling until a condition is met or debouncing repeated events. The plugin is tested across major browsers and provides practical examples for common use cases like window resize handlers and typeahead search inputs.

Permalink

Build a Twitter app with jQuery Mobile | Blog | Web Designer

**Autodesk's own AI film has a continuity error nobody could prompt away** Autodesk created a film using AI to demonstrate its capabilities, but the final product contains a continuity error that AI prompting alone couldn't fix, according to VP of M&E Strategy Maurice Patel. Patel uses this example to argue that AI will never fully replace human animators, as the technology still requires human oversight and creative problem-solving to catch and resolve such issues.

Permalink

An In Depth Guide to mod_rewrite for Apache | Nettuts+

This tutorial explains how to use Apache's mod_rewrite module to manipulate URLs on a server, breaking down the intimidatingly complex syntax into digestible concepts and practical examples. Rather than jumping into advanced techniques, it emphasizes a methodical debugging workflow—starting with simple rules and testing incrementally—to avoid hours of frustration tracking down what went wrong. The piece walks through real-world use cases like removing www prefixes, preventing hotlinking, and creating custom 404 pages, demonstrating that mod_rewrite is far more approachable than its reputation suggests.

Permalink

Some slight modifications to the codeigniter profiler to dynamically display session vars, and to add EXPLAIN to all queries. — Gist

This is a modified CodeIgniter profiler class that adds two key debugging features: it displays session variables in a dedicated table during profiling output, and it automatically runs MySQL EXPLAIN queries on all SELECT statements to show query execution plans with details like table access types, key usage, and row estimates.

Permalink

A quick assets file to give you control over header and footer templates with codeigniter. Not fully documented (yet) but should be relatively easy to figure out how to get access from your controller to tpl.view files. — Gist

This CodeIgniter library provides a centralized system for managing assets (stylesheets, scripts, and meta tags) across your application by storing them in global arrays and rendering them at specific locations in your templates. Controllers can queue scripts, stylesheets, titles, and inline code to be injected into the document head or body during template rendering, making it easier to dynamically manage assets without hardcoding them directly into header and footer templates.

Permalink

(500) http://www.in-the-attic.co.uk/2010/08/02/codeigniter-google-maps-library-using-google-maps-api-version-3/

This post announces a CodeIgniter library wrapper for Google Maps API v3, built on the php-google-map-api project but adapted for CodeIgniter's structure. The library allows developers to generate maps with markers added by address or coordinates, supports multiple map types, and includes features like custom icons and tooltips, with setup requiring a simple database table and copying two PHP files to the library directory.

Permalink

Optimizing the MySQL IN() Comparison Operations Which Include the Indexed Field – MySQL Diary

When a MySQL IN() clause references a field that's part of the query's index, the database evaluates the full result set for each IN value before merging and limiting results, which is expensive on large tables. Replacing the IN clause with a UNION ALL of separate queries—each with its own LIMIT—forces MySQL to limit results at each step before merging, dramatically improving performance. The post demonstrates this with a concrete example where `WHERE b=4 AND c IN (1,3,5,7,9)` becomes five separate queries joined with UNION ALL, each limited to 100 rows before the final merge and sort.

Permalink

(500) http://news.ycombinator.com/item?id=709713

This conversation discusses the trade-offs between nested set models and materialized path approaches for storing hierarchical data in relational databases. Commenters argue that materialized paths—storing the full path to each node as a denormalized column—offer simpler implementation and cheaper insert/delete operations than nested sets, though they require updating all descendant paths when moving subtrees and may have performance limitations with very large datasets. The discussion also touches on alternative approaches like PostgreSQL's native ltree type and adjacency lists, with general consensus that different tree storage methods suit different use cases and that no single approach solves all hierarchical data problems optimally.

Permalink