John Cox

Blogs · @wyome · Now · Shelf

Tagged tutorial · everything

Interesting

Slow Queries? Check the Cardinality of Your MySQL Indexes | Lullabot

The article demonstrates how adding unnecessary indexes can actually harm database performance rather than improve it. The author discovered that the User Relationships module included an index on the `rtid` (relationship type) column despite it having extremely low cardinality—only one distinct value across 219,406 rows—which caused the database optimizer to choose an inefficient query path. By removing the low-cardinality index and restructuring the primary key, the author reduced query execution time from nearly one second to about 8 milliseconds, illustrating that indexes should be designed based on actual data distribution and cardinality, not just guessed at.

Permalink

How to: Use MySQL fast LOAD DATA for UPDATEs - SoftwareProjects : Internet Marketing Services

This is not a saved article but rather a company website for SoftwareProjects, a platform established in 2003 that provides eCommerce and digital business solutions. The site describes their evolution from a web development agency to a SaaS vendor offering tools like CRM, shopping carts, email marketing, and analytics, with particular focus since 2015 on eCommerce shopping cart functionality. Their pitch emphasizes curated product quality, continuous monitoring of user feedback, 24/7 support across 17 countries, and features like real-time analytics, anti-fraud protection, and affiliate management.

Permalink

Table rows as clickable anchors – James Padolsey

The author explains why naive solutions for making table rows clickable (using JavaScript to redirect on click) are problematic—they lack browser features like middle-click-to-open-in-new-tab and right-click context menus that users expect from real links. Rather than attempting to simulate all this missing functionality, the author created a jQuery plugin that overlays an actual anchor element across clickable rows, preserving all native link behaviors while maintaining the appearance and user experience of a large clickable area.

Permalink

The Shapes of CSS

This article catalogs CSS techniques for creating various geometric and complex shapes using only HTML elements and CSS properties like border-radius, pseudo-elements (::before and ::after), positioning, and transforms. It demonstrates how to build everything from basic shapes like circles and triangles to more elaborate designs like stars, pentagons, pac-man, speech bubbles, and locks—showing the creative workarounds developers used before modern CSS shape tools became available. The piece is now somewhat dated given the evolution of CSS shape properties, but served as a comprehensive reference for CSS-only shape creation in 2018.

Permalink

Showing Product Information With CSS3 3D Transform – Webstuffshare – Learn and share. The simplest harmony.

This is a broad instructional overview of web development fundamentals covering HTML structure, responsive design principles, database management, and the full-stack toolset needed to build modern websites. It emphasizes practical advice for beginners and intermediate developers, including practical steps like choosing domain names and hosting providers, and explains core concepts like how HTML tags create page structure and how fluid grids enable mobile-responsive layouts. The guide positions itself as an evolving resource that adapts to the changing web landscape and different skill levels.

Permalink

HTML for Icon Font Usage | CSS-Tricks

This article explores best practices for implementing icon fonts in HTML while maintaining accessibility and semantic quality. The author recommends combining a data attribute with a `<span>` element and `aria-hidden="true"` to add decorative icons alongside text, avoiding VoiceOver announcement issues that arise from pseudo-elements alone; for standalone functional icons like shopping carts, the same technique pairs the icon with off-screen screen-reader text. The piece emphasizes mapping icon fonts to meaningful Unicode symbols or the Private Use Area rather than arbitrary letters, and recommends tools like IcoMoon for custom font generation that avoids confusing screen reader output.

Permalink

Item Blur Effect with CSS3 and jQuery | Codrops

This tutorial demonstrates how to create an interactive focus effect on text cards using CSS3 transitions and jQuery, where hovering over one card scales it up and blurs its neighboring cards. The effect uses CSS transforms, box-shadows, and text-shadow properties to create the blur illusion, with JavaScript simply toggling "active" and "blur" classes on hover to trigger the smooth transitions. The technique relies on modern browser support for CSS3 transitions and works best in Chrome and Safari.

Permalink

Turning the Tables - MySQL

This tutorial demonstrates how to enable and create InnoDB tables in MySQL, which are necessary for transaction support since the default MyISAM format doesn't support transactions. It shows how to verify InnoDB support using the "have_innodb" variable, create new tables with the TYPE=InnoDB clause, and convert existing MyISAM tables to InnoDB format using ALTER TABLE commands. The piece provides practical SQL examples for setting up a sample database with users, groups, and mailboxes tables as a foundation for learning transaction implementation.

Permalink

thepeg/MediaTable · GitHub

This is an archived GitHub repository from 2011 containing a jQuery plugin for creating responsive media tables, with accompanying CSS styling and a polyfill for older browsers. The author has explicitly marked it as outdated and intentionally preserved it as a historical record of their earlier coding practices, discouraging current use or cloning.

Permalink

Self-updating scripts | High Performance Web Sites

This article proposes a technique for third-party web snippets to use long cache times (like one year) without preventing timely updates, solving the problem that snippets traditionally use short cache times (30 minutes to 2 hours) to receive updates, which causes performance-degrading conditional GET requests. The solution works by embedding a version number in the bootstrap script and having the server respond to subsequent requests (like beacons) with JavaScript that dynamically creates and reloads an iframe containing the bootstrap script, forcing a cache refresh only when an actual update exists. Snippet owners can adopt this by adding versioning, passing the version back to their server, returning update-triggering JavaScript when needed, and creating an update.php page that references the resources to be refreshed.

Permalink

Caching Tutorial for Web Authors and Webmasters

Web caches store copies of content (HTML, images, files) between origin servers and clients to reduce latency and network bandwidth usage, with three main types: browser caches on individual computers, proxy caches serving multiple users on networks, and gateway caches deployed by websites themselves or through content delivery networks. The document provides detailed guidance on controlling cache behavior through HTTP headers like Cache-Control and Expires rather than ineffective HTML meta tags, and explains how validation mechanisms like ETags and Last-Modified dates allow caches to verify content freshness without re-downloading entire files. Webmasters should embrace caching by using consistent URLs, setting appropriate expiration times, and writing cache-aware scripts, since proxy and browser caches will exist whether configured or not, and sites optimized for caching can load dramatically faster while reducing server load.

Permalink

SQL Indexing Tutorial | Use The Index, Luke!

This is a comprehensive free web guide to SQL indexing fundamentals across major database systems (MySQL, Oracle, PostgreSQL, SQL Server, DB2), teaching developers the practical mechanics of how indexes work—from B-tree structures to multi-column indexes to join operations—rather than abstract administration concepts. The guide covers both what makes indexes effective (exact lookups, range searches, covering indexes) and common mistakes that slow them down (functions in WHERE clauses, type mismatches, over-indexing), with vendor-specific testing notes provided throughout.

Permalink

Manipulating the browser history - MDN

This documentation explains JavaScript's History API for navigating browser session history. The back(), forward(), and go() methods allow programmatic control equivalent to clicking browser navigation buttons, while go() can also jump to specific pages or refresh the current page. The History interface also supports pushState() and replaceState() to modify the history stack and trigger popstate events when navigation occurs.

Permalink

timeago: a jQuery plugin

Timeago is a jQuery plugin that converts static timestamps into automatically updating relative times (like "4 minutes ago"), which refresh periodically to stay current without server-side recalculation. It works by attaching to HTML5 time elements or legacy abbr tags with ISO 8601 datetime values, and supports configuration options for future/past timestamps, multiple languages, and timezone handling. The plugin eliminates the problem of stale timestamps in cached pages while allowing developers to leverage standard HTML markup.

Permalink

Checking your code with PHP Code Sniffer in PhpStorm 4.0 | WebStorm & PhpStorm Blog

PhpStorm 4.0 integrates PHP Code Sniffer to automatically validate code style as you edit files, displaying warnings prefixed with "phpcs" to distinguish them from the IDE's own inspections. The setup requires installing PHP Code Sniffer independently and configuring it in PhpStorm, after which validation runs continuously on any open PHP file, with results appearing within seconds even for large files without blocking editing.

Permalink

Internet Explorer for Mac the Easy Way: Run IE 7, IE8, & IE9 Free in a Virtual Machine

Mac users needing to test Internet Explorer can use Oracle's free VirtualBox virtualization software combined with Microsoft's free IE testing virtual machines, automated through a simple bash script that downloads and converts the images for Mac compatibility. Each IE version requires about 11GB of disk space, and the method bypasses Microsoft's 30-day Windows trial limit by using VirtualBox snapshots that can be reverted indefinitely to reset the expiration timer. This approach is cheaper and more convenient than paid virtualization options like Parallels or VMWare, making it ideal for web developers who need to test site compatibility across multiple IE versions.

Permalink