John Cox

Blogs · @wyome · Now · Shelf

Interesting

(500) http://aef-.github.io/jquery.masterblaster/

Documentation for masterblaster, a jQuery plugin (tested on 1.9.1) that turns an input into a tag-entry widget. It lists the config options (animation, validate-on-change, trigger keys defaulting to Tab and Enter, add button, help text) and the tagRules validators: unique, minLength, maxLength, and a regexp test. It also covers the three events (`mb:add`, `mb:remove`, `mb:error`) and a small API of push, pop, remove, and destroy, with code examples throughout.

Permalink

Fathom.js

Fathom.js is a jQuery plugin by Mark Dalgleish for building slideshow presentations out of plain HTML and CSS, with the pitch that a talk about JavaScript should itself be written in JavaScript. Slides are `div` elements inside a container, and navigation by mouse, keyboard and scrollbar is built in. Options cover single or continuous multi-slide display, custom class and tag names, scroll animation settings, and activate/deactivate callbacks. A `Fathom` class exposes `nextSlide`, `prevSlide`, `scrollToSlide` and `activateSlide` for custom controls, and slides fire `activateslide.fathom` and `deactivateslide.fathom` events for plugin-style extensions. Its distinguishing feature is video sync: a `timeline` of times, or time/slide pairs, drives slide changes in step with a Vimeo recording of the talk, which is the only video provider supported.

Permalink

Isomorphic JavaScript: The Future of Web Apps - Airbnb Engineering

Airbnb engineer Spike Brehm argues that client-only single-page apps built with Backbone, Ember, or Angular carry serious costs: poor SEO, slow first loads from blank pages, and duplicated logic like formatting, validation, and routing across client and server. His proposed fix is "isomorphic JavaScript," where the same app code runs in the browser and on Node.js, so the server can send fully rendered HTML while the client keeps its interactivity. He surveys early efforts (Mojito, Meteor, Asana's Luna, Airbnb's Rendr), lists the abstractions needed (routing, data fetching, view rendering, build tooling), and predicts that small composable modules will win over big frameworks, with a sample app to show it. He also bets that within a few years most advanced web apps will run some JavaScript on the server.

Permalink

Geocomplete - jQuery Geocoding and Places Autocomplete Plugin

Documentation for jQuery Geocomplete 1.7.0, a plugin from Ubilabs that turns a text input into a Google Places autocomplete field. It can optionally link to an interactive map and fill form fields or other containers with address components such as lat, lng, country_short and formatted_address, matched by name or a custom data attribute. The page covers setup (the Google Maps script with the Places library must load first), options like map, details, location, bounds, types and maxZoom, jQuery events such as geocode:result and geocode:dragged, and methods like `find` and `map`, plus a list of supported address component types and a set of live examples.

Permalink

Amazon supports Static JavaScript Apps

Dave Winer argues that browser JavaScript apps have traditionally needed a proxy server to talk to services like Twitter or Evernote, which forces developers to scale infrastructure and fund it through investors or advertising. He credits Dropbox with removing that need by letting browser code call it directly, so the service bears the scaling cost and charges users, and he says this is how his Fargo outliner works. He then reports that Amazon's new AWS SDK for JavaScript in the Browser does the same for its services. He tested it by uploading an image to an S3 bucket using a Facebook login with no proxy involved, and he hopes Evernote, WordPress and Twitter follow.

Permalink

27 Surreal Places To Visit Before You Die

A photo-gallery listicle of 27 natural and scenic wonders around the world, each with a short caption of a sentence or two. The entries run from Zhangye Danxia's rainbow sandstone, the Great Blue Hole, Son Doong cave and Salar de Uyuni to the Tulip fields, Antelope Canyon and Kelimutu's color-changing lakes. The captions add practical details: the Dutch tulip fields lie outside Keukenhof, the Ukrainian "Tunnel of Love" still has an active freight train, and the Haiku Stairs are officially closed. It works as a travel-inspiration bucket list rather than a deep argument.

Permalink

A Thought on HTML5 Geolocation | InstantShift

A hands-on tutorial for the HTML5 Geolocation API that covers feature-detecting `navigator.geolocation`, fetching a position with `getCurrentPosition` (success and error callbacks, plus the timeout, enableHighAccuracy and maximumAge options), and tracking movement with `watchPosition` and `clearWatch`. It also explains the fields of the returned coords object and notes that browsers must get user permission before sharing location. The last part shows how to plot the result on Google Maps, converting coordinates to a LatLng, adding a marker, and using reverse geocoding to show the street address in an info window on click.

Permalink

gRaphaël—Charting JavaScript Library

Makes the case for Raphael.js, a JavaScript library for drawing SVG graphics in the browser, by framing the web as an artist's canvas and Raphael as the brush. It walks through code comparisons showing that raw SVG markup gets clumsy, while Raphael draws the same circle in a few lines and can generate looped, gradient-styled shapes without leaving JavaScript. It positions Raphael against D3 as the simpler, artist-friendly option with a lower learning curve and support for old browsers like IE6, conceding that D3 is more powerful for complex business visualisation.

Permalink

When You Feel Powerful You Talk Too Much, and Your Subordinates Perform Poorly - Andrew O’Connell - Harvard Business Review

Research by Tost, Gino, and Larrick found that leaders primed to feel powerful hurt their teams' results: in a simulated Mount Everest expedition, teams with those leaders met 59% of their goals versus 76% for teams with unprimed leaders. The mechanism is verbal dominance. Powerful-feeling leaders talk over others, which signals they aren't open to input and dampens team performance. The researchers suggest countering this through an egalitarian culture, reminders of subordinates' importance, and encouraging employees to question leaders who dominate conversations.

Permalink

jQuery Autosize

Autosize is a small, dependency-free MIT-licensed JavaScript library (installable via npm) that makes textareas grow to fit their content. You call `autosize()` on a node, NodeList, or jQuery collection, and it resizes on typing and window resize. If another script changes the value or layout, you have to trigger `autosize.update()` or dispatch an `autosize:update` event; `autosize.destroy()` undoes everything, and an `autosize:resized` event fires after each adjustment. The FAQ is the useful reference part: set min/max height in CSS (the scrollbar returns past max-height), fix Safari sluggishness by dropping the blurred focus outline, and avoid wrong initial heights on hidden or detached textareas by giving them a fixed width, delaying initialization, or calling update after revealing them.

Permalink

We Don’t Need Daylight Saving Time

An infographic-style case for abolishing Daylight Saving Time, arguing it is an early-20th-century holdover that no longer serves its original purpose of cutting evening lighting use. It claims DST actually raises residential electricity use (0.6% to 4%), fuel consumption, CO2 output, and costs US consumers about $434 million. It also cites health harms such as a 5% rise in heart attacks after the spring shift, more suicides, and poorer sleep. It closes with adoption figures: 68% of countries and about 80% of people don't use it, and 14 countries have dropped it since 2000.

Permalink

JSDB.io - The Database of JavaScript Libraries

RxDB's landing page pitches it as a NoSQL, local-first database that runs inside JavaScript apps (browser, mobile, desktop, any runtime), giving zero-latency and offline-capable queries with observable realtime results. Its sync engine can use prebuilt replication plugins or a custom backend by implementing just three endpoints (pull, push, and a stream), and the app can even run with no backend at all. Schemas are defined in JSON Schema, and the page leans heavily on testimonials from companies like Readwise, MoreApp, and WooCommerce POS who use it for offline field-work and point-of-sale apps, plus links to posts on storage options (IndexedDB, OPFS, WASM-SQLite), realtime transports, the RxDB 17 release, and a local vector database.

Permalink

Formance.js by Omar Shammas

jQuery.formance is a general-purpose jQuery plugin, inspired by Stripe's jQuery.payment, that adds input formatting and validation to form fields. It exists for the sake of user experience, on the premise that client-side checks never replace server-side validation but are still worth doing. Beyond the usual credit card number, expiry and CVC fields, it covers phone numbers, dd/mm/yyyy and yyyy/mm/dd dates, emails (a lenient and a stricter algorithm), Canadian postal codes, Ontario ID numbers (driver's license, health card, outdoors card), YY/MM durations and UK sort codes. Each field gets a `format_*` and a `validate_*` call, with options set through data attributes, plus helpers like `val_dd_mm_yyyy` and `creditCardType`.

Permalink