John Cox

Blogs · @wyome · Now · Shelf

Interesting

Responsive Images: The Ultimate Guide

A rundown of responsive image techniques, organized around seven practical problems: semantic markup, art direction, validity, bandwidth, server-side requirements, JavaScript dependence, and third-party reliance. For each it matches a tool to the constraint. Adaptive Images (Apache/PHP) suits sites with lots of legacy content, HiSRC (jQuery) and Picturefill allow custom cropping, Foresight.js tests connection speed, and Sencha.io Src and similar services outsource resizing at the risk of downtime. It ends with a practical guide to installing Picturefill 2.0 and writing its `srcset`/`sizes` and `<picture>` syntax, with the fallback `src` deliberately omitted to prevent double downloads. The piece is a Ghostlab blog post, and its conclusion is that no single solution covers every case, so you should pick based on which problem matters most to your project.

Permalink

ClockPicker

This is the documentation page for ClockPicker, a small clock-face time picker plugin (CSS under 6KB, JS under 9KB minified) that was built for Bootstrap but also ships in a standalone jQuery version that borrows only the popover and button styles. It supports IE 9+ and touch devices, and the page walks through usage examples (placement, alignment, autoclose, default "now" time, manually toggling to the minutes view), a table of options such as `donetext`, `vibrate` and `fromnow`, a set of lifecycle callbacks like `beforeShow` and `afterDone`, and the show/hide/remove/toggleView operations. Worth keeping as the reference for which files to use (bootstrap-* vs jquery-*), the option names, and the MIT license.

Permalink

Easing Functions Cheat Sheet

This is the explanatory page from an easing-function reference (in the style of easings.net). It argues that animations should mimic real-world motion, where things accelerate, decelerate, or bounce rather than moving at constant speed, and it helps you pick a suitable curve. For each function it gives implementation snippets: CSS transitions and @keyframes, the postcss-easings plugin, gradient stops, and a plain TypeScript math function taking progress x from 0 to 1. The code samples are mostly stripped out of this saved copy, so it's useful mainly as a pointer to the site and its implementation approaches.

Permalink

Get Real Image Height and Width Dimensions

A short JavaScript tip on finding an image's real, unstyled dimensions even when CSS like `max-width: 100%` has shrunk it on screen. The read-only `naturalWidth` and `naturalHeight` properties on an img element return the original pixel size, but only once the image's load event has fired, so you have to wait for it before reading them. The writer came across these properties on MDN while wondering how to bypass their own responsive-image CSS.

Permalink

Strip - A Less Intrusive Responsive Lightbox

A general overview from a Las Vegas legal-services site (Vegas Strip Legal Review) of the legal issues particular to the Strip, organized by audience. Tourists face premises-liability injuries (slip-and-falls, elevator accidents), public intoxication, DUI penalties, and casino winnings disputes. Businesses face employment law, Nevada Gaming Commission compliance, and contract disputes, while entertainers and venues deal with copyright, performer contracts, and safety licensing. It's essentially a marketing piece with no case law or specific statutes cited, so it's useful only as a broad checklist of categories before seeking an attorney.

Permalink

JavaScript for OS X Automation by Example -Telerik Developer Network

This is a short 2014 Telerik Developer Network post flagging JavaScript for Automation in Apple's upcoming OS X Yosemite as a significant feature that got lost amid the iOS 8, iPhone 6, and Apple Watch coverage. It serves mainly as a pointer to a longer tutorial by Burke Holland, which walks through scripting OS X with JavaScript by example. The post itself contains little detail beyond that teaser, so it is worth keeping only as a reference to that tutorial.

Permalink

Building OS X Apps with JavaScript by Tyler Gaw

A hands-on walkthrough of JavaScript for Automation in OS X Yosemite, which lets JS call native Cocoa frameworks through an Objective-C bridge (the `$` object). It builds a small image-viewer app in Script Editor, covering a window, label, text field and button, plus a registered subclass to handle clicks and an NSOpenPanel that restricts files to jpg/png/gif. Along the way it picks up practical gotchas: save as an Application with "Stay open after run handler," read NSLog output in Console, drop parentheses on zero-argument method calls, and convert Objective-C method signatures into JS names. It closes with the argument that this removes the barrier to writing small native Mac apps, since no Xcode or extra install is needed.

Permalink

Onload in Onload | High Performance Web Sites

Steve Souders tests what happens when an onload handler registers another onload handler, using a crowdsourced Browserscope test, and finds that no browser runs the second one. This matters because sites increasingly defer third-party scripts into onload handlers to improve load times, while many of those scripts (especially metrics ones) start themselves via onload, so they silently never finish. The fix is for third-party scripts to check `document.readyState` for "complete" and run immediately if the page has already loaded, as he did in his Episodes RUM library. Site owners who defer scripts this way should test that those scripts don't depend on onload.

Permalink

A simple and easy jQuery plugin for

This is the documentation page for animsition, a jQuery plugin that adds CSS3 page transitions, fading, rotating, flipping, zooming or sliding an overlay as visitors move between pages. It lists 58 named animations, each in small, default and large variants, and shows the three-step setup: link the CSS and JS files, wrap content in an `.animsition` div with `animsition-link` anchors, then call `.animsition()`. The page also covers per-link and per-page overrides through data attributes, the full options list (durations, loading indicator, timeout, overlay, custom transition function), and the events and methods for hooking into transitions. It runs in IE10+, Safari, Chrome and Firefox, and is disabled automatically where `animation-duration` isn't supported.

Permalink

Google Online Security Blog: Cleaning up after password dumps

A user who uses Google app passwords on both a MacBook Air and an iMac argues that Google's setup instructions for Mac and iOS are misleading. The "don't write it down" warning leaves a second Mac with no way to sign in, since Google labels the password only as "Mac" rather than per machine, and the user believes one app password won't work from two computers on different IPs. They also say the interface wrongly implies separate passwords are needed for Mail, Contacts, and Calendars, because macOS and iOS treat Google as a single internet account, so updating one app changes the shared setting. The post ends by asking whether this reading is correct or a misunderstanding.

Permalink

Fresco - A Beautiful Responsive Lightbox

What was saved here is an archive page, not a single article. It's a listing of teaser excerpts from what looks like a FAMU student publication, covering Black fashion and beauty trends, plant-based eating, sustainable fabrics, LGBTQ+ dating at an HBCU, Reesa Teesa's TikTok story, Greek life, protest and pandemic, the Drake and Metro Boomin rap beef, Haitian immigrant misinformation, and Leon County's slavery apology. Since no piece is developed beyond its opening lines, there's no argument to recover. One entry is an unrelated French-language promo for a 1xBet APK. If you meant to keep a specific article, such as the one on Black brands on the rise, it's worth re-saving from its own page.

Permalink

highlight.js

This is the usage section of the highlight.js documentation, covering two main ways to set up the syntax highlighter. With Node, you install it from npm and either import the full package, which loads all 193 languages, or import `highlight.js/lib/core` and register only the languages you need to keep bundle size down. You then call `hljs.highlight` or `highlightAuto`. In the browser, you add a CDN stylesheet and script (version 11.12.0 here), optionally load extra language files, and run `hljs.highlightAll()` to auto-detect and highlight `<pre><code>` blocks, with a `language-*` class available as an override when detection fails.

Permalink

uilang

uilang is a tiny (1KB) JavaScript library that lets web designers write English-like instructions inside a `<code>` element, such as `clicking on ".hide" adds class "hidden" on "div"`, to add, remove or toggle classes on elements when clicked. The CSS then does the real work, using those classes to show, hide, animate or transform things, which is enough for common patterns like tabs, popovers, overlays and sliding menus. It deliberately supports only click events and a single sentence structure (a selector, an add/remove/toggle verb, a class name, and a target selector or the `target` keyword for the clicked element) to keep the barrier to programming as low as possible.

Permalink

Timesheet.js - Open time tables with HTML, JavaScript and CSS …

Timesheet.js is a small, dependency-free JavaScript library (no jQuery or Angular) that renders an HTML5/CSS3 timeline of events from a simple array. You call `new Timesheet()` with a container ID, a start and end year, and a list of entries, each with a start date, an optional end date, a label, and a style type such as lorem, ipsum, or dolor. The page's example plots made-up periods and TV seasons across 2002–2013, and the output is meant to be restyled through CSS and to work on mobile.

Permalink