John Cox

Blogs · @wyome · Now · Shelf

Tagged development · everything

Interesting

Creating Custom HTML5 Input Types Using Regular Expressions | Web Builder Zone

HTML5 introduces a `pattern` attribute for text input fields that allows developers to validate user input against regular expressions directly in markup, eliminating the need for JavaScript onblur event handlers used in previous HTML versions. The pattern value must follow JavaScript regular expression syntax and will match against the entire input value, with optional `title` attributes providing user-friendly error messages when validation fails. For browsers lacking native support, Google's Web Forms 2 library provides cross-browser compatibility by automatically implementing HTML5 form features when needed.

Permalink

Reference - What does this symbol mean in PHP? - Stack Overflow

PHP's splat operator (...), available since version 5.6, allows functions to accept an arbitrary number of arguments and arrays to be unpacked into function parameters. When used in function definitions, it collects multiple arguments into an array; when used in function calls, it unpacks arrays or associative arrays into individual arguments or named parameters. The operator can also be used multiple times in a single function call and works with type declarations, though variadic parameters cannot themselves be targeted by named arguments—only their individual values when unpacked from associative arrays.

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

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

Geocoder - The almost missing Geocoder PHP 5.3 library.

Geocoder is a PHP library that abstracts geocoding functionality behind a unified interface, allowing developers to swap between 30+ different geocoding providers without changing application code. The library includes comprehensive test coverage and integrations for popular frameworks like Laravel and Symfony, making it suitable for building location-aware applications.

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

20 Great PHP Libraries You Need to Know | KomunitasWeb

La inteligencia artificial está automatizando la corrección de exámenes en instituciones educativas, permitiendo evaluaciones rápidas, objetivas y eficientes que liberan tiempo docente para la enseñanza. El artículo examina cómo esta transformación tecnológica está redefiniendo los procesos de evaluación académica y qué ventajas específicas aporta a la educación contemporánea.

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

The id attribute got more classy in HTML5 · Mathias Bynens

HTML5 relaxes the restrictions on id attribute values, allowing them to contain any character except spaces (and must be non-empty and unique), whereas HTML 4.01 required ids to start with a letter and only contain letters, digits, hyphens, underscores, colons, and periods. This means id attributes now follow the same permissive rules as class attributes, enabling unconventional but valid identifiers like "#", "♥", or even brainfuck code snippets. Targeting these unusual id values in CSS requires careful character escaping to avoid conflicts with CSS syntax.

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