John Cox

Blogs · @wyome · Now · Shelf

Interesting

Absolute Beginner's Guide to Swift

A beginner's primer on Swift written just after Apple unveiled it in 2014, framing it as the replacement for the nearly 30-year-old Objective-C and as "safe, modern and powerful." It covers setting up Xcode 6 playgrounds or the terminal REPL, then walks through the basics with short code samples: var vs. let (favoring immutability), type inference, string interpolation, arrays and dictionaries, loops, if and switch (exhaustive, range-matching), and function declarations. It's a Treehouse blog post that closes by promoting their Swift courses, and the syntax is from the early beta (println, ++i, C-style for loops), so it's dated as working code but useful as a snapshot of Swift's original pitch.

Permalink

jQuery Before/After Plugin | Catch My Fame

This is a bundle of three blog excerpts from what looks like a phone-services marketing site. The first explains IVR (automated phone menus driven by keypad or voice) and its spread into phone dating, profiling chat-line services like Friend-O-Phone, ChatlineDating and thechatlinenumbers as examples of well-designed systems. The second lists communication tools for real estate, such as Skype credits, magicJack, messaging apps and web conferencing for clients and agents working across borders. The third covers common IVR failings, including deep menu trees (three levels recommended), counterintuitive prompts, and no call-back or live-agent option, while again holding up ChatlineDating as a good example. The dating-company praise reads as promotional, so the most useful material is probably the IVR design advice.

Permalink

QUnit

This is the landing page for QUnit, a JavaScript unit testing framework, pitched on being easy (no configuration for Node.js, minimal setup for browsers), universal (runs in browsers, Node, SpiderMonkey, even Web Workers), and extensible through APIs for custom assertions, runners, and reporters. It shows a short example testing an `add` function with `QUnit.module` and `QUnit.test`, with output in both the browser and TAP-format CLI. It also lists the current release as v2.26.0 and the install options (direct download, npm, Yarn), plus links for support, chat, and following the project on Mastodon or Bluesky.

Permalink

Hide your header on scroll - Headroom.js

Documentation for Headroom.js, a dependency-free JavaScript widget that hides a fixed header when the user scrolls down and brings it back on scroll up. The pitch is that fixed headers eat too much screen space, on landscape desktops and portrait phones alike. It works by toggling CSS classes (pinned, unpinned, top, bottom, frozen), so the actual effect is left to your CSS, with a transform transition recommended for performance. It covers the options (offset, tolerance, custom classes, scroller, callbacks), methods like pin, freeze and destroy, a scroll-padding fix for anchor links obscured by the header, jQuery and AngularJS wrappers, required browser APIs with a feature test, and a changelog running from 2014 to v0.12.0 (2020).

Permalink

An Introduction To Node.js And MongoDB | Smashing Magazine

A beginner tutorial by Elliot Bonneville on wiring a Node.js server to a MongoDB database using the MongoJS library, with a free MongoLab-hosted demo database. It walks through creating an HTTP server, connecting via a MongoDB URI and a list of collections, running a `find({"color": "red"})` query with error handling, and looping over the returned records to build an HTML string served to the browser on localhost:8888. It's a minimal, string-concatenation approach (no Express or templating), and the author admits security and robust error handling are left out.

Permalink

Untitled (http://www.nytimes.com/interactive/2014/upshot/buy-rent-calculator.html?smid=tw-nytimes)

An interactive New York Times calculator for the rent-versus-buy decision. It finds the "equivalent rent": the monthly rent at which renting and buying come out even for your situation. If you can rent a similar home for less, renting wins. The calculator weighs home price, length of stay, mortgage terms, expected growth in prices, rents and investments, taxes, closing costs, and maintenance. It treats the down payment as money you could have invested instead, and its charts show which inputs move the answer most. Home price and how long you stay matter a lot, while extras like broker fees and security deposits matter little.

Permalink

Elizabeth Kolbert: Why Are We So Busy? : The New Yorker

Keynes predicted in 1930 that economic growth would bring a fifteen-hour work week by 2028. Growth has delivered, with U.S. GDP up sixteenfold, but leisure hasn't followed. The piece uses Brigid Schulte's book *Overwhelmed* (which blames status-driven busyness, mental multitasking, and unequal housework) alongside the economists in *Revisiting Keynes*. They propose that consumer wants expand endlessly, that cultures learn to consume rather than rest, and that work gives life meaning. It adds that the affluent feel the most time-pressed, since long hours pay more and time off costs them more, and it closes by noting that we still act as if more wealth is the answer.

Permalink

Elizabeth Kolbert: Why Are We So Busy? : The New Yorker

Keynes predicted in 1930 that economic growth would bring a fifteen-hour work week by 2028. Growth arrived on schedule, but the leisure didn't, and this piece uses Brigid Schulte's book *Overwhelmed* and the essay collection *Revisiting Keynes* to ask why. Schulte's explanations are status-driven busyness, mental "tape-loops," and the unequal division of housework. The economists add habit-forming and ever-expanding consumption, European versus American choices about trading income for time, and the view that work gives life meaning. The most striking finding is that the high earners feel the most time-starved, probably because the "long-hours premium" and the opportunity cost of every hour off are so steep. The piece closes on the irony that we still treat more wealth as the answer.

Permalink

StrongLifts 5x5: A Simple Workout To Get Stronger

This is the hub page for Stronglifts 5×5, a beginner barbell program built on five sets of five reps with steady weight increases. It works as a quick-start guide plus an index of deeper pieces on progressive overload, adding accessory work for arms and abs, combining cardio with lifting, failed reps, plateaus, and the history of 5×5 routines from Reg Park onward. It also promotes the free app and spreadsheets, and lists follow-on programs for after the beginner phase, including upper/lower splits, a low-volume option, a maintenance routine, and a dumbbell-only hotel-gym workout.

Permalink